Skip to content

Commit

Permalink
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -235,7 +235,7 @@ public GraalNode(RubyContext context, SourceSection sourceSection) {
@TruffleBoundary
@Specialization
public boolean graal() {
return Truffle.getRuntime().getName().toLowerCase(Locale.ENGLISH).contains("graal");
return getContext().onGraal();
}

}
Original file line number Diff line number Diff line change
@@ -67,6 +67,7 @@
import java.math.BigInteger;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.atomic.AtomicLong;
@@ -125,6 +126,10 @@ public RubyContext(Ruby runtime, TruffleLanguage.Env env) {

compilerOptions = Truffle.getRuntime().createCompilerOptions();

if (!onGraal()) {
System.err.println("JRuby+Truffle is designed to be run with a JVM that has the Graal compiler. See https://github.com/jruby/jruby/wiki/Truffle-FAQ#how-do-i-get-jrubytruffle");

This comment has been minimized.

Copy link
@chrisseaton

chrisseaton Jan 4, 2016

Contributor

I think this message could perhaps be more explicit, with a 'warning:' prefix, and mention that it will run slower without it.

This comment has been minimized.

Copy link
@pitr-ch

pitr-ch Jan 4, 2016

Author Member

updated in 94ad479

}

if (compilerOptions.supportsOption("MinTimeThreshold")) {
compilerOptions.setOption("MinTimeThreshold", 100000000);
}
@@ -200,6 +205,10 @@ public RubyContext(Ruby runtime, TruffleLanguage.Env env) {
initialize();
}

public boolean onGraal() {
return Truffle.getRuntime().getName().toLowerCase(Locale.ENGLISH).contains("graal");
}

public Object send(Object object, String methodName, DynamicObject block, Object... arguments) {
CompilerAsserts.neverPartOfCompilation();

1 comment on commit 1eb3fc0

@pitr-ch
Copy link
Member Author

@pitr-ch pitr-ch commented on 1eb3fc0 Jan 4, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @jruby/truffle

Please sign in to comment.