- 28 Feb, 2015 3 commits
-
-
Chris Toshok authored
bring in the cpython implementation of weakrefs, and post init_weakref() overwrite some fields in the BoxedClass's for weakref.ref/proxy/callableproxy so that they participate in our GC (we also make use of their tp_traverse functions for scanning and tp_clear functions as their simple_destructor.) as we sweep the heap: 1) any unreachable objects that have weakreferences are kept alive and placed in an std::list called weakly_referenced. 2) any unreachable weakref.ref objects are cleared and removed from their referent's list. After sweeping the entire heap, we then loop over the objects in weakly_referenced. If an object in the list still has weak references, we loop over them clearing their target (setting it to None), and calling their callback if they have one. test/tests/weakref1.py tests this.
-
Chris Toshok authored
-
Kevin Modzelewski authored
-
- 27 Feb, 2015 11 commits
-
-
Kevin Modzelewski authored
Fixes issue #294
-
Kevin Modzelewski authored
Add the unicodedata module
-
Kevin Modzelewski authored
use llvm::SmallVector to reduce allocations
-
Kevin Modzelewski authored
tester.py: canonicalize_stderr: add substitution for object.__new__() error
-
Kevin Modzelewski authored
Implement str.replace maxreplaces
-
Marius Wachtler authored
-
Chris Toshok authored
There were a lot of std::vectors in the rewriter and in the invoke machinery (callFunc and friends), and every std::vector usage involves a call to malloc (and free when is destroyed.) we should be using llvm::SmallVector wherever we can in performance sensitive code, since it allows a configurable stack allocated buffer. It reverts to malloc/free if you blow the buffer's capacity, but as long as things are tuned well, we can get a pretty significant speedup. There is more work to be done, but this change gets us ~3% on geomean.
-
Marius Wachtler authored
-
Marius Wachtler authored
-
Kevin Modzelewski authored
I don't like making extension modules call a function (here called PyGC_AddRoot), but I think this is something that we can eventually automate (look for stores to static locations) so I don't mind going with a temporary solution.
-
Michael Arntzenius authored
-
- 26 Feb, 2015 12 commits
-
-
Kevin Modzelewski authored
Add sys.getdefaultencoding and sys.getfilesystemencoding
-
Kevin Modzelewski authored
The file.py test looked at the README.md file, but the tester caches the CPython output and when I changed the README it didn't invalidate the cache. The tester knows to invalidate the cache if the test file itself changes, so instead of using README as the test target, use itself since that dependency is already tracked.
-
Kevin Modzelewski authored
I don't think this has been touched in quite a while and some parts were getting out of date.
-
Kevin Modzelewski authored
Implement delattr()
-
Kevin Modzelewski authored
add small unicode encoding test
-
Marius Wachtler authored
-
Marius Wachtler authored
-
Marius Wachtler authored
-
Satyajit Sarangi authored
-
Kevin Modzelewski authored
unicode strings are allowed to be used as attribute names, but only if they convert cleanly to ascii. unicode and str need to compare equal to each other and have the same hash value if the unicode is ascii-compatible and has the same value as the str.
-
Kevin Modzelewski authored
-
Kevin Modzelewski authored
Well, fix one of them and work around another. They both come from having an extension class subclass from a builtin class, since in CPython they can expect the tp_* slots to be set, but in Pyston those are just wrappers around the Python functions and then things can get in infinite recursion.
-
- 25 Feb, 2015 14 commits
-
-
Kevin Modzelewski authored
Add compvars and rewriting support for GET_ITER nodes
-
Kevin Modzelewski authored
Implement str.translate() with delete chars
-
Kevin Modzelewski authored
This commit set adds the unicode type, as well as the ability to parse unicode literals such as u"\u0180". There's still a lot more that needs to be added; for instance, we don't currently support printing unicode values to stdout.
-
Kevin Modzelewski authored
Currently storing + passing unicode strings around as UTF-encoded bytestrings in std::string; maybe it'd be nice to have the type system show that these are actually unicode strings, or to use the CPython internal representation (UCS4?) to reduce the number of encodings/decodings.
-
Kevin Modzelewski authored
and with the fixes to get that working, all the tests pass!
-
Kevin Modzelewski authored
-
Kevin Modzelewski authored
-
Marius Wachtler authored
If the type analysis successfully determines that the __iter__() and __hasnext__() methods we can now replace them with direct calls to the destination. Else we create a patchpoint and do a rewrite.
-
Marius Wachtler authored
-
Kevin Modzelewski authored
-
Kevin Modzelewski authored
This also forced us to make our exception handling more compatible in a couple places, as well as fix some bugs that weren't getting exposed. There might be some benefit to implementing the exceptions ourselves (get to use faster Pyston interfaces, make them GC-aware) but maybe we can get these benefits but still use the 2kloc exceptions.c file.
-
Kevin Modzelewski authored
These are the unmodified versions to try to make it easier to see our Pyston modifications.
-
Marius Wachtler authored
-
Kevin Modzelewski authored
Implement long.__int__()
-