aboutsummaryrefslogtreecommitdiffstats
path: root/tool
diff options
context:
space:
mode:
authorKevin Newton <kddnewton@gmail.com>2023-11-09 02:39:12 -0500
committerJemma Issroff <jemmaissroff@gmail.com>2023-11-20 12:45:29 -0800
commit323bec6295e46a6f4926e742f7444fc54924b527 (patch)
tree3f768d659a4976cf314394b30e57c90c1d2f0bcb /tool
parent2796e4ece24f62f7d952a894097726b85bbd6fc8 (diff)
downloadruby-323bec6295e46a6f4926e742f7444fc54924b527.tar.gz
RubyVM::InstructionSequence.compile_file_prism
* Provide a new API compile_file_prism which mirrors compile_file but uses prism to parse/compile. * Provide the ability to run test-all with RUBY_ISEQ_DUMP_DEBUG set to "prism". If it is, we'll use the new compile_file_prism API to load iseqs during the test run.
Diffstat (limited to 'tool')
-rw-r--r--tool/lib/iseq_loader_checker.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/tool/lib/iseq_loader_checker.rb b/tool/lib/iseq_loader_checker.rb
index 3f07b3a999..73784f8450 100644
--- a/tool/lib/iseq_loader_checker.rb
+++ b/tool/lib/iseq_loader_checker.rb
@@ -76,6 +76,15 @@ class RubyVM::InstructionSequence
# return value
i2_bin if CHECK_TO_BINARY
end if CHECK_TO_A || CHECK_TO_BINARY
+
+ if opt == "prism"
+ # If RUBY_ISEQ_DUMP_DEBUG is "prism", we'll set up
+ # InstructionSequence.load_iseq to intercept loading filepaths to compile
+ # using prism.
+ def self.load_iseq(filepath)
+ RubyVM::InstructionSequence.compile_file_prism(filepath)
+ end
+ end
end
#require_relative 'x'; exit(1)