1. 25 Oct, 2014 6 commits
    • 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.
      8456cc01
    • 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
    • Paul Sokolovsky's avatar
      unix: Allow -X heapsize= option take numbers with K & M suffixes. · fcff4663
      Paul Sokolovsky authored
      For kilobytes and megabytes respectively.
      fcff4663
    • Damien George's avatar
      stmhal: Change fresh boot.py and main.py to use \r\n newlines. · 8204db68
      Damien George authored
      This is so it's compatible with Windows.
      8204db68
    • Damien George's avatar
      stmhal: Fill in USB class/subclass/proto for CDC+HID device. · 21dfd207
      Damien George authored
      Also change HID device from keyboard to mouse (should have been mouse
      all along).
      21dfd207
    • Felix Domke's avatar
  2. 24 Oct, 2014 4 commits
  3. 23 Oct, 2014 7 commits
  4. 22 Oct, 2014 10 commits
  5. 21 Oct, 2014 6 commits
  6. 19 Oct, 2014 4 commits
  7. 18 Oct, 2014 1 commit
  8. 17 Oct, 2014 2 commits