1. 27 Sep, 2016 3 commits
    • Damien George's avatar
    • Damien George's avatar
    • 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
  2. 24 Sep, 2016 4 commits
  3. 23 Sep, 2016 6 commits
  4. 22 Sep, 2016 8 commits
  5. 21 Sep, 2016 7 commits
  6. 20 Sep, 2016 7 commits
  7. 19 Sep, 2016 5 commits