1. 06 May, 2016 16 commits
  2. 04 May, 2016 6 commits
    • Kevin Modzelewski's avatar
    • Kevin Modzelewski's avatar
      Switch GCArray to PyObject_Malloc · 8618e750
      Kevin Modzelewski authored
      8618e750
    • Kevin Modzelewski's avatar
      Avoid allocations in pyElements() · 67943c23
      Kevin Modzelewski authored
      I had added an allocation to deal with the requirements refcounting
      added.  To remove that allocation, I added a "SmallUniquePtr" class
      which is similar to unique_ptr but it allocates the object in-line.
      
      It's a bit tricky to use since if the containing object gets moved around
      then the pointers become invalid.
      67943c23
    • Kevin Modzelewski's avatar
      Add RewriterVar::replaceAttr() · 27b94e48
      Kevin Modzelewski authored
      Previously, to replace a refcounted object in memory, we would do something like
      
      array->getAttr(offset)->setType(OWNED);
      array->setAttr(offset, new_val);
      
      The problem is that this ends up emitting something like
      x = array[offset];
      Py_DECREF(x);
      array[offset] = new_val;
      
      which is not safe, since x can have a destructor that runs.
      In this particular case, the destructor changed the value of array[offset].
      
      It's actually pretty hard to get the right behavior (decref after setting the
      new value) from outside the rewriter class, so add a new replaceAttr that does
      these steps.
      27b94e48
    • Kevin Modzelewski's avatar
      Add some lifetime information to temporaries in the cfg · ca2ed310
      Kevin Modzelewski authored
      By adding a 'is_kill' flag to AST_Name nodes, which say that
      this is the last use of this name.  This handles some common cases
      of keeping temporaries alive for too long.
      
      For some rare cases, there is no AST_Name that is a last use:
      for example, the iterator object of a for loop is live after
      every time it is used, but dies when exiting the loop.
      
      For those, we insert a `del #foo` instead.
      
      The interpreter and bjit use these flags to remove temporaries
      from the vregs.
      
      The LLVM jit ignores them since it has its own way of handling
      lifetime.  It ignores any `del` statements on temporary names
      as an optimization.
      
      This does not handle decref'ing temporaries on an exception.
      ca2ed310
    • Kevin Modzelewski's avatar
      Minor: mark these as noexcept · ae919c9f
      Kevin Modzelewski authored
      ae919c9f
  3. 03 May, 2016 2 commits
  4. 02 May, 2016 9 commits
  5. 01 May, 2016 1 commit
  6. 29 Apr, 2016 6 commits