1. 31 Oct, 2014 6 commits
  2. 30 Oct, 2014 11 commits
  3. 29 Oct, 2014 3 commits
  4. 26 Oct, 2014 9 commits
  5. 25 Oct, 2014 11 commits
    • Damien George's avatar
    • Damien George's avatar
    • Sebastian Plamauer's avatar
      changed file paths to new names · 91bd4e8a
      Sebastian Plamauer authored
    • Damien George's avatar
      py: Add mp_pending_exception global variable, for VM soft interrupt. · 124df6f8
      Damien George authored
      This allows to implement KeyboardInterrupt on unix, and a much safer
      ctrl-C in stmhal port.  First ctrl-C is a soft one, with hope that VM
      will notice it; second ctrl-C is a hard one that kills anything (for
      both unix and stmhal).
      One needs to check for a pending exception in the VM only for jump
      opcodes.  Others can't produce an infinite loop (infinite recursion is
      caught by stack check).
    • Damien George's avatar
      stmhal: Change USB PID when in CDC+HID mode. · d7353fe6
      Damien George authored
      This gets CDC+HID working on Windows, since it needs a different PID for
      a different USB configuration.
      Thanks to tmbinc and dhylands.
    • Damien George's avatar
      tests: Add test for compile builtin. · 62785201
      Damien George authored
    • Damien George's avatar
      py: Implement compile builtin, enabled only on unix port. · c9fc6207
      Damien George authored
      This should be pretty compliant with CPython, except perhaps for some
      corner cases to do with globals/locals context.
      Addresses issue #879.
    • Paul Sokolovsky's avatar
    • Paul Sokolovsky's avatar
    • Damien George's avatar
      py: Compress load-int, load-fast, store-fast, unop, binop bytecodes. · 8456cc01
      Damien George authored
      There is a lot potential in compress bytecodes and make more use of the
      coding space.  This patch introduces "multi" bytecodes which have their
      argument included in the bytecode (by addition).
      UNARY_OP and BINARY_OP now no longer take a 1 byte argument for the
      opcode.  Rather, the opcode is included in the first byte itself.
      LOAD_FAST_[0,1,2] and STORE_FAST_[0,1,2] are removed in favour of their
      multi versions, which can take an argument between 0 and 15 inclusive.
      The majority of LOAD_FAST/STORE_FAST codes fit in this range and so this
      saves a byte for each of these.
      LOAD_CONST_SMALL_INT_MULTI is used to load small ints between -16 and 47
      inclusive.  Such ints are quite common and now only need 1 byte to
      store, and now have much faster decoding.
      In all this patch saves about 2% RAM for typically bytecode (1.8% on
      64-bit test, 2.5% on pyboard test).  It also reduces the binary size
      (because bytecodes are simplified) and doesn't harm performance.
    • 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.