Skip to content
Permalink
Browse files
[Truffle] Set compiler options.
  • Loading branch information
chrisseaton committed Nov 17, 2014
1 parent c623802 commit f19ed286d03385285197a784bc5f834ba379d041
Showing 1 changed file with 16 additions and 0 deletions.
@@ -63,6 +63,7 @@ public class RubyContext extends ExecutionContext {
private final SafepointManager safepointManager;
private final Random random = new Random();
private final LexicalScope rootLexicalScope;
private final CompilerOptions compilerOptions;

private SourceCallback sourceCallback = null;

@@ -80,6 +81,16 @@ protected Queue<Object> initialValue() {
public RubyContext(Ruby runtime) {
assert runtime != null;

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

if (compilerOptions.supportsOption("MinTimeThreshold")) {
compilerOptions.setOption("MinTimeThreshold", Integer.MAX_VALUE);
}

if (compilerOptions.supportsOption("MinInliningMaxCallerSize")) {
compilerOptions.setOption("MinInliningMaxCallerSize", 5000);
}

safepointManager = new SafepointManager(this);

this.runtime = runtime;
@@ -388,4 +399,9 @@ public Random getRandom() {
public LexicalScope getRootLexicalScope() {
return rootLexicalScope;
}

public CompilerOptions getCompilerOptions() {
return compilerOptions;
}

}

0 comments on commit f19ed28

Please sign in to comment.