314 Commits (de5a9d72dcdaacdd5048195cd5bab007f4b2baef)

Author SHA1 Message Date
Damien George e181c0dc07 py: Fix optimised for-loop compiler so it follows proper semantics.
8 years ago
Damien George c33ce606cf py: Fix a semantic issue with range optimisation.
8 years ago
Damien George 969a6b37bf py: Make functions static where appropriate.
8 years ago
Paul Sokolovsky 039887a0ac py: Fix bug with right-shifting small ints by large amounts.
8 years ago
Damien George 391db8669b py: Add more compiler optimisations for constant if/while conditions.
8 years ago
Damien George 235f9b33c8 py: Simplify compilation of elif blocks.
8 years ago
Damien George 090c9236e8 py: Fix compiling of nested while/for and exception handler.
8 years ago
Damien George a91ac2011f py: Make compiler return a proper exception on SyntaxError.
8 years ago
Damien George 00be7a849a py: Fix unix-cpy to compile with uint->mp_uint_t changes.
8 years ago
Damien George 39dc145478 py: Change [u]int to mp_[u]int_t in qstr.[ch], and some other places.
8 years ago
Damien George 42f3de924b py: Convert [u]int to mp_[u]int_t where appropriate.
8 years ago
Damien George 52b5d76a6b py: Free non-interned strings in the parser when not needed.
8 years ago
Damien George 7ff996c237 py: Convert [u]int to mp_[u]int_t in emit.h and associated .c files.
9 years ago
Damien George c90f59ec3a py: Add support for emitting native x86 machine code.
9 years ago
Damien George dda46460ff Code style/whitespace cleanup; remove obsolete headers.
9 years ago
Damien George eb4e18f057 py: Add compiler optimisation for conditions in parenthesis.
9 years ago
Fabian Vogt fe3d16e8c2 Basic native ARM emitter
9 years ago
Damien George a5190a7dac py: Fix typing of viper locals; allow default types in annotation.
9 years ago
Damien George 2ac4af6946 py: Allow viper to have type annotations.
9 years ago
Damien George 6be0b0a8ec py: Clean up and simplify functions in scope; add STATIC in compiler.
9 years ago
Paul Sokolovsky 8215847b4d moductypes: Foreign data interface module, roughly based on ctype ideas.
9 years ago
Damien George 40f3c02682 Rename machine_(u)int_t to mp_(u)int_t.
9 years ago
Damien George b601d9574a py: Improvements to native emitter.
9 years ago
Paul Sokolovsky 59c675a64c py: Include mpconfig.h before all other includes.
9 years ago
Emmanuel Blot f6932d6506 Prefix ARRAY_SIZE with micropython prefix MP_
9 years ago
Damien George f0778a7ccb py: Implement default keyword only args.
9 years ago
Damien George 5b5562c1d1 py: Fix stack underflow with optimised for loop.
9 years ago
Damien George 25c84643b6 py: Fix break from within a for loop.
9 years ago
Damien George d1e355ea8e py: Fix check of small-int overflow when parsing ints.
9 years ago
Damien George 5042bce8fb py: Don't automatically intern strings in parser.
9 years ago
Damien George 58ebde4664 Tidy up some configuration options.
9 years ago
Damien George 96f137b24a py: Rename BYTE_CODE to BYTECODE (this was missed in previous rename).
9 years ago
Damien George 3417bc2f25 py: Rename byte_code to bytecode everywhere.
9 years ago
Damien George ffae48d750 py, compiler: Add basic support for A=const(123).
9 years ago
Damien George 36db6bcf54 py, compiler: Improve passes; add an extra pass for native emitter.
9 years ago
Damien George ca25c15d56 py, compiler: Start adding support for compile-time constants.
9 years ago
Damien George 04b9147e15 Add license header to (almost) all files.
9 years ago
Damien George 708c073250 py: Add '*' qstr for 'import *'; use blank qstr for comprehension arg.
9 years ago
Damien George 968bf34c4c py: Remove unnecessary LOAD_CONST_ID bytecode.
9 years ago
Damien George 9d181f62dc py: Save some ROM by shortening compiler error messages.
9 years ago
Damien George 2c0842b3c5 py: Change the way function arguments are compiled.
9 years ago
Damien George 2827d62e8b py: Implement keyword-only args.
9 years ago
Damien George 6d3c5e4301 Add ARRAY_SIZE macro, and use it where possible.
9 years ago
Damien George 1463c1fa82 py: Add MICROPY_ENABLE_DOC_STRING, disabled by default.
9 years ago
Damien George e5f8a77db6 py: Add 'align' and 'data' meta-instructions to inline assembler.
9 years ago
Damien George 3558f62fb5 py: Making closures now passes pointer to stack, not a tuple for vars.
9 years ago
Damien George 729f7b42d6 py: Merge BINARY_OP_SUBSCR and store_subscr (w/ delete) into subscr.
9 years ago
Damien George df8127a17e py: Remove unique_codes from emitglue.c. Replace with pointers.
9 years ago
Damien George a26dc50968 py: Improve inline assembler; improve compiler constant folding.
9 years ago
Damien George 7b4330191f py, compiler: Fix up creation of default positionals tuple.
9 years ago
Damien George 8b19db00aa py, compiler: Fix compiling of keyword args following named star.
9 years ago
Damien George 69b89d21b2 py: Change compile order for default positional and keyword args.
9 years ago
Damien George 0e3329a6b8 py, compiler: Allow lambda's to yield.
9 years ago
Damien George 0288cf020e py: Implement compiling of *-expr within parenthesis.
9 years ago
Damien George 57e99ebc86 py: Add simple way of looking up constants in compiler.
9 years ago
Damien George d66ae18640 py: Simplify stack get/set to become stack adjust in emitters.
9 years ago
Damien George 069a35e3a5 py, compiler: Improve stack depth counting.
9 years ago
Damien George 6f355fd3b9 py: Make labels unsigned ints (converted from int).
9 years ago
Damien George 635543c72c py, compiler: Implement compiling of relative imports.
9 years ago
Damien George 2bf7c09222 py: Properly implement deletion of locals and derefs, and detect errors.
9 years ago
Damien George 11d8cd54c9 py, compiler: Turn id_info_t.param into a set of flags.
9 years ago
Damien George b140bff877 py, compile: Simplify initialisation of compiler structure.
9 years ago
Damien George 02a4c05c5f py, compile: Reduce size of compiler structure.
9 years ago
Damien George 922ddd6415 py, compile: Combine have_star_arg, have_dbl_star_arg into star_flags.
9 years ago
Damien George 78035b995f py, compiler: Clean up and compress scope/compile structures.
9 years ago
Damien George 495d781a36 py: implement UNPACK_EX byte code (for: a, *b, c = d)
9 years ago
Damien George b7ffdcc1c7 py: Improve compiler syntax errors; catch more errors.
9 years ago
Damien George cdd96dff2c py: Implement more features in native emitter.
9 years ago
Damien George 65cad12d38 py: Add option to compiler to specify default code emitter.
9 years ago
Damien George af27259439 py: Enable optimisation of multiplying 2 small ints in compiler.
9 years ago
Damien George ecf5b77123 py: This time, real proper overflow checking of small int power.
9 years ago
Damien George 094d450003 py: Wrap compile_scope_inline_asm in #if; remove comment from misc.h.
9 years ago
Damien George af6edc61bd py: Enable a jump optimisation in the compiler.
9 years ago
Damien George 882b363564 py: Move to Python 3.4.0 compatibility.
9 years ago
Damien George 3ff2d03891 py: Fix bug in optimised for .. range.
9 years ago
Damien George e337f1ef5e py: Towards default keyword arguments.
9 years ago
Damien George 1aa2c10263 Merge branch 'master' of github.com:micropython/micropython
9 years ago
Damien George 3056509e00 py: Rename and reorder parameters in emit_make_function/closure.
9 years ago
Paul Sokolovsky 96eec4f8a6 compile: Don't try to constant-fold division by zero.
9 years ago
Damien George 804760bfca py: Fix bug in compiler for empty class bases.
9 years ago
Damien George d17926db71 Rename rt_* to mp_*.
9 years ago
Paul Sokolovsky 8d9cc2e669 compile: Print error messages on unimplemented relative imports.
9 years ago
Damien George 21a07dc50f Merge pull request #389 from pfalcon/with-statement
9 years ago
Damien George d1e443d0bc py: Free unique_code slot for outer module.
9 years ago
Paul Sokolovsky 44307d5ef8 vm: Implement "with" statement (SETUP_WITH and WITH_CLEANUP bytecodes).
9 years ago
Damien George 2326d52d20 py: Factor out code from runtime.c to emitglue.c.
9 years ago
Damien George 8dcc0c7924 py: Calculate maximum exception stack size in compiler.
9 years ago
Damien George bdcbf0fcd1 py: Restore CPython compatibility in compiler for closures with def args.
9 years ago
Paul Sokolovsky 2447a5b582 py: Support closures with default args.
9 years ago
Rachel Dowdall 56402796d8 Fixed floor division on mp ints and small ints. Added a floordivide test case.
9 years ago
Rachel Dowdall cde8631f15 Fixed modulo operator on ints and mp ints to agree with python. Added intdivmod.c and tests/basics/modulo.py.
9 years ago
xbe efe3422394 py: Clean up includes.
9 years ago
Damien George f41fdd05b0 py: Unify syntax error handling in compiler; check defualt arg syntax.
9 years ago
Damien George 1dc76af7bf py: Remove name of var arg from macros with var args.
9 years ago
Paul Sokolovsky 56e5ef203b parse: Refactor parse node encoding to support full range of small ints.
9 years ago
Paul Sokolovsky bbf0e2fe12 parse: Note that fact that parser's small ints are different than VM small int.
9 years ago
Paul Sokolovsky a1aba36feb compile: Add comments ergarding non-implemented relative imports.
9 years ago
Damien George 8725f8f7de py: Pass all scope flags through to runtime.
9 years ago
Paul Sokolovsky 520e2f58a5 Replace global "static" -> "STATIC", to allow "analysis builds". Part 2.
9 years ago
Paul Sokolovsky 2f0b026a44 Clean up handling of function return type annotation.
9 years ago
Damien George bbcd49a496 py: Fix compile of class with keyword arguments in bases.
9 years ago
Damien George 35e2a4e6bb py: Add built-in super.
9 years ago
Damien George 9aa2a527b5 py: Tidy up BINARY_OPs; negation done by special NOT bytecode.
9 years ago
Damien George 7e5fb24e3b py: Reduce code size of compiler by a bit.
9 years ago
Damien George cbddb279bb py: Implement break/continue from an exception with finally.
9 years ago
Paul Sokolovsky 90750029df Implement default function arguments (for Python functions).
9 years ago
Damien George 08d075592f py: Fix bug with LOAD_METHOD; fix int->machine_int_t for small int.
9 years ago
Damien George e4b6a079b3 py: Implement 'not' in compiler, and improve rt_is_true.
9 years ago
Damien George 41d02b654e py: Improve freeing of emitters in mp_compile.
9 years ago
Paul Sokolovsky f46d87a30d Add support for freeing code emitter objects at the end of compilation.
9 years ago
Paul Sokolovsky fd31358505 mp_compile(): Properly free module_scope and all nested scopes.
9 years ago
Damien George b979122dfb py: Use C99 way of variable macro arguments.
9 years ago
Damien George 00208ce194 py: Change macro var args in parser to be C99 compliant.
9 years ago
Damien George 600ae734cf py: Implement break and continue byte codes, and add tests.
9 years ago
Damien George 55baff4c9b Revamp qstrs: they now include length and hash.
9 years ago
Damien George cbd2f7482c py: Add module/function/class name to exceptions.
9 years ago
Damien George 08335004cf Add source file name and line number to error messages.
9 years ago
Damien George d02c6d8962 Implement eval.
9 years ago
Damien George e5863d9301 py: AssertionError is loaded from global, to match CPython.
9 years ago
John R. Lenton b8698fca75 unified the bops
9 years ago
Paul Sokolovsky 899c69f94c compile_for_stmt_optimised_range(): Properly handle negative & unknown steps.
9 years ago
Damien George 71c5181a8d Convert Python types to proper Python type hierarchy.
9 years ago
Damien George eb7bfcb286 Split qstr into pools, and put initial pool in ROM.
9 years ago
Damien George e67ed5d285 Improve configurability for native x64/thumb emitter.
9 years ago
Damien George 1fb031744f Change mp_compile so that it returns a function object for the module.
9 years ago
Damien George fe8fb9165c py: remove depedence on strcat and stpcpy.
9 years ago
Damien George 6baf76e28b py: make closures work.
9 years ago
Damien 732407f1bf Change memory allocation API to require size for free and realloc.
9 years ago
Damien d99b05282d Change object representation from 1 big union to individual structs.
9 years ago
Damien e2880aa2fd Fix a few compiler warnings.
9 years ago
Damien a1b2693161 py: remove further unnecessary emit_verbatim code.
9 years ago
Damien e388f1034e py: fix bug with doc string not recognised after first newline of file.
9 years ago
Damien 02f8941bf6 py: reduce use of emit_verbatim calls to minimum.
9 years ago
Damien 9ecbcfff99 py: work towards working closures.
9 years ago
Damien 318aec6ba9 py: emit correct id for closed over variables.
9 years ago
Damien 6332174ab4 py: compiler supports string juxtaposition=concatenation.
9 years ago
Damien db4c361f1c py: add skeletal import functionality.
9 years ago
Damien d79338969b py: restrict further when for-range optimisation is done.
9 years ago
Damien 0446a0d76d Change some debugging/output messages for native code generation.
9 years ago
Damien f3822fc34c Fix but with optimised range being 1 over.
9 years ago
Damien f72fd0e875 Add optimisation for "for x in range".
9 years ago
Damien 27fb45eb1c Add local_num skeleton framework to deref/closure emit calls.
9 years ago
Damien 5ac1b2efbd Implement REPL.
9 years ago
Damien ce89a21ea4 Implement basic exception framework, and simple for loop.
9 years ago
Damien 3ef4abb446 Change ifdef/if defined to simple if's.
9 years ago
Damien 0efb3a1b66 Tidy up SMALL_INT optimisations and CPython compatibility.
9 years ago
Damien 3a205179ea Option in compile.c to emit compatible or not with CPython.
9 years ago
Damien c025ebb2dc Separate out mpy core and unix version.
9 years ago
Damien 91d387de7d Improve indent/dedent error checking and reporting.
9 years ago
Damien 13ed3a658d Native Python and Viper support for x64 and thumb all together.
9 years ago
Damien 3410be8035 Merge viper types with standard native emitter.
9 years ago
Damien 7af3d19a3c Implement crude viper emit stage.
9 years ago
Damien dc83382903 Make runtime able to call inline asm with 1 argument.
9 years ago
Damien b14de21fc8 Optimise typedargslist_name to not create a node if just an id.
9 years ago
Damien a2f2f7db1f Almost supports arguments for inline asm functions.
9 years ago
Damien 826005c60b Add support for inline thumb assembly.
9 years ago
Damien 5bfb759980 Incorporate emit_thumb into new emit framework.
9 years ago
Damien 6cdd3af601 Implement built-in decorators to select emit type.
9 years ago
Damien 4b03e77d4a Factorise EMIT_COMMON calls, mostly into emit_pass1.
9 years ago
Damien 054848a1b8 Compiler computes labels and max_num_labels.
9 years ago
Damien b05d707b23 Further factorise PASS_1 out of specific emit code.
9 years ago
Damien 415eb6f850 Restructure emit so it goes through a method table.
9 years ago
Damien 492d082455 Use macro EMIT_COMMON for emit_common calls.
9 years ago
Damien 429d71943d Initial commit.
9 years ago