-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
Add CALL_INTRINSIC
instruction.
#99005
Comments
Related discussion: faster-cpython/ideas#202 |
What about the other instructions mentioned in faster-cpython/ideas#202?
|
Those as well, with a few exceptions: |
A tricky part is that not many of the above instruction take the form of a simple call.
So, instead of passing arguments, we could pass the stack. The instrinsic function would return how many values it left on the stack, or -1 for an error. To support
One downside of this is we can only determine the stack effect of |
|
Some other instructions that are very rare, but take an operand, that might be nice to turn into intrinsic functions:
|
Given that we plan to move to a register-based interpreter, the above scheme of adjusting the stack pointer no longer makes sense. All the instruction marked as "call-like" can be implemented this way, for either stack and register VM.
|
* Remove PRINT_EXPR instruction * Remove STOPITERATION_ERROR instruction * Remove IMPORT_STAR instruction
* Remove UNARY_POSITIVE, LIST_TO_TUPLE and ASYNC_GEN_WRAP, replacing them with intrinsics.
We have a number of instructions that are complicated and executed fairly rarely. For example
MAP_KEYS
,CHECK_EG_MATCH
,CLEANUP_THROW
.These bulk out the interpreter, possibly slowing things down.
We should move code from these into helper functions, which can be called though a table from
CALL_INTRINSIC
instruction.The
CALL_INTRINSIC
instruction also provides a means for contributors to add new functionality without a deep understanding of the compiler.Candidates for moving into
CALL_INTRINSIC
are:Linked PRs
CALL_INTRINSIC_1
instruction #100771The text was updated successfully, but these errors were encountered: