1. 17 Aug, 2014 4 commits
  2. 15 Aug, 2014 12 commits
    • Kevin Modzelewski's avatar
      AttrWrapper.__contains__ · 36192fb0
      Kevin Modzelewski authored
      36192fb0
    • Kevin Modzelewski's avatar
      Add support for the globals() builtin · 85beb314
      Kevin Modzelewski authored
      Works by using stack unwinding to find the most recent frame,
      and then maps that back to the source information.
      Soon we're going to need proper frame management (ex, this approach
      does not work at for the locals() function), when this will be replaced.
      
      globals() currently returns a non-dict... we'll see if that's ok.
      85beb314
    • Kevin Modzelewski's avatar
      Faithfully follow the Python 'print' protocol, at the cost of performance. · fe8fa138
      Kevin Modzelewski authored
      Need this to track "softspace" correctly...
      fe8fa138
    • Kevin Modzelewski's avatar
      Add object.__str__ and object.__repr__ · e6ebbb72
      Kevin Modzelewski authored
      Before, the default behavior (falling back to __repr__ if __str__ doesn't
      exist, and giving a default representation if __repr__ doesn't exist) was
      provided by the repr() and str() functions.
      e6ebbb72
    • Kevin Modzelewski's avatar
      Throw a SyntaxError if you try to import from __future__ · 95ef55eb
      Kevin Modzelewski authored
      I guess there's actually a real __future__ module that contains
      information in it about the special features you just enabled!
      Until this change you would get that information, but not actually
      enable any features.  The right behavior is to raise a SyntaxError
      for all __future__ directives we don't support (which is all of them).
      
      "import __future__" works if you want that...
      
      I'm not sure that throwing a SyntaxError from the IRGenerator is safe,
      since there are things that won't get cleaned up, but I guess
      it's not that much worse than if it worked; and this SyntaxError will
      typically kill the program anyway.
      95ef55eb
    • Kevin Modzelewski's avatar
      Add BytesWarning, sys.platform, and sys.flags · 82ff6f53
      Kevin Modzelewski authored
      (working on getting more of the stdlib to import)
      82ff6f53
    • Kevin Modzelewski's avatar
      Apparently _md5 also works · 9bb182d1
      Kevin Modzelewski authored
      Well not really, it crashes the GC by simply existing, but it's close!
      9bb182d1
    • Kevin Modzelewski's avatar
      Import patchlevel.h · 9a87ed01
      Kevin Modzelewski authored
      9a87ed01
    • Kevin Modzelewski's avatar
      Some work on the Grand CAPI Unification · 1d396ecd
      Kevin Modzelewski authored
      ie trying to start running real C modules.  The goal has always been to
      run them without modification and without a proxy layer, and this is the first step.
      
      The first issue is conversion between PyObject and our internal representation,
      "Box" (needs to be renamed).  Once they have the same layout, some hacks were
      needed to make them seem like the same thing, even though we can attach C++
      methods on the Box side, but use PyObject in C code.
      
      The next major issue was PyTypeObject, since the structure is directly exposed to
      extensions.  I just added the similar fields to BoxedClass, so they can be
      used interchangeably; the "real" ones are the BoxedClass ones, but we'll migrate
      them incrementally.
      
      There's also the issue that PyTypeObject's are typically created statically,
      so I added registerStaticRootMemory to the GC interface.
      
      Also add in a smattering of other API functions, and the _sha module works
      (who cares if it's normally disabled).
      
      The C API is quite constraining about choices of data structure implementation; it's
      in direct conflict with the std::string API, for example.  For now, close our eyes
      and let the C API modify the internal bytes of std::string.
      1d396ecd
    • Kevin Modzelewski's avatar
    • Kevin Modzelewski's avatar
    • Kevin Modzelewski's avatar
  3. 14 Aug, 2014 2 commits
  4. 12 Aug, 2014 5 commits
  5. 11 Aug, 2014 5 commits
  6. 10 Aug, 2014 2 commits
  7. 09 Aug, 2014 2 commits
  8. 08 Aug, 2014 1 commit
  9. 07 Aug, 2014 1 commit
    • Kevin Modzelewski's avatar
      Support receiving **kw for builtin functions · c2877853
      Kevin Modzelewski authored
      Need to special-case some places in the keyword handling
      since they previously assumed that they would first have
      to check if the keyword name matched a positional argument,
      before putting into the output **kw.
      c2877853
  10. 06 Aug, 2014 5 commits
    • Kevin Modzelewski's avatar
      Support CPython's errnomodule.c, our first extension module! · 83685055
      Kevin Modzelewski authored
      errnomodule.c is extremely simple and doesn't do anything complicated,
      so this is more of a proof-of-concept for now.
      The tricky stuff will most likely be around newly-defined types.
      83685055
    • Kevin Modzelewski's avatar
      Make GC collections work when threads are in generators · 28c651ab
      Kevin Modzelewski authored
      The previous code assumed that there was only one stack per
      thread, which could be examined by looking at the current registers.
      Generators complicate that, since we switch to a separate stack.
      We still need to scan the original, main stack, which means that
      we need to add some bookkeeping code that remembers what the main
      stack was, even as we swap to and from generators.
      28c651ab
    • Kevin Modzelewski's avatar
      Fix OSR inside closures and generators · 7e86fc1a
      Kevin Modzelewski authored
      Nothing major was wrong, but was trying to double-pass the
      generator/closure arguments.
      7e86fc1a
    • Kevin Modzelewski's avatar
      Cleanup · 01ae20e9
      Kevin Modzelewski authored
      01ae20e9
    • Kevin Modzelewski's avatar
      Make the GC-header managed by the GC · cd11e1d5
      Kevin Modzelewski authored
      Previously the gc header had to be set and managed by the user of the GC,
      which didn't make much sense.
      
      Also took this opportunity to clean up a bunch of old cruft.
      
      Also got rid of ObjectFlavors and AllocationKinds, in preference for
      a GCKind which I think makes more sense.  Right now there are only three
      different GCKinds, but I'm not sure if the previous AllocationKinds
      should each get their own GCKind.
      cd11e1d5
  11. 05 Aug, 2014 1 commit