forked from jruby/jruby
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prototype of fast block_given? logic using indy
The basic idea here is to avoid pushing a frame for block_given? when it is known to be our core implementation. Instead, we use indy to test the block the current method was called with and return a result directly. When the block_given? is not our core impl, it falls back on a normal indy invocation. This allows us to remove the frame requirement from block_given? callers, and the cost of the block_given? call largely disappears. Caveats: * This is very much hacked in place, with duplicated code in multiple places. * In order to pass through the block we were given, we add a Block parameter to the call site. If someone defines a block_given? in Ruby, it would receive our given block.
- Loading branch information
Showing
4 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
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
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
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
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