summaryrefslogtreecommitdiffstatshomepage
path: root/py
Commit message (Collapse)AuthorAge
* py: Rename mp_exc_stack to mp_exc_stack_t.Damien George2014-03-30
|
* py: Fix reraise logic.Damien George2014-03-30
|
* vm: Save current active exception on opening new try block.Paul Sokolovsky2014-03-30
| | | | | | | | | | | Required to reraise correct exceptions in except block, regardless if more try blocks with active exceptions happen in the same except block. P.S. This "automagic reraise" appears to be quite wasteful feature of Python - we need to save pending exception just in case it *might* be reraised. Instead, programmer could explcitly capture exception to a variable using "except ... as var", and reraise that. So, consider disabling argless raise support as an optimization.
* vm: WITH_CLEANUP: use POP_EXC_BLOCK().Paul Sokolovsky2014-03-30
|
* vm: Establish macros PUSH_EXC_BLOCK & POP_EXC_BLOCK to deal with exc stack.Paul Sokolovsky2014-03-29
| | | | E.g. to handle currently_in_except_block restoring properly.
* py: Reraising exception possible only in except block.Paul Sokolovsky2014-03-29
|
* Merge branch 'master' of github.com:micropython/micropythonDamien George2014-03-29
|\
| * vm: Elaborate comments for WITH_CLEANUP, other cosmetic fixes.Paul Sokolovsky2014-03-29
| |
* | py: Support mpz -op- float, mpz -op- complex, and complex -op- mpz.Damien George2014-03-29
|/
* py: Make MP_BC_SETUP_WITH use the bytecode stack for load_method.Damien George2014-03-29
| | | | | | 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.
* Merge pull request #389 from pfalcon/with-statementDamien George2014-03-29
|\ | | | | With statement implementation
| * vm: Implement "with" statement (SETUP_WITH and WITH_CLEANUP bytecodes).Paul Sokolovsky2014-03-29
| |
* | py: Fix regress with GeneratorExit object becoming truly const.Damien George2014-03-29
| |
* | py: Rename old const type objects to mp_type_* for consistency.Damien George2014-03-29
| |
* | py: Change mp_const_* objects to macros.Damien George2014-03-29
| | | | | | | | Addresses issue #388.
* | Merge pull request #383 from pfalcon/yield-fromDamien George2014-03-29
|\ \ | | | | | | Implement "yield from"
| * | py: yield from: Elaborate GeneratorExit (gen.close()) handling.Paul Sokolovsky2014-03-28
| | | | | | | | | | | | | | | Handling of GeneratorExit is really peculiar - it subverts normal exception propagation rules.
| * | py: Core "yield from" implementation.Paul Sokolovsky2014-03-28
| | |
* | | py: Fix typo printing complex numbers that are purely imaginary.Damien George2014-03-29
| | |
* | | py: Free unique_code slot for outer module.Damien George2014-03-29
| |/ |/| | | | | | | | | 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).
* | vm: Make sure that exception triple is <type, instance, traceback>.Paul Sokolovsky2014-03-29
| | | | | | | | | | | | | | 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.
* | vm: Factor out exception block setup to a macro.Paul Sokolovsky2014-03-29
| | | | | | | | Will be reused in WITH bytecodes.
* | Merge pull request #382 from pfalcon/genexit-instDamien George2014-03-29
|\ \ | | | | | | objgenerator: close(): Throw instance of GeneratorExit (not type).
| * | objgenerator: close(): Throw instance of GeneratorExit (not type).Paul Sokolovsky2014-03-28
| |/ | | | | | | | | To comply with Python semantics and allow use of mp_obj_is_subclass_fast() for exception matching.
* / py: Fix bugs with debugging output.Damien George2014-03-28
|/ | | | | | | show_bc now decodes the prelude correctly. Moved WRITE_FILE stuff from runtime.c to emitglue.c. Addresses issue #385.
* showbc: Add few bytecodes related to "with".Paul Sokolovsky2014-03-28
|
* py: Thin out predefined exceptions.Damien George2014-03-27
| | | | | Only exceptions that are actually used are left prefedined. Hierarchy is still there, and removed exceptions are just commented out.
* py: Fix typo printing complex numbers.Damien George2014-03-27
|
* py: Rename emit_pre so they have globally unique names.Damien George2014-03-27
|
* py: Factor out code from runtime.c to emitglue.c.Damien George2014-03-27
|
* py: complex_print uses format_float if single precision fp used.Damien George2014-03-27
|
* py: Put n_state for bytecode in the bytecode prelude.Damien George2014-03-27
| | | | | | | | | | | 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.
* py: Calculate maximum exception stack size in compiler.Damien George2014-03-27
|
* py: Fix bug in type_store_attr, trying to store to ROM.Damien George2014-03-27
|
* py: Restore CPython compatibility in compiler for closures with def args.Damien George2014-03-26
|
* Merge pull request #381 from pfalcon/closure-defargsDamien George2014-03-26
|\ | | | | py: Support closures with default args.
| * py: Support closures with default args.Paul Sokolovsky2014-03-26
| |
* | Merge branch 'master' of github.com:micropython/micropythonDamien George2014-03-26
|\ \
| * | py: Implement getattr() builtin.Paul Sokolovsky2014-03-27
| | |
* | | py: Fix logic bugs in object attribute/method extraction.Damien George2014-03-26
| | |
* | | py: Improved builtin dir.Damien George2014-03-26
|/ /
* / Remove mp_obj_type_t.methods entry and use .locals_dict instead.Damien George2014-03-26
|/ | | | | | | | | | | | | | | | | | | | | | Originally, .methods was used for methods in a ROM class, and locals_dict for methods in a user-created class. That distinction is unnecessary, and we can use locals_dict for ROM classes now that we have ROMable maps. This removes an entry in the bloated mp_obj_type_t struct, saving a word for each ROM object and each RAM object. ROM objects that have a methods table (now a locals_dict) need an extra word in total (removed the methods pointer (1 word), no longer need the sentinel (2 words), but now need an mp_obj_dict_t wrapper (4 words)). But RAM objects save a word because they never used the methods entry. Overall the ROM usage is down by a few hundred bytes, and RAM usage is down 1 word per user-defined type/class. There is less code (no need to check 2 tables), and now consistent with the way ROM modules have their tables initialised. Efficiency is very close to equivaluent.
* Change mp_method_t.name from const char * to qstr.Damien George2014-03-26
| | | | Addresses issue #377.
* py: Swap around the double return value of mp_obj_gen_resume.Damien George2014-03-26
| | | | Just to keep things consistent :)
* py: Replace mp_const_stop_iteration object with MP_OBJ_NULL.Damien George2014-03-26
|
* Merge pull request #379 from pfalcon/reraiseDamien George2014-03-26
|\ | | | | vm: Implement raise statement w/o args (reraising last exception).
| * vm: Implement raise statement w/o args (reraising last exception).Paul Sokolovsky2014-03-26
| |
* | Merge branch 'master' of github.com:micropython/micropythonDamien George2014-03-26
|\ \
| * | objexcept: Add mp_obj_exception_get_value() convenience function.Paul Sokolovsky2014-03-26
| |/ | | | | | | | | | | | | This gets "value" of exceptions in the sense as it's defined for StopIteration.value (i.e. args[0] or None). TODO: This really should be inline function.
* | py: Use _is_subclass_fast instead of _exception_match.Damien George2014-03-26
| |