Don't crash on non-mapping like arguments on kwargs. Fixes #805#831
Open
vinzenz wants to merge 2986 commits intopyston:masterfrom
Open
Don't crash on non-mapping like arguments on kwargs. Fixes #805#831vinzenz wants to merge 2986 commits intopyston:masterfrom
vinzenz wants to merge 2986 commits intopyston:masterfrom
Conversation
get cpython/test_tuple.py to pass
They are tricky since these are types, which means they invoke the relatively-complicated constructor logic. ie str() doesn't just call __str__ on the argument: if the result is a subclass of str, it calls result.__init__(). Similarly for unicode, except unicode is even trickier since it takes some more arguments, one of which is "encoding" which will have non-type-based dynamic behavior. I didn't realize that at first and optimized unicode() by exposing an inner version of it that takes its arguments in registers, which we can take advantage of using our jit-arg-rearrangement capability. This means we have to do parts of PyArg_ParseTuple ourselves, so I added a PyArg_ParseSingle that runs a single object through the arg-conversion code. PyArg_ParseSingle could be further optimized if we want to. Or rather, if we have functions of the form PyArg_ParseSingle_s (which corresponds to the "s" format code) we could skip some more of the overhead. I had to disable most of that once I realized the encoding issue, but I left it in since hopefully we will be able to use it again once we have some "do some guards after mutations if we know how to resume after a failed guard" rewriter support.
callable(), str(), repr(), PySequence_GetItem(), and PyObject_HasAttrString() Mostly by bringing in the CPython versions.
optimize some misc runtime functions
list recursive printing
Previously after doing a OSR JIT compilation we continued to JIT every block outside of the loop. This doesn't show up as a perf change but reduces the number of JITed code / makes it slightly smaller.
The exceptions thrown by len itself can now be either style, though any exceptions thrown by any called functions (ex __len__) will still get thrown as C++ exceptions and converted if needed. Helps in a common case of "try calling len but don't worry if no len was defined".
Numeric binary operator support for old style class
bjit: add support for most common missing nodes and don't JIT compile cold blocks
For use of PyObject_GetItem django_template3 ends up calling this a fair amount via unicode_translate (ie it checks to see if certain entries are in the translation table).
Apparently they can do compile-time evaluations, which is cool.
Fix the errors that report in `test format` and re-enable `test format`.
start templatizing the runtime to be able to choose exception styles
improve getattr() speed
c8e6f4a to
04d7bfd
Compare
Allow string + bytearray => bytearray. Fixes pyston#780
We currently over-build it quite a bit; I'll try to look into that issue, but for now we can lessen the effects by at least building it in parallel.
Probably more compatible, but also much faster. Also, set str_cls->tp_repr.
Collaborator
There was a problem hiding this comment.
Not sure if this is the cause of the test failures, but I think it's perfectly allowable to pass kwargs to a non-keyword-taking function if the kwargs dict is empty.
make `int("some_random_string")` faster
Improve the float implementation, enable test_float
Microoptimize the rewriter class
Switch our Python set implementation to use a llvm::DenseSet
04d7bfd to
b54aa63
Compare
Collaborator
There was a problem hiding this comment.
Minor, but I think our unwinder requires that we catch exceptions by value; maybe the compiler translates the catch-by-const-reference to a catch-by-value but it's probably better to just have it explicitly catch by value.
Contributor
Author
There was a problem hiding this comment.
ok, I didn't know that it is required because of that. Good to know. Will fix that
352fd89 to
6488a3e
Compare
This file contains hidden or 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
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.