Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0d3a9bc0fa21
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 71f3ed4a1333
Choose a head ref
  • 3 commits
  • 6 files changed
  • 1 contributor

Commits on Nov 2, 2014

  1. Copy the full SHA
    d9026d5 View commit details
  2. Copy the full SHA
    c7937e7 View commit details
  3. Copy the full SHA
    71f3ed4 View commit details
Original file line number Diff line number Diff line change
@@ -222,7 +222,7 @@ private Object methodMissing(RubyBasicObject self, RubySymbol name, Object[] arg

}

@CoreMethod(names = {"send", "__send__"}, needsBlock = true, required = 1, argumentsAsArray = true, alwaysSplit = true)
@CoreMethod(names = {"send", "__send__"}, needsBlock = true, required = 1, argumentsAsArray = true)
public abstract static class SendNode extends CoreMethodNode {

@Child protected DispatchHeadNode dispatchNode;
Original file line number Diff line number Diff line change
@@ -52,6 +52,4 @@

int[] lowerFixnumParameters() default {};

boolean alwaysSplit() default true;

}
Original file line number Diff line number Diff line change
@@ -120,7 +120,7 @@ private static void addMethod(RubyModule module, RubyMethod method, List<String>
private static RubyRootNode makeGenericMethod(RubyContext context, MethodDetails methodDetails, boolean needsSelf) {
final CoreSourceSection sourceSection = new CoreSourceSection(methodDetails.getClassAnnotation().name(), methodDetails.getMethodAnnotation().names()[0]);

final SharedMethodInfo sharedMethodInfo = new SharedMethodInfo(sourceSection, null, methodDetails.getIndicativeName(), false, null, methodDetails.getMethodAnnotation().alwaysSplit());
final SharedMethodInfo sharedMethodInfo = new SharedMethodInfo(sourceSection, null, methodDetails.getIndicativeName(), false, null, true);

final int required = methodDetails.getMethodAnnotation().required();
final int optional;
Original file line number Diff line number Diff line change
@@ -1454,7 +1454,7 @@ public boolean require(RubyString feature) {
}
}

@CoreMethod(names = "respond_to?", required = 1, optional = 1, alwaysSplit = true)
@CoreMethod(names = "respond_to?", required = 1, optional = 1)
public abstract static class RespondToNode extends CoreMethodNode {

@Child protected DispatchHeadNode dispatch;
Original file line number Diff line number Diff line change
@@ -52,17 +52,19 @@ public CachedBoxedMethodMissingDispatchNode(RubyContext context, Object cachedNa
} else {
callNode = Truffle.getRuntime().createDirectCallNode(method.getCallTarget());

// TODO(CS): check shared method info should split

/*
* 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.
* The way that #method_missing is used is usually as an indirection to call some other method, and
* possibly to modify the arguments. In both cases, but especially the latter, it makes a lot of sense
* to manually clone the call target and to inline it.
*/

if (Options.TRUFFLE_CALL_FORCE_SPLIT_INLINE_MISSING.load()) {
if (callNode.isSplittable() && (Options.TRUFFLE_DISPATCH_METHODMISSING_ALWAYS_CLONED.load() || method.getSharedMethodInfo().shouldAlwaysSplit())) {
insert(callNode);
callNode.split();
}

if (callNode.isInlinable() && Options.TRUFFLE_DISPATCH_METHODMISSING_ALWAYS_INLINED.load()) {
insert(callNode);
callNode.forceInlining();
}
}
3 changes: 2 additions & 1 deletion core/src/main/java/org/jruby/util/cli/Options.java
Original file line number Diff line number Diff line change
@@ -146,12 +146,13 @@ public class Options {
public static final Option<Integer> TRUFFLE_DISPATCH_POLYMORPHIC_MAX = integer(TRUFFLE, "truffle.dispatch.polymorphic.max", 8, "Maximum size of a polymorphic 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> TRUFFLE_PANIC_ON_JAVA_ASSERT = bool(TRUFFLE, "truffle.debug.panic_on_java_assert", false, "Panic as soon as a Java assertion failure is found.");
public static final Option<Boolean> TRUFFLE_INLINER_ALWAYS_CLONE_YIELD = bool(TRUFFLE, "truffle.inliner.always_clone_yield", true, "Always clone yield call targets.");
public static final Option<Boolean> TRUFFLE_INLINER_ALWAYS_INLINE_YIELD = bool(TRUFFLE, "truffle.inliner.always_inline_yield", true, "Always inline yield call targets.");
public static final Option<Boolean> TRUFFLE_DISPATCH_METAPROGRAMMING_ALWAYS_UNCACHED = bool(TRUFFLE, "truffle.dispatch.metaprogramming_always_uncached", false, "Always use uncached dispatch for the metaprogramming methods #__send__, #send and #respond_to?, and for any call site that has to use #method_missing or #const_missing.");
public static final Option<Boolean> TRUFFLE_DISPATCH_METAPROGRAMMING_ALWAYS_INDIRECT = bool(TRUFFLE, "truffle.dispatch.metaprogramming_always_indirect", false, "Always use indirect calls for the metaprogramming methods #__send__ and #send, and for any call site that has to use #method_missing or #const_missing.");
public static final Option<Boolean> TRUFFLE_DISPATCH_METHODMISSING_ALWAYS_CLONED = bool(TRUFFLE, "truffle.call.method_missing_always_cloned", true, "Always clone #method_missing call targets.");
public static final Option<Boolean> TRUFFLE_DISPATCH_METHODMISSING_ALWAYS_INLINED = bool(TRUFFLE, "truffle.call.method_missing_always_inlined", true, "Always inline #method_missing call targets.");

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.");