- 29 Mar, 2014 9 commits
-
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
-
Damien George authored
The compiler allocates 7 entries on the stack for a with statement (following CPython, but probably can be reduced). This is enough for the method load and call in SETUP_WITH.
-
Damien George authored
-
Damien George authored
Addresses issue #388.
-
Damien George authored
Partly (very partly!) addresses issue #386. Most importantly, at the REPL command line, each invocation does not now lead to increased memory usage (unless you define a function/lambda).
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
This reduntant triple is one of the ugliest parts of Python, which they chickened out to fix in Python3. We really should consider passing just as single exception instance (without breaking Python-level APIs of course), but until we do, let's follow CPython layout.
-
Paul Sokolovsky authored
Will be reused in WITH bytecodes.
-
- 28 Mar, 2014 2 commits
-
-
Paul Sokolovsky authored
Handling of GeneratorExit is really peculiar - it subverts normal exception propagation rules.
-
Paul Sokolovsky authored
-
- 27 Mar, 2014 2 commits
-
-
Damien George authored
Rationale: setting up the stack (state for locals and exceptions) is really part of the "code", it's the prelude of the function. For example, native code adjusts the stack pointer on entry to the function. Native code doesn't need to know n_state for any other reason. So putting the state size in the bytecode prelude is sensible. It reduced ROM usage on STM by about 30 bytes :) And makes it easier to pass information about the bytecode between functions.
-
Damien George authored
-
- 26 Mar, 2014 4 commits
-
-
Paul Sokolovsky authored
-
Damien George authored
-
Damien George authored
-
Paul Sokolovsky authored
-
- 23 Mar, 2014 2 commits
-
-
Paul Sokolovsky authored
For this, needed to implement DELETE_NAME bytecode (because var bound in except clause is automatically deleted at its end). http://docs.python.org/3/reference/compound_stmts.html#except : "When an exception has been assigned using as target, it is cleared at the end of the except clause."
-
Paul Sokolovsky authored
Based on issues raised during recent review and inconsistency of different implementations.
-
- 22 Mar, 2014 3 commits
-
-
Damien George authored
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
This is required to properly handle exceptions across yields.
-
- 17 Mar, 2014 1 commit
-
-
xbe authored
Remove unnecessary includes. Add includes that improve portability.
-
- 20 Feb, 2014 1 commit
-
-
Damien George authored
-
- 19 Feb, 2014 2 commits
-
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
-
- 15 Feb, 2014 2 commits
-
-
Damien George authored
Addresses issue #290, and hopefully sets up things to allow generators throwing exceptions, etc.
-
Damien George authored
Each built-in exception is now a type, with base type BaseException. C exceptions are created by passing a pointer to the exception type to make an instance of. When raising an exception from the VM, an instance is created automatically if an exception type is raised (as opposed to an exception instance). Exception matching (RT_BINARY_OP_EXCEPTION_MATCH) is now proper. Handling of parse error changed to match new exceptions. mp_const_type renamed to mp_type_type for consistency.
-
- 14 Feb, 2014 1 commit
-
-
Damien George authored
-
- 13 Feb, 2014 1 commit
-
-
Paul Sokolovsky authored
-
- 01 Feb, 2014 5 commits
-
-
Damien George authored
IS_NOT and NOT_IN are now compiled to IS + NOT and IN + NOT, with a new special NOT bytecode.
-
Damien George authored
Still todo: break/continue from within the finally block itself.
-
Damien George authored
-
Paul Sokolovsky authored
TODO: Decide if we really need separate bytecode for creating functions with default arguments - we would need same for closures, then there're keywords arguments too. Having all combinations is a small exponential explosion, likely we need just 2 cases - simplest (no defaults, no kw), and full - defaults & kw.
-
Paul Sokolovsky authored
This properly implements return from try/finally block(s). TODO: Consider if we need to do any value stack unwinding for RETURN_VALUE case. Intuitively, this is "success" return, so value stack should be in good shape, and unwinding shouldn't be required.
-
- 31 Jan, 2014 2 commits
-
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
Also, handle SETUP_FINALLY opcode.
-
- 30 Jan, 2014 1 commit
-
-
Paul Sokolovsky authored
Allows to have nested try blocks with except filters. TODO: Don't add END_FINALLY's exception re-raise points to traceback.
-
- 29 Jan, 2014 2 commits
-
-
Damien George authored
We still have FAST_[0,1,2] byte codes, but they now just access the fastn array (before they had special local variables). It's now simpler, a bit faster, and uses a bit less stack space (on STM at least, which is most important). The only reason now to keep FAST_[0,1,2] byte codes is for compressed byte code size.
-
Damien George authored
LOAD_METHOD bug was: emitbc did not correctly calculate the amount of stack usage for a LOAD_METHOD operation. small int bug was: int was being used to pass small ints, when it should have been machine_int_t.
-