Skip to content

Commit

Permalink
[Truffle] Set compiler options.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisseaton committed Nov 17, 2014
1 parent c623802 commit f19ed28
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions core/src/main/java/org/jruby/truffle/runtime/RubyContext.java
Expand Up @@ -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;

Expand All @@ -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;
Expand Down Expand Up @@ -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.