Skip to content

Commit

Permalink
[Truffle] Workaround for bug in 0.5 Truffle splitter/inliner.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisseaton committed Sep 25, 2014
1 parent e5cf31f commit 21ccb97
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Expand Up @@ -25,6 +25,7 @@
import org.jruby.truffle.runtime.core.RubySymbol;
import org.jruby.truffle.runtime.lookup.LookupNode;
import org.jruby.truffle.runtime.methods.RubyMethod;
import org.jruby.util.cli.Options;

public abstract class CachedBoxedMethodMissingDispatchNode extends CachedDispatchNode {

Expand All @@ -43,6 +44,18 @@ public CachedBoxedMethodMissingDispatchNode(RubyContext context, Object cachedNa
this.method = method;

callNode = Truffle.getRuntime().createDirectCallNode(method.getCallTarget());

/*
* The splitter/inliner since Truffle 0.5 has a bug where it isn't splitting/inlining this call site - it should
* be fixed in 0.6, but until then we'll force it. Turn off (to test) with
* -Xtruffle.call.force_split_inline_missing = false.
*/

if (Options.TRUFFLE_CALL_FORCE_SPLIT_INLINE_MISSING.load()) {
insert(callNode);
callNode.split();
callNode.forceInlining();
}
}

public CachedBoxedMethodMissingDispatchNode(CachedBoxedMethodMissingDispatchNode prev) {
Expand Down
1 change: 1 addition & 0 deletions core/src/main/java/org/jruby/util/cli/Options.java
Expand Up @@ -148,6 +148,7 @@ public class Options {
public static final Option<Integer> TRUFFLE_DISPATCH_MEGAMORPHIC_MAX = integer(TRUFFLE, "truffle.dispatch.megamorphic.max", 255, "Maximum size of a megamorphic call site cache.");
public static final Option<Boolean> TRUFFLE_LOAD_PRINT = bool(TRUFFLE, "truffle.load.print", false, "Print the name of files as they're loaded.");
public static final Option<Boolean> TRUFFLE_DEBUG_ENABLE_ASSERT_CONSTANT = bool(TRUFFLE, "truffle.debug.enable_assert_constant", false, "Enable special 'truffle_assert_constant' form.");
public static final Option<Boolean> TRUFFLE_CALL_FORCE_SPLIT_INLINE_MISSING = bool(TRUFFLE, "truffle.call.force_split_inline_missing", true, "Force splitting/inlining of a method missing call.");

public static final Option<Boolean> NATIVE_ENABLED = bool(NATIVE, "native.enabled", true, "Enable/disable native code, including POSIX features and C exts.");
public static final Option<Boolean> NATIVE_VERBOSE = bool(NATIVE, "native.verbose", false, "Enable verbose logging of native extension loading.");
Expand Down

0 comments on commit 21ccb97

Please sign in to comment.