Draft
Conversation
bec543f to
9c35a32
Compare
This confirms and compiles symbol-only, simple keyword arguments as a direct operand of the call, to allow downstream optimizations to prepare those keyword arguments in an appropriate way. Normal literal hashes and any keyword-like hashes with splats are compiled as before, with the Hash being built and stored and then loaded when the argument list is being built. Keyword hashes that are simple avoid the copy so they are associated directly with the call. Order continues to be preserved for the values of the simple kwargs hash, but the hash itself with its literal keys and any literal values are now both an operand of and metadata for the call.
9c35a32 to
fd7647d
Compare
This uses the keyword metadata in CallBase to embed a list of keys into the call site. This allows sending the kwarg values directly on the stack, to be passed along to receivers as-is or laily wrapped in a Hash for older-style receivers. This does not wire up either of these paths yet and will not dispatch correctly until the remaining binding logic is in place.
MetaCallSite accepts any number of object arguments with a descriptor describing the layout of those arguments. From there it determines the appropriate specialized call site to use for those arguments. This will be the initial stage of future invokedynamic binding, to allow as little custom logic on the call side as possible and all decisions made during binding.
This wires up methods with only simple keywords, using the fallback logic of boxing those arguments into a Hash and reinvoking the existing call sites.
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.
This PR will implement pass-through keyword arguments for simple cases of calling core methods or calling other keyword-receiving methods. It is meant as a starting point to fully support pass-through of as many forms of keyword-based invocation as possible.
IR changes
Core changes
exception:ornonblock:would be good candidates for now.JIT changes
Caller side
The caller side indy optimizations can be implemented early and provides benefits without the rest due to moving hash construction and flags-setting into the call site.
Callee side