Skip to content

Commit

Permalink
Showing 16 changed files with 73 additions and 83 deletions.
37 changes: 18 additions & 19 deletions core/src/main/java/org/jruby/util/cli/Options.java
Original file line number Diff line number Diff line change
@@ -217,35 +217,34 @@ public class Options {
public static final Option<Boolean> CLI_RUBYOPT_ENABLE = bool(CLI, "cli.rubyopt.enable", true, "Enable/disable RUBYOPT processing at start.");
public static final Option<Boolean> CLI_STRIP_HEADER = bool(CLI, "cli.strip.header", false, "Strip text before shebang in script. Same as -x.");
public static final Option<Boolean> CLI_LOAD_GEMFILE = bool(CLI, "cli.load.gemfile", false, "Load a bundler Gemfile in cwd before running. Same as -G.");

public static final Option<String> TRUFFLE_CORE_LOAD_PATH = string(TRUFFLE, "truffle.core.load_path", "truffle:/jruby-truffle", "Directory to load the Truffle core library from.");

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<Integer> TRUFFLE_ARRAYS_UNINITIALIZED_SIZE = integer(TRUFFLE, "truffle.arrays.uninitialized_size", 32, "How large an array to allocate when we have no other information to go on.");
public static final Option<Integer> TRUFFLE_ARRAYS_SMALL = integer(TRUFFLE, "truffle.arrays.small", 3, "Maximum size of an Array to consider small for optimisations.");
public static final Option<Integer> TRUFFLE_HASH_PACKED_ARRAY_MAX = integer(TRUFFLE, "truffle.hash.packed_array_max", 3, "Maximum size of a Hash to use with the packed array storage strategy.");

public static final Option<Integer> TRUFFLE_INSTRUMENTATION_SERVER_PORT = integer(TRUFFLE, "truffle.instrumentation_server_port", 0, "Port number to run an HTTP server on that provides instrumentation services");
public static final Option<Boolean> TRUFFLE_EXCEPTIONS_PRINT_JAVA = bool(TRUFFLE, "truffle.exceptions.print_java", false, "Print Java exceptions at the point of translating them to Ruby exceptions.");
public static final Option<Boolean> TRUFFLE_EXCEPTIONS_PRINT_UNCAUGHT_JAVA = bool(TRUFFLE, "truffle.exceptions.print_uncaught_java", false, "Print uncaught Java exceptions at the point of translating them to Ruby exceptions.");
public static final Option<Boolean> TRUFFLE_COVERAGE = bool(TRUFFLE, "truffle.coverage", false, "Enable coverage (will be enabled by default in the future - currently has some bugs");

public static final Option<Boolean> TRUFFLE_BACKTRACES_HIDE_CORE_FILES = bool(TRUFFLE, "truffle.backtraces.hide_core_files", true, "Hide core source files in backtraces, like MRI does.");
public static final Option<String> TRUFFLE_CORE_LOAD_PATH = string(TRUFFLE, "truffle.core.load_path", "truffle:/jruby-truffle", "Location to load the Truffle core library from.");

public static final Option<Integer> TRUFFLE_ARRAY_UNINITIALIZED_SIZE = integer(TRUFFLE, "truffle.array.uninitialized_size", 32, "How large an Array to allocate when we have no other information to go on.");
public static final Option<Integer> TRUFFLE_ARRAY_SMALL = integer(TRUFFLE, "truffle.array.small", 3, "Maximum size of an Array to consider small for optimisations.");
public static final Option<Integer> TRUFFLE_HASH_PACKED_ARRAY_MAX = integer(TRUFFLE, "truffle.hash.packed_array.max", 3, "Maximum size of a Hash to consider using the packed array storage strategy for.");

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<Integer> TRUFFLE_DISPATCH_CACHE = integer(TRUFFLE, "truffle.dispatch.cache", 8, "Dispatch (various forms of method call) cache size.");

public static final Option<Boolean> TRUFFLE_CORE_ALWAYS_CLONE = bool(TRUFFLE, "truffle.core.always_clone", true, "Always clone built-in core methods.");
public static final Option<Boolean> TRUFFLE_YIELD_ALWAYS_CLONE = bool(TRUFFLE, "truffle.yield.always_clone", true, "Always clone yields.");
public static final Option<Boolean> TRUFFLE_YIELD_ALWAYS_INLINE = bool(TRUFFLE, "truffle.yield.always_inline", true, "Always inline yields.");
public static final Option<Boolean> TRUFFLE_METHODMISSING_ALWAYS_CLONE = bool(TRUFFLE, "truffle.method_missing.always_clone", true, "Always clone #method_missing.");
public static final Option<Boolean> TRUFFLE_METHODMISSING_ALWAYS_INLINE = bool(TRUFFLE, "truffle.method_missing.always_inline", true, "Always inline #method_missing.");

public static final Option<Integer> TRUFFLE_PACK_UNROLL_LIMIT = integer(TRUFFLE, "truffle.pack.unroll", 4, "If a pack expression has a loop less than this many iterations, unroll it.");

public static final Option<Integer> TRUFFLE_INSTRUMENTATION_SERVER_PORT = integer(TRUFFLE, "truffle.instrumentation_server_port", 0, "Port number to run an HTTP server on that provides instrumentation services");
public static final Option<Boolean> TRUFFLE_EXCEPTIONS_PRINT_JAVA = bool(TRUFFLE, "truffle.exceptions.print_java", false, "Print Java exceptions at the point of translating them to Ruby exceptions.");
public static final Option<Boolean> TRUFFLE_EXCEPTIONS_PRINT_UNCAUGHT_JAVA = bool(TRUFFLE, "truffle.exceptions.print_uncaught_java", false, "Print uncaught Java exceptions at the point of translating them to Ruby exceptions.");
public static final Option<Boolean> TRUFFLE_BACKTRACES_HIDE_CORE_FILES = bool(TRUFFLE, "truffle.backtraces.hide_core_files", true, "Hide core source files in backtraces, like MRI does.");
public static final Option<Boolean> TRUFFLE_INCLUDE_CORE_FILE_CALLERS_IN_SET_TRACE_FUNC = bool(TRUFFLE, "truffle.set_trace_func.include_core_file_callers", false, "Include internal core library calls in set_trace_func output.");

public static final Option<Boolean> TRUFFLE_METRICS_TIME = bool(TRUFFLE, "truffle.metrics.time", false, "Print the time at various stages of VM operation.");
public static final Option<Boolean> TRUFFLE_METRICS_MEMORY_USED_ON_EXIT = bool(TRUFFLE, "truffle.metrics.memory_used_on_exit", false, "Print the size of heap memory in use on exit.");

public static final Option<Boolean> TRUFFLE_INCLUDE_CORE_FILE_CALLERS_IN_SET_TRACE_FUNC = bool(TRUFFLE, "truffle.set_trace_func.include_core_file_callers", false, "Include internal core library calls in set_trace_func output.");

public static String dump() {
return "# JRuby configuration options with current values\n" +
Option.formatValues(_loadedOptions);
3 changes: 1 addition & 2 deletions truffle/src/main/java/org/jruby/truffle/nodes/RubyNode.java
Original file line number Diff line number Diff line change
@@ -27,7 +27,6 @@
import org.jruby.RubyString;
import org.jruby.truffle.nodes.instrument.RubyWrapperNode;
import org.jruby.truffle.runtime.NotProvided;
import org.jruby.truffle.runtime.Options;
import org.jruby.truffle.runtime.RubyArguments;
import org.jruby.truffle.runtime.RubyContext;
import org.jruby.truffle.runtime.layouts.Layouts;
@@ -173,7 +172,7 @@ protected NativeSockets nativeSockets() {
}

protected int getCacheLimit() {
return getContext().getOptions().DISPATCH_POLYMORPHIC_MAX;
return getContext().getOptions().DISPATCH_CACHE;
}

// Helper methods for caching
Original file line number Diff line number Diff line change
@@ -235,12 +235,8 @@ public SendNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);

dispatchNode = new CallDispatchHeadNode(context, true,
getContext().getOptions().DISPATCH_METAPROGRAMMING_ALWAYS_INDIRECT,
false,
MissingBehavior.CALL_METHOD_MISSING);

if ((boolean) getContext().getOptions().DISPATCH_METAPROGRAMMING_ALWAYS_UNCACHED) {
dispatchNode.forceUncached();
}
}

@Specialization
Original file line number Diff line number Diff line change
@@ -157,7 +157,7 @@ private static RubyRootNode makeGenericMethod(RubyContext context, MethodDetails

final Arity arity = new Arity(required, optional, method.rest());

final SharedMethodInfo sharedMethodInfo = new SharedMethodInfo(sourceSection, LexicalScope.NONE, arity, methodDetails.getIndicativeName(), false, null, true);
final SharedMethodInfo sharedMethodInfo = new SharedMethodInfo(sourceSection, LexicalScope.NONE, arity, methodDetails.getIndicativeName(), false, null, context.getOptions().CORE_ALWAYS_CLONE);

final List<RubyNode> argumentsNodes = new ArrayList<>();

Original file line number Diff line number Diff line change
@@ -1432,12 +1432,8 @@ public PublicSendNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);

dispatchNode = new CallDispatchHeadNode(context, false,
getContext().getOptions().DISPATCH_METAPROGRAMMING_ALWAYS_INDIRECT,
false,
MissingBehavior.CALL_METHOD_MISSING);

if ((boolean) getContext().getOptions().DISPATCH_METAPROGRAMMING_ALWAYS_UNCACHED) {
dispatchNode.forceUncached();
}
}

@Specialization
@@ -1610,11 +1606,6 @@ public RespondToNode(RubyContext context, SourceSection sourceSection) {

dispatch = new DoesRespondDispatchHeadNode(context, false, false, MissingBehavior.RETURN_MISSING, null);
dispatchIgnoreVisibility = new DoesRespondDispatchHeadNode(context, true, false, MissingBehavior.RETURN_MISSING, null);

if ((boolean) getContext().getOptions().DISPATCH_METAPROGRAMMING_ALWAYS_UNCACHED) {
dispatch.forceUncached();
dispatchIgnoreVisibility.forceUncached();
}
}

public abstract boolean executeDoesRespondTo(VirtualFrame frame, Object object, Object name, boolean includeProtectedAndPrivate);
Original file line number Diff line number Diff line change
@@ -14,7 +14,6 @@
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.object.DynamicObject;
import com.oracle.truffle.api.utilities.ConditionProfile;
import org.jruby.truffle.runtime.Options;
import org.jruby.truffle.runtime.RubyContext;
import org.jruby.truffle.runtime.array.ArrayUtils;
import org.jruby.truffle.runtime.core.ArrayOperations;
@@ -65,7 +64,7 @@ public void resume(Object[] store) {
@Override
public Object start() {
CompilerDirectives.transferToInterpreter();
return new Object[getContext().getOptions().ARRAYS_UNINITIALIZED_SIZE];
return new Object[getContext().getOptions().ARRAY_UNINITIALIZED_SIZE];
}

@Override
Original file line number Diff line number Diff line change
@@ -48,7 +48,6 @@
import org.jruby.truffle.pack.runtime.PackResult;
import org.jruby.truffle.pack.runtime.exceptions.*;
import org.jruby.truffle.runtime.NotProvided;
import org.jruby.truffle.runtime.Options;
import org.jruby.truffle.runtime.RubyArguments;
import org.jruby.truffle.runtime.RubyContext;
import org.jruby.truffle.runtime.array.ArrayMirror;
@@ -4191,9 +4190,9 @@ public DynamicObject sortVeryShortIntegerFixnum(VirtualFrame frame, DynamicObjec

// Selection sort - written very carefully to allow PE

for (int i = 0; i < getContext().getOptions().ARRAYS_SMALL; i++) {
for (int i = 0; i < getContext().getOptions().ARRAY_SMALL; i++) {
if (i < size) {
for (int j = i + 1; j < getContext().getOptions().ARRAYS_SMALL; j++) {
for (int j = i + 1; j < getContext().getOptions().ARRAY_SMALL; j++) {
if (j < size) {
if (castSortValue(compareDispatchNode.call(frame, store[j], "<=>", null, store[i])) < 0) {
final int temp = store[j];
@@ -4219,9 +4218,9 @@ public DynamicObject sortVeryShortLongFixnum(VirtualFrame frame, DynamicObject a

// Selection sort - written very carefully to allow PE

for (int i = 0; i < getContext().getOptions().ARRAYS_SMALL; i++) {
for (int i = 0; i < getContext().getOptions().ARRAY_SMALL; i++) {
if (i < size) {
for (int j = i + 1; j < getContext().getOptions().ARRAYS_SMALL; j++) {
for (int j = i + 1; j < getContext().getOptions().ARRAY_SMALL; j++) {
if (j < size) {
if (castSortValue(compareDispatchNode.call(frame, store[j], "<=>", null, store[i])) < 0) {
final long temp = store[j];
@@ -4282,7 +4281,7 @@ private int castSortValue(Object value) {
}

protected boolean isSmall(DynamicObject array) {
return Layouts.ARRAY.getSize(array) <= getContext().getOptions().ARRAYS_SMALL;
return Layouts.ARRAY.getSize(array) <= getContext().getOptions().ARRAY_SMALL;
}

}
Original file line number Diff line number Diff line change
@@ -58,7 +58,7 @@ public CachedBooleanDispatchNode(
if (!indirect) {
falseCallDirect = Truffle.getRuntime().createDirectCallNode(falseMethod.getCallTarget());

if (falseCallDirect.isCallTargetCloningAllowed() && falseMethod.getSharedMethodInfo().shouldAlwaysSplit()) {
if (falseCallDirect.isCallTargetCloningAllowed() && falseMethod.getSharedMethodInfo().shouldAlwaysClone()) {
insert(falseCallDirect);
falseCallDirect.cloneCallTarget();
}
@@ -72,7 +72,7 @@ public CachedBooleanDispatchNode(
if (!indirect) {
trueCallDirect = Truffle.getRuntime().createDirectCallNode(trueMethod.getCallTarget());

if (trueCallDirect.isCallTargetCloningAllowed() && trueMethod.getSharedMethodInfo().shouldAlwaysSplit()) {
if (trueCallDirect.isCallTargetCloningAllowed() && trueMethod.getSharedMethodInfo().shouldAlwaysClone()) {
insert(trueCallDirect);
trueCallDirect.cloneCallTarget();
}
Original file line number Diff line number Diff line change
@@ -57,7 +57,7 @@ public CachedBoxedDispatchNode(
} else {
callNode = Truffle.getRuntime().createDirectCallNode(method.getCallTarget());

if ((callNode.isCallTargetCloningAllowed() && method.getSharedMethodInfo().shouldAlwaysSplit())
if ((callNode.isCallTargetCloningAllowed() && method.getSharedMethodInfo().shouldAlwaysClone())
|| (method.getDeclaringModule() != null
&& Layouts.MODULE.getFields(method.getDeclaringModule()).getName().equals("TruffleInterop"))) {
insert(callNode);
Original file line number Diff line number Diff line change
@@ -19,7 +19,6 @@
import com.oracle.truffle.api.object.Shape;

import org.jruby.truffle.nodes.RubyGuards;
import org.jruby.truffle.runtime.Options;
import org.jruby.truffle.runtime.RubyArguments;
import org.jruby.truffle.runtime.RubyContext;
import org.jruby.truffle.runtime.array.ArrayUtils;
@@ -63,12 +62,12 @@ public CachedBoxedMethodMissingDispatchNode(
*/

if (callNode.isCallTargetCloningAllowed()
&& (getContext().getOptions().DISPATCH_METHODMISSING_ALWAYS_CLONED || method.getSharedMethodInfo().shouldAlwaysSplit())) {
&& (getContext().getOptions().METHODMISSING_ALWAYS_CLONE || method.getSharedMethodInfo().shouldAlwaysClone())) {
insert(callNode);
callNode.cloneCallTarget();
}

if (callNode.isInlinable() && getContext().getOptions().DISPATCH_METHODMISSING_ALWAYS_INLINED) {
if (callNode.isInlinable() && getContext().getOptions().METHODMISSING_ALWAYS_INLINE) {
insert(callNode);
callNode.forceInlining();
}
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@ public CachedBoxedSymbolDispatchNode(
} else {
callNode = Truffle.getRuntime().createDirectCallNode(method.getCallTarget());

if (callNode.isCallTargetCloningAllowed() && method.getSharedMethodInfo().shouldAlwaysSplit()) {
if (callNode.isCallTargetCloningAllowed() && method.getSharedMethodInfo().shouldAlwaysClone()) {
insert(callNode);
callNode.cloneCallTarget();
}
Original file line number Diff line number Diff line change
@@ -60,7 +60,7 @@ public CachedSingletonDispatchNode(
} else {
callNode = Truffle.getRuntime().createDirectCallNode(method.getCallTarget());

if ((callNode.isCallTargetCloningAllowed() && method.getSharedMethodInfo().shouldAlwaysSplit())
if ((callNode.isCallTargetCloningAllowed() && method.getSharedMethodInfo().shouldAlwaysClone())
|| (method.getDeclaringModule() != null
&& Layouts.MODULE.getFields(method.getDeclaringModule()).getName().equals("TruffleInterop"))) {
insert(callNode);
Original file line number Diff line number Diff line change
@@ -18,7 +18,6 @@
import com.oracle.truffle.api.object.Shape;
import org.jruby.truffle.nodes.RubyGuards;
import org.jruby.truffle.nodes.objects.SingletonClassNode;
import org.jruby.truffle.runtime.Options;
import org.jruby.truffle.runtime.RubyArguments;
import org.jruby.truffle.runtime.RubyCallStack;
import org.jruby.truffle.runtime.RubyContext;
@@ -84,7 +83,7 @@ public DispatchNode call() throws Exception {

final DispatchNode newDispathNode;

if (depth == getContext().getOptions().DISPATCH_POLYMORPHIC_MAX) {
if (depth == getContext().getOptions().DISPATCH_CACHE) {
newDispathNode = new UncachedDispatchNode(getContext(), ignoreVisibility, getDispatchAction(), missingBehavior);
} else {
depth++;
@@ -230,12 +229,8 @@ private DispatchNode createMethodMissingNode(
receiverObject.toString() + " didn't have a #method_missing", this));
}

if ((boolean) getContext().getOptions().DISPATCH_METAPROGRAMMING_ALWAYS_UNCACHED) {
return new UncachedDispatchNode(getContext(), ignoreVisibility, getDispatchAction(), missingBehavior);
}

return new CachedBoxedMethodMissingDispatchNode(getContext(), methodName, first, shape,
getContext().getCoreLibrary().getMetaClass(receiverObject), method, getContext().getOptions().DISPATCH_METAPROGRAMMING_ALWAYS_INDIRECT, getDispatchAction());
getContext().getCoreLibrary().getMetaClass(receiverObject), method, false, getDispatchAction());
}

default: {
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@
package org.jruby.truffle.nodes.yield;

import org.jruby.truffle.nodes.RubyNode;
import org.jruby.truffle.runtime.Options;
import org.jruby.truffle.runtime.RubyArguments;
import org.jruby.truffle.runtime.RubyContext;
import org.jruby.truffle.runtime.layouts.Layouts;
@@ -85,10 +84,10 @@ protected CallNodeWrapperNode createBlockCallNode(CallTarget callTarget) {
final DirectCallNode callNode = Truffle.getRuntime().createDirectCallNode(callTarget);
final CallNodeWrapperNode callNodeWrapperNode = new CallNodeWrapperNode(callNode);

if (getContext().getOptions().INLINER_ALWAYS_CLONE_YIELD && callNode.isCallTargetCloningAllowed()) {
if (getContext().getOptions().YIELD_ALWAYS_CLONE && callNode.isCallTargetCloningAllowed()) {
callNode.cloneCallTarget();
}
if (getContext().getOptions().INLINER_ALWAYS_INLINE_YIELD && callNode.isInlinable()) {
if (getContext().getOptions().YIELD_ALWAYS_INLINE && callNode.isInlinable()) {
callNode.forceInlining();
}
return callNodeWrapperNode;
42 changes: 28 additions & 14 deletions truffle/src/main/java/org/jruby/truffle/runtime/Options.java
Original file line number Diff line number Diff line change
@@ -11,29 +11,43 @@

public class Options {

// Features

public final boolean COVERAGE = org.jruby.util.cli.Options.TRUFFLE_COVERAGE.load();

// Resources

public final String CORE_LOAD_PATH = org.jruby.util.cli.Options.TRUFFLE_CORE_LOAD_PATH.load();

public final int DISPATCH_POLYMORPHIC_MAX = org.jruby.util.cli.Options.TRUFFLE_DISPATCH_POLYMORPHIC_MAX.load();
public final int ARRAYS_UNINITIALIZED_SIZE = org.jruby.util.cli.Options.TRUFFLE_ARRAYS_UNINITIALIZED_SIZE.load();
public final int ARRAYS_SMALL = org.jruby.util.cli.Options.TRUFFLE_ARRAYS_SMALL.load();
// Data structures

public final int ARRAY_UNINITIALIZED_SIZE = org.jruby.util.cli.Options.TRUFFLE_ARRAY_UNINITIALIZED_SIZE.load();
public final int ARRAY_SMALL = org.jruby.util.cli.Options.TRUFFLE_ARRAY_SMALL.load();

public final int HASH_PACKED_ARRAY_MAX = org.jruby.util.cli.Options.TRUFFLE_HASH_PACKED_ARRAY_MAX.load();

public final int INSTRUMENTATION_SERVER_PORT = org.jruby.util.cli.Options.TRUFFLE_INSTRUMENTATION_SERVER_PORT.load();
public final boolean EXCEPTIONS_PRINT_JAVA = org.jruby.util.cli.Options.TRUFFLE_EXCEPTIONS_PRINT_JAVA.load();
public final boolean EXCEPTIONS_PRINT_UNCAUGHT_JAVA = org.jruby.util.cli.Options.TRUFFLE_EXCEPTIONS_PRINT_UNCAUGHT_JAVA.load();
public final boolean COVERAGE = org.jruby.util.cli.Options.TRUFFLE_COVERAGE.load();
// Caches

public final boolean BACKTRACES_HIDE_CORE_FILES = org.jruby.util.cli.Options.TRUFFLE_BACKTRACES_HIDE_CORE_FILES.load();
public final int DISPATCH_CACHE = org.jruby.util.cli.Options.TRUFFLE_DISPATCH_CACHE.load();

// Cloning and inlining

public final boolean INLINER_ALWAYS_CLONE_YIELD = org.jruby.util.cli.Options.TRUFFLE_INLINER_ALWAYS_CLONE_YIELD.load();
public final boolean INLINER_ALWAYS_INLINE_YIELD = org.jruby.util.cli.Options.TRUFFLE_INLINER_ALWAYS_INLINE_YIELD.load();
public final boolean DISPATCH_METAPROGRAMMING_ALWAYS_UNCACHED = org.jruby.util.cli.Options.TRUFFLE_DISPATCH_METAPROGRAMMING_ALWAYS_UNCACHED.load();
public final boolean DISPATCH_METAPROGRAMMING_ALWAYS_INDIRECT = org.jruby.util.cli.Options.TRUFFLE_DISPATCH_METAPROGRAMMING_ALWAYS_INDIRECT.load();
public final boolean DISPATCH_METHODMISSING_ALWAYS_CLONED = org.jruby.util.cli.Options.TRUFFLE_DISPATCH_METHODMISSING_ALWAYS_CLONED.load();
public final boolean DISPATCH_METHODMISSING_ALWAYS_INLINED = org.jruby.util.cli.Options.TRUFFLE_DISPATCH_METHODMISSING_ALWAYS_INLINED.load();
public final boolean CORE_ALWAYS_CLONE = org.jruby.util.cli.Options.TRUFFLE_CORE_ALWAYS_CLONE.load();
public final boolean YIELD_ALWAYS_CLONE = org.jruby.util.cli.Options.TRUFFLE_YIELD_ALWAYS_CLONE.load();
public final boolean YIELD_ALWAYS_INLINE = org.jruby.util.cli.Options.TRUFFLE_YIELD_ALWAYS_INLINE.load();
public final boolean METHODMISSING_ALWAYS_CLONE = org.jruby.util.cli.Options.TRUFFLE_METHODMISSING_ALWAYS_CLONE.load();
public final boolean METHODMISSING_ALWAYS_INLINE = org.jruby.util.cli.Options.TRUFFLE_METHODMISSING_ALWAYS_INLINE.load();

// Other optimisations

public final int PACK_UNROLL_LIMIT = org.jruby.util.cli.Options.TRUFFLE_PACK_UNROLL_LIMIT.load();

// Debugging

public final int INSTRUMENTATION_SERVER_PORT = org.jruby.util.cli.Options.TRUFFLE_INSTRUMENTATION_SERVER_PORT.load();
public final boolean EXCEPTIONS_PRINT_JAVA = org.jruby.util.cli.Options.TRUFFLE_EXCEPTIONS_PRINT_JAVA.load();
public final boolean EXCEPTIONS_PRINT_UNCAUGHT_JAVA = org.jruby.util.cli.Options.TRUFFLE_EXCEPTIONS_PRINT_UNCAUGHT_JAVA.load();
public final boolean BACKTRACES_HIDE_CORE_FILES = org.jruby.util.cli.Options.TRUFFLE_BACKTRACES_HIDE_CORE_FILES.load();
public final boolean INCLUDE_CORE_FILE_CALLERS_IN_SET_TRACE_FUNC = org.jruby.util.cli.Options.TRUFFLE_INCLUDE_CORE_FILE_CALLERS_IN_SET_TRACE_FUNC.load();

}
Original file line number Diff line number Diff line change
@@ -26,9 +26,9 @@ public class SharedMethodInfo {
private final String name;
private final boolean isBlock;
private final org.jruby.ast.Node parseTree;
private final boolean alwaysSplit;
private final boolean alwaysClone;

public SharedMethodInfo(SourceSection sourceSection, LexicalScope lexicalScope, Arity arity, String name, boolean isBlock, Node parseTree, boolean alwaysSplit) {
public SharedMethodInfo(SourceSection sourceSection, LexicalScope lexicalScope, Arity arity, String name, boolean isBlock, Node parseTree, boolean alwaysClone) {
assert sourceSection != null;
assert name != null;

@@ -38,7 +38,7 @@ public SharedMethodInfo(SourceSection sourceSection, LexicalScope lexicalScope,
this.name = name;
this.isBlock = isBlock;
this.parseTree = parseTree;
this.alwaysSplit = alwaysSplit;
this.alwaysClone = alwaysClone;
}

public SourceSection getSourceSection() {
@@ -65,12 +65,12 @@ public org.jruby.ast.Node getParseTree() {
return parseTree;
}

public boolean shouldAlwaysSplit() {
return alwaysSplit;
public boolean shouldAlwaysClone() {
return alwaysClone;
}

public SharedMethodInfo withName(String newName) {
return new SharedMethodInfo(sourceSection, lexicalScope, arity, newName, isBlock, parseTree, alwaysSplit);
return new SharedMethodInfo(sourceSection, lexicalScope, arity, newName, isBlock, parseTree, alwaysClone);
}

@Override

0 comments on commit c234d8c

Please sign in to comment.