-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wip: improve ics #1262
Open
undingen
wants to merge
4,580
commits into
pyston:master
Choose a base branch
from
undingen:improve_ics
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
wip: improve ics #1262
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The Rewriter will automatically refcount objects represented as RewriterVar's, but if you store one as an attribute somewhere, it can't keep track of that. So add a registerOwnedAttribute() function that lets you say that there is a reference that lives in an attribute (stored in a memory offset) of another RewriterVar.
They were both failing on master: - test_dumbdbm was failing in a test case that writes out some data to a database, closes it, then reopens the db and expects to be able to read the data. - test_memoryview expected some weakrefs to get cleared at the right time. test_socket.py appears to "pass" -- it exits with code 0, but it spams a bunch of error messages from other threads.
Fix the lost-ref-from-oargs issue
hyperlink dir file
We were missing a guard and we ended up calling the wrong function :/ Still some other issuse with this test
Marius fixed the propagate-C++-exception case, and this commit adds the to- and from-CAPI cases as well.
It was failing on master due to some of the test cases checking for immediate destruction.
This time it was if __eq__ throws.
It fetches a webpage from a third-party server ("example.com") and verifies the return code. For some reason it's failing, both for us and for CPython.
Fix test_set.py
… PyErr_GetExcInfo
refcounting fixes for numpy in PyTuple_GetSlice, PyErr_SetExcInfo and PyErr_GetExcInfo
bitset begin() function fix
This time it was from trying to look at the result of isUnwinding() to determine if the function terminated successfully or via an exception. (And in the exception case, to decref some values that would have been returned.) This got tripped up in a case where we through an exception, this triggers an AUTO_DECREF which takes an object to zero decrefs, which has a custom destructor, and calls code that ends up calling isUnwinding(). This is all happening from inside a C++ destructor, so this counts as isUnwinding(). We had some code to try to keep isUnwinding() meaning what we wanted to use it for, but it was only for certain cases. I think we might be able to extend it to more cases, but it seems like that would be a losing battle since it's hard to say when "unwinding" ends and then we are suddenly not unwinding. So instead, I just disabled isUnwinding() (except in debug mode where it can be somewhat useful for writing "assert(foo || isUnwinding())"), and then used a different way to try to determine if the function exited normally.
Since the unwinder now supports throwing exceptions inside destructors (as long as they don't propagate out). This is the same change that C++17 makes, from "bool uncaught_exception()" to "int uncaught_exceptions()".
The part that tests that certain dicts compare a given way. We don't have consistent dict comparisons yet (pyston#1135)
Another run-arbitrary-code-during-unwinding issue
Haven't been able to test them all extensively but I tried to only pick things refcount-related.
This just copy the CPython implementation, so some NumPy tests could pass. But most of types in Pyston didn't implement '__sizeof__' attribute yet.
Bitset iteration micro optimize
copy CPython sys.getsizeof implementation with some Pyston changes
Undo a bunch of Pyston changes to cpython code
But still some in test/integration
At least what I added here is what CPython does.
rewriter+bjit: remove duplicate getattrs, misc codegen improvements
Add some helper API to Pyston.
The function PyCFunction_GetFunction(func) check func type should be exactly PyCFunction_Type. PyCFunction_GET_FUNCTION(func) does not check func type. But assumes func layout starts with PyCFunctionObject. i.e. for allowing func to be PyCFunction_Type subclass. This way an extension which subclasses PyCFunctionObject will get into trouble using PyCFunction_GET_FUNCTION() on Pyston
undingen
force-pushed
the
improve_ics
branch
2 times, most recently
from
June 24, 2016 15:39
0574400
to
32c71ec
Compare
This reverts commit d1b799e.
enable the clang travis CI build again
In Pyston, has_getattribute got set if __getattribute__ is overridden, but only tp_getattro is supposed to set __getattribute__ and tp_getattr will not set it. So add a check to update_one_slot, if type->tp_getattr is not NULL, don't set has_getattribute to False.
Enable function.func_closure and function.__new__
Some scipy related fixing.
before this change we had a fixed number of equal size slots inside an IC. Because of the large difference in rewrite sizes a fixed slot size is not ideal. We often ended up with too large slots which prevented us from emitting more slots. (or very large ICs in general which are bad for memory usage and the instruction cache) With this commit we will start with a single slot with the size of the whole IC and then decreasing its size to the actual bytes emitted and creating a new slot which starts directly at the end of the previous slot. We will repeat to to this until the space left is smaller than the number of bytes the last slot required. This makes it a little bit less likely that we will be successful in overwritting an existing slot but our benchmarks show that it is still a large win on all our benchmarks. Some notable changes are: - we pick the slot to rewrite much earlier now and prevent it from getting rewritten while we rewrite using num_inside = 1 the reason is that we would otherwise not know how big the slot is - when we resize a slot we have to patch the failing guard jumps to the address of the next slot
undingen
force-pushed
the
improve_ics
branch
2 times, most recently
from
June 28, 2016 20:36
949b9cc
to
476b91a
Compare
Get test/tests/dict_comparisons.py working. change test timeout -t75 to -t90
CPython has quite a bit more logic than just 'try __cmp__'
OSR can fail in some cases and we have to continue with interpreting in this cases.
bjit: fix failed OSR
Dictionary comparisons
Add type.__basicsize__, type.__itemsize__
ICs: variable size IC slots
…ed function excepts all args
kmod
force-pushed
the
master
branch
2 times, most recently
from
October 28, 2020 21:01
352fd89
to
6488a3e
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.