summaryrefslogtreecommitdiff
path: root/kernel.rb
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2024-01-23 11:36:23 -0800
committerGitHub <noreply@github.com>2024-01-23 19:36:23 +0000
commit27c1dd8634d34bfe3592151d66b410f28ca749ce (patch)
treeaccb9d7f9f44ec2ed2bc791c6bc928b0dd062d28 /kernel.rb
parent557b69e83b27dafea435719fc3afc2e67e155962 (diff)
YJIT: Allow inlining ISEQ calls with a block (#9622)
* YJIT: Allow inlining ISEQ calls with a block * Leave a TODO comment about u16 inline_block
Diffstat (limited to 'kernel.rb')
-rw-r--r--kernel.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel.rb b/kernel.rb
index c6b3e44000..5fa8a0d826 100644
--- a/kernel.rb
+++ b/kernel.rb
@@ -87,6 +87,7 @@ module Kernel
#++
#
def tap
+ Primitive.attr! :inline_block
yield(self)
self
end
@@ -127,6 +128,7 @@ module Kernel
# then {|response| JSON.parse(response) }
#
def then
+ Primitive.attr! :inline_block
unless block_given?
return Primitive.cexpr! 'SIZED_ENUMERATOR(self, 0, 0, rb_obj_size)'
end
@@ -142,6 +144,7 @@ module Kernel
# "my string".yield_self {|s| s.upcase } #=> "MY STRING"
#
def yield_self
+ Primitive.attr! :inline_block
unless block_given?
return Primitive.cexpr! 'SIZED_ENUMERATOR(self, 0, 0, rb_obj_size)'
end
@@ -178,6 +181,7 @@ module Kernel
# puts enum.next
# } #=> :ok
def loop
+ Primitive.attr! :inline_block
unless block_given?
return enum_for(:loop) { Float::INFINITY }
end