summaryrefslogtreecommitdiff
path: root/py/compile.c
AgeCommit message (Collapse)Author
2014-04-02py: Wrap compile_scope_inline_asm in #if; remove comment from misc.h.Damien George
2014-04-02py: Enable a jump optimisation in the compiler.Damien George
2014-04-02py: Move to Python 3.4.0 compatibility.Damien George
Very little has changed. In Python 3.4 they removed the opcode STORE_LOCALS, but in Micro Python we only ever used this for CPython compatibility, so it was a trivial thing to remove. It also allowed to clean up some dead code (eg the 0xdeadbeef in class construction), and now class builders use 1 less stack word. Python 3.4.0 introduced the LOAD_CLASSDEREF opcode, which I have not yet understood. Still, all tests (apart from bytecode test) still pass. Bytecode tests needs some more attention, but they are not that important anymore.
2014-03-31py: Fix bug in optimised for .. range.Damien George
Don't store final, failing value to the loop variable. This fix also makes for .. range a bit more efficient, as it uses less store/load pairs for the loop variable.
2014-03-31py: Towards default keyword arguments.Damien George
These are default arguments after a bare *.
2014-03-31Merge branch 'master' of github.com:micropython/micropythonDamien George
2014-03-31py: Rename and reorder parameters in emit_make_function/closure.Damien George
In preparation for implementing default keyword arguments.
2014-03-31compile: Don't try to constant-fold division by zero.Paul Sokolovsky
The way it is, just crashes app. And optimizing to "raise ZeroDivisionError" is probably too much.
2014-03-30py: Fix bug in compiler for empty class bases.Damien George
Eg class A(): pass would fail an assertion.
2014-03-30Rename rt_* to mp_*.Damien George
Mostly just a global search and replace. Except rt_is_true which becomes mp_obj_is_true. Still would like to tidy up some of the names, but this will do for now.
2014-03-30compile: Print error messages on unimplemented relative imports.Paul Sokolovsky
2014-03-29Merge pull request #389 from pfalcon/with-statementDamien George
With statement implementation
2014-03-29py: Free unique_code slot for outer module.Damien George
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).
2014-03-29vm: Implement "with" statement (SETUP_WITH and WITH_CLEANUP bytecodes).Paul Sokolovsky
2014-03-27py: Factor out code from runtime.c to emitglue.c.Damien George
2014-03-27py: Calculate maximum exception stack size in compiler.Damien George
2014-03-26py: Restore CPython compatibility in compiler for closures with def args.Damien George
2014-03-26py: Support closures with default args.Paul Sokolovsky
2014-03-22Fixed floor division on mp ints and small ints. Added a floordivide test case.Rachel Dowdall
2014-03-22Fixed modulo operator on ints and mp ints to agree with python. Added ↵Rachel Dowdall
intdivmod.c and tests/basics/modulo.py.
2014-03-17py: Clean up includes.xbe
Remove unnecessary includes. Add includes that improve portability.
2014-03-03py: Unify syntax error handling in compiler; check defualt arg syntax.Damien George
Checks for non-default args following default args, and errors out. Addresses issue #328.
2014-02-26py: Remove name of var arg from macros with var args.Damien George
2014-02-22parse: Refactor parse node encoding to support full range of small ints.Paul Sokolovsky
Based on suggestion by @dpgeorge at https://github.com/micropython/micropython/pull/313
2014-02-21parse: Note that fact that parser's small ints are different than VM small int.Paul Sokolovsky
Specifically, VM's small ints are 31 bit, while parser's only 28. There's already MP_OBJ_FITS_SMALL_INT(), so, for clarity, rename MP_FIT_SMALL_INT() to MP_PARSE_FITS_SMALL_INT().
2014-02-20compile: Add comments ergarding non-implemented relative imports.Paul Sokolovsky
2014-02-15py: Pass all scope flags through to runtime.Damien George
2014-02-12Replace global "static" -> "STATIC", to allow "analysis builds". Part 2.Paul Sokolovsky
2014-02-10Clean up handling of function return type annotation.Paul Sokolovsky
2014-02-06py: Fix compile of class with keyword arguments in bases.Damien George
2014-02-05py: Add built-in super.Damien George
2014-02-01py: Tidy up BINARY_OPs; negation done by special NOT bytecode.Damien George
IS_NOT and NOT_IN are now compiled to IS + NOT and IN + NOT, with a new special NOT bytecode.
2014-02-01py: Reduce code size of compiler by a bit.Damien George
2014-02-01py: Implement break/continue from an exception with finally.Damien George
Still todo: break/continue from within the finally block itself.
2014-02-01Implement default function arguments (for Python functions).Paul Sokolovsky
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.
2014-01-29py: Fix bug with LOAD_METHOD; fix int->machine_int_t for small int.Damien George
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.
2014-01-28py: Implement 'not' in compiler, and improve rt_is_true.Damien George
2014-01-24py: Improve freeing of emitters in mp_compile.Damien George
There can be multiple emitters allocated during compile (eg byte code and native).
2014-01-24Add support for freeing code emitter objects at the end of compilation.Paul Sokolovsky
2014-01-23mp_compile(): Properly free module_scope and all nested scopes.Paul Sokolovsky
2014-01-23py: Use C99 way of variable macro arguments.Damien George
Addresses Issue #207.
2014-01-23py: Change macro var args in parser to be C99 compliant.Damien George
2014-01-21py: Implement break and continue byte codes, and add tests.Damien George
Also fixes a bug in the for-in-range optimiser. I hope to remove break and continue byte codes in the future and just use jump (if possible).
2014-01-21Revamp qstrs: they now include length and hash.Damien George
Can now have null bytes in strings. Can define ROM qstrs per port using qstrdefsport.h
2014-01-19py: Add module/function/class name to exceptions.Damien George
Exceptions know source file, line and block name. Also tidy up some debug printing functions and provide a global flag to enable/disable them.
2014-01-18Add source file name and line number to error messages.Damien George
Byte code has a map from byte-code offset to source-code line number, used to give better error messages.
2014-01-15Implement eval.Damien George
2014-01-12py: AssertionError is loaded from global, to match CPython.Damien George
2014-01-11unified the bopsJohn R. Lenton
2014-01-11compile_for_stmt_optimised_range(): Properly handle negative & unknown steps.Paul Sokolovsky
If step is not constant, in first approximation, we can't apply optimization, (well, we could, but need a special case for this).