1. 13 Nov, 2015 3 commits
  2. 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
  3. 24 Jan, 2015 1 commit
  4. 01 Jan, 2015 1 commit
  5. 27 Dec, 2014 1 commit
  6. 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
  7. 24 Oct, 2014 1 commit
  8. 24 Aug, 2014 1 commit
  9. 15 Aug, 2014 1 commit
  10. 12 May, 2014 1 commit
  11. 10 May, 2014 2 commits
  12. 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
  13. 27 Apr, 2014 1 commit
  14. 20 Apr, 2014 1 commit
  15. 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
  16. 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
  17. 27 Mar, 2014 1 commit