summaryrefslogtreecommitdiff
path: root/jit_hook.rb
diff options
context:
space:
mode:
Diffstat (limited to 'jit_hook.rb')
-rw-r--r--jit_hook.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/jit_hook.rb b/jit_hook.rb
index 487361c049..c605d6e26d 100644
--- a/jit_hook.rb
+++ b/jit_hook.rb
@@ -2,11 +2,10 @@ class Module
# Internal helper for built-in initializations to define methods only when JIT is enabled.
# This method is removed in jit_undef.rb.
private def with_jit(&block) # :nodoc:
- # ZJIT currently doesn't compile Array#each properly, so it's disabled for now.
- if defined?(RubyVM::ZJIT) && Primitive.rb_zjit_option_enabled_p && false # TODO: remove `&& false` (Shopify/ruby#667)
- # We don't support lazily enabling ZJIT yet, so we can call the block right away.
- block.call
- elsif defined?(RubyVM::YJIT)
+ if defined?(RubyVM::ZJIT)
+ RubyVM::ZJIT.send(:add_jit_hook, block)
+ end
+ if defined?(RubyVM::YJIT)
RubyVM::YJIT.send(:add_jit_hook, block)
end
end