summaryrefslogtreecommitdiff
path: root/benchmark/lib/benchmark_driver
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2020-12-04 16:40:02 +0100
committerBenoit Daloze <eregontp@gmail.com>2020-12-04 16:45:54 +0100
commitb4ec4a41c24105efbb43f9b70ca7f36d22f98294 (patch)
tree6e257f60ef031d6ea815123c0ce0ed85e10a66be /benchmark/lib/benchmark_driver
parent83e983ab61b532d17a1177c66e3e43a5042edc1f (diff)
Guard all accesses to RubyVM::MJIT with defined?(RubyVM::MJIT) &&
* Otherwise those tests, etc cannot run on alternative Ruby implementations.
Diffstat (limited to 'benchmark/lib/benchmark_driver')
-rw-r--r--benchmark/lib/benchmark_driver/runner/mjit_exec.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/benchmark/lib/benchmark_driver/runner/mjit_exec.rb b/benchmark/lib/benchmark_driver/runner/mjit_exec.rb
index 9f7c8c8af3..eac3dfba84 100644
--- a/benchmark/lib/benchmark_driver/runner/mjit_exec.rb
+++ b/benchmark/lib/benchmark_driver/runner/mjit_exec.rb
@@ -135,7 +135,7 @@ class BenchmarkDriver::Runner::MjitExec
nil
end
% end
- RubyVM::MJIT.pause if RubyVM::MJIT.enabled?
+ RubyVM::MJIT.pause if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?
def vm
t = Process.clock_gettime(Process::CLOCK_MONOTONIC)
@@ -172,7 +172,7 @@ class BenchmarkDriver::Runner::MjitExec
a<%= i %>
a<%= i %> # --jit-min-calls=2
% end
- RubyVM::MJIT.pause if RubyVM::MJIT.enabled?
+ RubyVM::MJIT.pause if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?
def vm
t = Process.clock_gettime(Process::CLOCK_MONOTONIC)
@@ -228,7 +228,7 @@ class BenchmarkDriver::Runner::MjitExec
jit
jit
- RubyVM::MJIT.pause if RubyVM::MJIT.enabled?
+ RubyVM::MJIT.pause if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?
File.write(<%= result.dump %>, jit)
EOS
end