1. 20 Nov, 2015 2 commits
  2. 13 Nov, 2015 3 commits
  3. 07 Apr, 2015 1 commit
    • Damien George's avatar
      py: Implement full func arg passing for native emitter. · 9988618e
      Damien George authored
      This patch gets full function argument passing working with native
      emitter.  Includes named args, keyword args, default args, var args
      and var keyword args.  Fully Python compliant.
      
      It reuses the bytecode mp_setup_code_state function to do all the hard
      work.  This function is slightly adjusted to accommodate native calls,
      and the native emitter is forced a bit to emit similar prelude and
      code-info as bytecode.
      9988618e
  4. 24 Jan, 2015 1 commit
  5. 20 Jan, 2015 1 commit
  6. 14 Jan, 2015 1 commit
  7. 01 Jan, 2015 1 commit
  8. 26 Oct, 2014 1 commit
  9. 25 Oct, 2014 1 commit
    • Damien George's avatar
      py: Store bytecode arg names in bytecode (were in own array). · 1084b0f9
      Damien George authored
      This saves a lot of RAM for 2 reasons:
      
      1. For functions that don't have default values, var args or var kw
      args (which is a large number of functions in the general case), the
      mp_obj_fun_bc_t type now fits in 1 GC block (previously needed 2 because
      of the extra pointer to point to the arg_names array).  So this saves 16
      bytes per function (32 bytes on 64-bit machines).
      
      2. Combining separate memory regions generally saves RAM because the
      unused bytes at the end of the GC block are saved for 1 of the blocks
      (since that block doesn't exist on its own anymore).  So generally this
      saves 8 bytes per function.
      
      Tested by importing lots of modules:
      
      - 64-bit Linux gave about an 8% RAM saving for 86k of used RAM.
      - pyboard gave about a 6% RAM saving for 31k of used RAM.
      1084b0f9
  10. 24 Oct, 2014 1 commit
  11. 26 Aug, 2014 1 commit
    • Damien George's avatar
      py: Fix line number printing for file with 1 line. · b427d6ae
      Damien George authored
      With a file with 1 line (and an error on that line), used to show the
      line as number 0.  Now shows it correctly as line number 1.
      
      But, when line numbers are disabled, it now prints line number 1 for any
      line that has an error (instead of 0 as previously).  This might end up
      being confusing, but requires extra RAM and/or hack logic to make it
      print something special in the case of no line numbers.
      b427d6ae
  12. 24 Aug, 2014 1 commit
  13. 15 Aug, 2014 1 commit
  14. 03 Jul, 2014 1 commit
  15. 21 Jun, 2014 1 commit
  16. 07 Jun, 2014 2 commits
  17. 02 Jun, 2014 2 commits
  18. 12 May, 2014 1 commit
  19. 10 May, 2014 2 commits
  20. 04 May, 2014 1 commit
    • Paul Sokolovsky's avatar
      py, unix: Add -v option, print bytecode dump if used. · 6b344d78
      Paul Sokolovsky authored
      This will work if MICROPY_DEBUG_PRINTERS is defined, which is only for
      unix/windows ports. This makes it convenient to user uPy normally, but
      easily get bytecode dump on the spot if needed, without constant recompiles
      back and forth.
      
      TODO: Add more useful debug output, adjust verbosity level on which
      specifically bytecode dump happens.
      6b344d78
  21. 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
  22. 27 Apr, 2014 1 commit
  23. 23 Apr, 2014 1 commit
  24. 20 Apr, 2014 1 commit
  25. 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
  26. 12 Apr, 2014 1 commit
  27. 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
  28. 06 Apr, 2014 1 commit
  29. 31 Mar, 2014 1 commit
  30. 30 Mar, 2014 1 commit
    • Damien George's avatar
      Rename rt_* to mp_*. · d17926db
      Damien George authored
      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.
      d17926db
  31. 29 Mar, 2014 1 commit
    • Damien George's avatar
      py: Free unique_code slot for outer module. · d1e443d0
      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).
      d1e443d0
  32. 28 Mar, 2014 1 commit
  33. 27 Mar, 2014 1 commit