1. 24 May, 2014 1 commit
  2. 21 May, 2014 1 commit
    • Damien George's avatar
      Tidy up some configuration options. · 58ebde46
      Damien George authored
      MP_ALLOC_* -> MICROPY_ALLOC_*
      MICROPY_PATH_MAX -> MICROPY_ALLOC_PATH_MAX
      MICROPY_ENABLE_REPL_HELPERS -> MICROPY_HELPER_REPL
      MICROPY_ENABLE_LEXER_UNIX -> MICROPY_HELPER_LEXER_UNIX
      MICROPY_EXTRA_* -> MICROPY_PORT_*
      
      See issue #35.
      58ebde46
  3. 13 May, 2014 1 commit
  4. 11 May, 2014 1 commit
  5. 10 May, 2014 1 commit
  6. 07 May, 2014 1 commit
  7. 03 May, 2014 1 commit
    • Damien George's avatar
      Add license header to (almost) all files. · 04b9147e
      Damien George authored
      Blanket wide to all .c and .h files.  Some files originating from ST are
      difficult to deal with (license wise) so it was left out of those.
      
      Also merged modpyb.h, modos.h, modstm.h and modtime.h in stmhal/.
      04b9147e
  8. 02 May, 2014 1 commit
  9. 27 Apr, 2014 2 commits
  10. 24 Apr, 2014 2 commits
  11. 23 Apr, 2014 1 commit
  12. 20 Apr, 2014 2 commits
  13. 17 Apr, 2014 4 commits
    • Damien George's avatar
      py: Rename USE_COMPUTED_GOTOS to USE_COMPUTED_GOTO and enable on stmhal. · 5b65f0c7
      Damien George authored
      On stmhal, computed gotos make the binary about 1k bigger, but makes it
      run faster, and we have the room, so why not.  All tests pass on
      pyboard using computed gotos.
      5b65f0c7
    • Damien George's avatar
      py: Add MP_OBJ_STOP_ITERATION and make good use of it. · ea8d06c3
      Damien George authored
      Also make consistent use of MP_OBJ_NOT_SUPPORTED and MP_OBJ_NULL.
      This helps a lot in debugging and understanding of function API.
      ea8d06c3
    • Damien George's avatar
      py: Merge BINARY_OP_SUBSCR and store_subscr (w/ delete) into subscr. · 729f7b42
      Damien George authored
      mp_obj_t->subscr now does load/store/delete.
      729f7b42
    • Damien George's avatar
      py: Tidy up variables in VM, probably fixes subtle bugs. · 66ae8c9f
      Damien George authored
      Things get tricky when using the nlr code to catch exceptions.  Need to
      ensure that the variables (stack layout) in the exception handler are
      the same as in the bit protected by the exception handler.
      
      Prior to this patch there were a few bugs.  1) The constant
      mp_const_MemoryError_obj was being preloaded to a specific location on
      the stack at the start of the function.  But this location on the stack
      was being overwritten in the opcode loop (since it didn't think that
      variable would ever be referenced again), and so when an exception
      occurred, the variable holding the address of MemoryError was corrupt.
      2) The FOR_ITER opcode detection in the exception handler used sp, which
      may or may not contain the right value coming out of the main opcode
      loop.
      
      With this patch there is a clear separation of variables used in the
      opcode loop and in the exception handler (should fix issue (2) above).
      Furthermore, nlr_raise is no longer used in the opcode loop.  Instead,
      it jumps directly into the exception handler.  This tells the C compiler
      more about the possible code flow, and means that it should have the
      same stack layout for the exception handler.  This should fix issue (1)
      above.  Indeed, the generated (ARM) assembler has been checked explicitly,
      and with 'goto exception_handler', the problem with &MemoryError is
      fixed.
      
      This may now fix problems with rge-sm, and probably many other subtle
      bugs yet to show themselves.  Incidentally, rge-sm now passes on
      pyboard (with a reduced range of integration)!
      
      Main lesson: nlr is tricky.  Don't use nlr_push unless you know what you
      are doing!  Luckily, it's not used in many places.  Using nlr_raise/jump
      is fine.
      66ae8c9f
  14. 15 Apr, 2014 2 commits
  15. 14 Apr, 2014 2 commits
  16. 13 Apr, 2014 1 commit
    • Damien George's avatar
      py: Remove unique_codes from emitglue.c. Replace with pointers. · df8127a1
      Damien George authored
      Attempt to address issue #386.  unique_code_id's have been removed and
      replaced with a pointer to the "raw code" information.  This pointer is
      stored in the actual byte code (aligned, so the GC can trace it), so
      that raw code (ie byte code, native code and inline assembler) is kept
      only for as long as it is needed.  In memory it's now like a tree: the
      outer module's byte code points directly to its children's raw code.  So
      when the outer code gets freed, if there are no remaining functions that
      need the raw code, then the children's code gets freed as well.
      
      This is pretty much like CPython does it, except that CPython stores
      indexes in the byte code rather than machine pointers.  These indices
      index the per-function constant table in order to find the relevant
      code.
      df8127a1
  17. 12 Apr, 2014 1 commit
  18. 11 Apr, 2014 1 commit
    • Damien George's avatar
      py: Change compile order for default positional and keyword args. · 69b89d21
      Damien George authored
      This simplifies the compiler a little, since now it can do 1 pass over
      a function declaration, to determine default arguments.  I would have
      done this originally, but CPython 3.3 somehow had the default keyword
      args compiled before the default position args (even though they appear
      in the other order in the text of the script), and I thought it was
      important to have the same order of execution when evaluating default
      arguments.  CPython 3.4 has changed the order to the more obvious one,
      so we can also change.
      69b89d21
  19. 10 Apr, 2014 2 commits
  20. 09 Apr, 2014 2 commits
  21. 08 Apr, 2014 4 commits
  22. 06 Apr, 2014 1 commit
  23. 05 Apr, 2014 3 commits
  24. 04 Apr, 2014 1 commit
  25. 31 Mar, 2014 1 commit