1. 15 Nov, 2016 2 commits
  2. 11 Oct, 2016 2 commits
  3. 30 Sep, 2016 3 commits
  4. 28 Sep, 2016 1 commit
  5. 27 Sep, 2016 1 commit
    • Damien George's avatar
      py: Only store the exception instance on Py stack in bytecode try block. · f040685b
      Damien George authored
      When an exception is raised and is to be handled by the VM, it is stored
      on the Python value stack so the bytecode can access it.  CPython stores
      3 objects on the stack for each exception: exc type, exc instance and
      traceback.  uPy followed this approach, but it turns out not to be
      necessary.  Instead, it is enough to store just the exception instance on
      the Python value stack.  The only place where the 3 values are needed
      explicitly is for the __exit__ handler of a with-statement context, but
      for these cases the 3 values can be extracted from the single exception
      instance.
      
      This patch removes the need to store 3 values on the stack, and instead
      just stores the exception instance.
      
      Code size is reduced by about 50-100 bytes, the compiler and VM are
      slightly simpler, generate bytecode is smaller (by 2 bytes for each try
      block), and the Python value stack is reduced in size for functions that
      handle exceptions.
      f040685b
  6. 19 Sep, 2016 1 commit
  7. 26 Aug, 2016 1 commit
  8. 20 May, 2016 1 commit
  9. 13 Apr, 2016 2 commits
  10. 07 Apr, 2016 2 commits
  11. 16 Mar, 2016 1 commit
  12. 25 Feb, 2016 1 commit
    • Damien George's avatar
      py: Add MICROPY_DYNAMIC_COMPILER option to config compiler at runtime. · ea235204
      Damien George authored
      This new compile-time option allows to make the bytecode compiler
      configurable at runtime by setting the fields in the mp_dynamic_compiler
      structure.  By using this feature, the compiler can generate bytecode
      that targets any MicroPython runtime/VM, regardless of the host and
      target compile-time settings.
      
      Options so far that fall under this dynamic setting are:
      - maximum number of bits that a small int can hold;
      - whether caching of lookups is used in the bytecode;
      - whether to use unicode strings or not (lexer behaviour differs, and
        therefore generated string constants differ).
      ea235204
  13. 27 Jan, 2016 1 commit
  14. 07 Jan, 2016 1 commit
    • Damien George's avatar
      py/parse: Optimise away parse node that's just parenthesis around expr. · 93b37262
      Damien George authored
      Before this patch, (x+y)*z would be parsed to a tree that contained a
      redundant identity parse node corresponding to the parenthesis.  With
      this patch such nodes are optimised away, which reduces memory
      requirements for expressions with parenthesis, and simplifies the
      compiler because it doesn't need to handle this identity case.
      
      A parenthesis parse node is still needed for tuples.
      93b37262
  15. 18 Dec, 2015 2 commits
  16. 17 Dec, 2015 1 commit
  17. 12 Dec, 2015 1 commit
  18. 08 Dec, 2015 1 commit
  19. 29 Nov, 2015 2 commits
  20. 23 Nov, 2015 1 commit
  21. 20 Nov, 2015 1 commit
  22. 17 Nov, 2015 2 commits
  23. 13 Nov, 2015 1 commit
  24. 14 Oct, 2015 1 commit
  25. 12 Oct, 2015 1 commit
    • Damien George's avatar
      py: Move constant folding from compiler to parser. · 64f2b213
      Damien George authored
      It makes much more sense to do constant folding in the parser while the
      parse tree is being built.  This eliminates the need to create parse
      nodes that will just be folded away.  The code is slightly simpler and a
      bit smaller as well.
      
      Constant folding now has a configuration option,
      MICROPY_COMP_CONST_FOLDING, which is enabled by default.
      64f2b213
  26. 08 Oct, 2015 2 commits
  27. 03 Oct, 2015 1 commit
  28. 01 Oct, 2015 2 commits
  29. 24 Sep, 2015 1 commit