1. 16 Feb, 2017 1 commit
    • Damien George's avatar
      py: Add iter_buf to getiter type method. · ae8d8675
      Damien George authored
      Allows to iterate over the following without allocating on the heap:
      - tuple
      - list
      - string, bytes
      - bytearray, array
      - dict (not dict.keys, dict.values, dict.items)
      - set, frozenset
      
      Allows to call the following without heap memory:
      - all, any, min, max, sum
      
      TODO: still need to allocate stack memory in bytecode for iter_buf.
      ae8d8675
  2. 17 Jan, 2017 1 commit
  3. 09 Dec, 2016 2 commits
  4. 27 Nov, 2016 1 commit
  5. 10 Nov, 2016 1 commit
  6. 19 Sep, 2016 1 commit
  7. 27 Aug, 2016 1 commit
  8. 26 Apr, 2016 1 commit
  9. 07 Apr, 2016 2 commits
  10. 15 Feb, 2016 1 commit
  11. 09 Feb, 2016 1 commit
  12. 02 Feb, 2016 1 commit
  13. 10 Dec, 2015 1 commit
    • Damien George's avatar
      py: Make UNARY_OP_NOT a first-class op, to agree with Py not semantics. · bdbe8c9a
      Damien George authored
      Fixes #1684 and makes "not" match Python semantics.  The code is also
      simplified (the separate MP_BC_NOT opcode is removed) and the patch saves
      68 bytes for bare-arm/ and 52 bytes for minimal/.
      
      Previously "not x" was implemented as !mp_unary_op(x, MP_UNARY_OP_BOOL),
      so any given object only needs to implement MP_UNARY_OP_BOOL (and the VM
      had a special opcode to do the ! bit).
      
      With this patch "not x" is implemented as mp_unary_op(x, MP_UNARY_OP_NOT),
      but this operation is caught at the start of mp_unary_op and dispatched as
      !mp_obj_is_true(x).  mp_obj_is_true has special logic to test for
      truthness, and is the correct way to handle the not operation.
      bdbe8c9a
  14. 29 Nov, 2015 1 commit
  15. 13 Nov, 2015 4 commits
  16. 14 Oct, 2015 1 commit
  17. 12 Oct, 2015 1 commit
  18. 08 Oct, 2015 1 commit
  19. 23 Sep, 2015 1 commit
  20. 12 Aug, 2015 1 commit
  21. 27 Jul, 2015 1 commit
  22. 23 Jul, 2015 1 commit
  23. 25 Jun, 2015 2 commits
    • Damien George's avatar
      py: Remove mp_load_const_bytes and instead load precreated bytes object. · 59fba2d6
      Damien George authored
      Previous to this patch each time a bytes object was referenced a new
      instance (with the same data) was created.  With this patch a single
      bytes object is created in the compiler and is loaded directly at execute
      time as a true constant (similar to loading bignum and float objects).
      This saves on allocating RAM and means that bytes objects can now be
      used when the memory manager is locked (eg in interrupts).
      
      The MP_BC_LOAD_CONST_BYTES bytecode was removed as part of this.
      
      Generated bytecode is slightly larger due to storing a pointer to the
      bytes object instead of the qstr identifier.
      
      Code size is reduced by about 60 bytes on Thumb2 architectures.
      59fba2d6
    • Damien George's avatar
  24. 04 Jun, 2015 2 commits
  25. 08 May, 2015 1 commit
  26. 06 May, 2015 1 commit
  27. 22 Apr, 2015 1 commit
  28. 20 Apr, 2015 1 commit
  29. 16 Apr, 2015 2 commits
  30. 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
  31. 06 Apr, 2015 1 commit
  32. 03 Apr, 2015 1 commit