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: b02e7125e356
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7508b77d15ba
Choose a head ref
  • 2 commits
  • 23 files changed
  • 1 contributor

Commits on Sep 2, 2015

  1. Copy the full SHA
    f188039 View commit details
  2. Copy the full SHA
    7508b77 View commit details
Showing with 188 additions and 211 deletions.
  1. +2 −2 truffle/src/main/java/org/jruby/truffle/nodes/RubyNode.java
  2. +1 −1 truffle/src/main/java/org/jruby/truffle/nodes/cast/ArrayCastNode.java
  3. +2 −2 truffle/src/main/java/org/jruby/truffle/nodes/core/BasicObjectNodes.java
  4. +3 −3 truffle/src/main/java/org/jruby/truffle/nodes/core/KernelNodes.java
  5. +1 −1 truffle/src/main/java/org/jruby/truffle/nodes/core/array/ArrayBuilderNode.java
  6. +6 −6 truffle/src/main/java/org/jruby/truffle/nodes/core/array/ArrayNodes.java
  7. +2 −2 truffle/src/main/java/org/jruby/truffle/nodes/core/hash/HashLiteralNode.java
  8. +61 −90 truffle/src/main/java/org/jruby/truffle/nodes/core/hash/HashNodes.java
  9. +13 −13 truffle/src/main/java/org/jruby/truffle/nodes/core/hash/SetNode.java
  10. +2 −2 truffle/src/main/java/org/jruby/truffle/nodes/dispatch/CachedBoxedMethodMissingDispatchNode.java
  11. +3 −3 truffle/src/main/java/org/jruby/truffle/nodes/dispatch/UnresolvedDispatchNode.java
  12. +3 −3 truffle/src/main/java/org/jruby/truffle/nodes/methods/ExceptionTranslatingNode.java
  13. +2 −2 truffle/src/main/java/org/jruby/truffle/nodes/yield/CallBlockNode.java
  14. +1 −1 truffle/src/main/java/org/jruby/truffle/pack/nodes/control/NNode.java
  15. +17 −17 truffle/src/main/java/org/jruby/truffle/runtime/Options.java
  16. +11 −3 truffle/src/main/java/org/jruby/truffle/runtime/RubyContext.java
  17. +1 −1 truffle/src/main/java/org/jruby/truffle/runtime/backtrace/BacktraceFormatter.java
  18. +3 −5 truffle/src/main/java/org/jruby/truffle/runtime/core/CoreLibrary.java
  19. +11 −11 truffle/src/main/java/org/jruby/truffle/runtime/hash/BucketsStrategy.java
  20. +6 −5 truffle/src/main/java/org/jruby/truffle/runtime/hash/HashOperations.java
  21. +15 −16 truffle/src/main/java/org/jruby/truffle/runtime/hash/PackedArrayStrategy.java
  22. +19 −19 truffle/src/main/java/org/jruby/truffle/translator/BodyTranslator.java
  23. +3 −3 truffle/src/main/java/org/jruby/truffle/translator/ModuleTranslator.java
4 changes: 2 additions & 2 deletions truffle/src/main/java/org/jruby/truffle/nodes/RubyNode.java
Original file line number Diff line number Diff line change
@@ -172,8 +172,8 @@ protected NativeSockets nativeSockets() {
return getContext().getNativeSockets();
}

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

// Helper methods for caching
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@
import org.jruby.truffle.runtime.layouts.Layouts;

/*
* TODO(CS): could probably unify this with SplatCastNode with some final configuration options.
* TODO(CS): could probably unify this with SplatCastNode with some final configuration getContext().getOptions().
*/
@NodeChild("child")
public abstract class ArrayCastNode extends RubyNode {
Original file line number Diff line number Diff line change
@@ -235,10 +235,10 @@ public SendNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);

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

if ((boolean) Options.DISPATCH_METAPROGRAMMING_ALWAYS_UNCACHED) {
if ((boolean) getContext().getOptions().DISPATCH_METAPROGRAMMING_ALWAYS_UNCACHED) {
dispatchNode.forceUncached();
}
}
Original file line number Diff line number Diff line change
@@ -1432,10 +1432,10 @@ public PublicSendNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);

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

if ((boolean) Options.DISPATCH_METAPROGRAMMING_ALWAYS_UNCACHED) {
if ((boolean) getContext().getOptions().DISPATCH_METAPROGRAMMING_ALWAYS_UNCACHED) {
dispatchNode.forceUncached();
}
}
@@ -1611,7 +1611,7 @@ 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) Options.DISPATCH_METAPROGRAMMING_ALWAYS_UNCACHED) {
if ((boolean) getContext().getOptions().DISPATCH_METAPROGRAMMING_ALWAYS_UNCACHED) {
dispatch.forceUncached();
dispatchIgnoreVisibility.forceUncached();
}
Original file line number Diff line number Diff line change
@@ -65,7 +65,7 @@ public void resume(Object[] store) {
@Override
public Object start() {
CompilerDirectives.transferToInterpreter();
return new Object[Options.ARRAYS_UNINITIALIZED_SIZE];
return new Object[getContext().getOptions().ARRAYS_UNINITIALIZED_SIZE];
}

@Override
Original file line number Diff line number Diff line change
@@ -4191,9 +4191,9 @@ public DynamicObject sortVeryShortIntegerFixnum(VirtualFrame frame, DynamicObjec

// Selection sort - written very carefully to allow PE

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

// Selection sort - written very carefully to allow PE

for (int i = 0; i < Options.ARRAYS_SMALL; i++) {
for (int i = 0; i < getContext().getOptions().ARRAYS_SMALL; i++) {
if (i < size) {
for (int j = i + 1; j < Options.ARRAYS_SMALL; j++) {
for (int j = i + 1; j < getContext().getOptions().ARRAYS_SMALL; j++) {
if (j < size) {
if (castSortValue(compareDispatchNode.call(frame, store[j], "<=>", null, store[i])) < 0) {
final long temp = store[j];
@@ -4281,8 +4281,8 @@ private int castSortValue(Object value) {
throw new RaiseException(getContext().getCoreLibrary().argumentError("expecting a Fixnum to sort", this));
}

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

}
Original file line number Diff line number Diff line change
@@ -57,7 +57,7 @@ public RubyNode getValue(int index) {
public static HashLiteralNode create(RubyContext context, SourceSection sourceSection, RubyNode[] keyValues) {
if (keyValues.length == 0) {
return new EmptyHashLiteralNode(context, sourceSection);
} else if (keyValues.length <= Options.HASH_PACKED_ARRAY_MAX * 2) {
} else if (keyValues.length <= context.getOptions().HASH_PACKED_ARRAY_MAX * 2) {
return new SmallHashLiteralNode(context, sourceSection, keyValues);
} else {
return new GenericHashLiteralNode(context, sourceSection, keyValues);
@@ -102,7 +102,7 @@ public SmallHashLiteralNode(RubyContext context, SourceSection sourceSection, Ru
@ExplodeLoop
@Override
public Object execute(VirtualFrame frame) {
final Object[] store = PackedArrayStrategy.createStore();
final Object[] store = PackedArrayStrategy.createStore(getContext());

int size = 0;

151 changes: 61 additions & 90 deletions truffle/src/main/java/org/jruby/truffle/nodes/core/hash/HashNodes.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -60,14 +60,14 @@ public SetNode(RubyContext context, SourceSection sourceSection) {

@Specialization(guards = { "isNullHash(hash)", "!isRubyString(key)" })
public Object setNull(VirtualFrame frame, DynamicObject hash, Object key, Object value, boolean byIdentity) {
Object store = PackedArrayStrategy.createStore(hashNode.hash(frame, key), key, value);
assert HashOperations.verifyStore(store, 1, null, null);
Object store = PackedArrayStrategy.createStore(getContext(), hashNode.hash(frame, key), key, value);
assert HashOperations.verifyStore(getContext(), store, 1, null, null);
Layouts.HASH.setStore(hash, store);
Layouts.HASH.setSize(hash, 1);
Layouts.HASH.setFirstInSequence(hash, null);
Layouts.HASH.setLastInSequence(hash, null);

assert HashOperations.verifyStore(hash);
assert HashOperations.verifyStore(getContext(), hash);
return value;
}

@@ -84,14 +84,14 @@ public Object setNullNotByIdentity(VirtualFrame frame, DynamicObject hash, Dynam
@ExplodeLoop
@Specialization(guards = {"isPackedHash(hash)", "!isRubyString(key)"})
public Object setPackedArray(VirtualFrame frame, DynamicObject hash, Object key, Object value, boolean byIdentity) {
assert HashOperations.verifyStore(hash);
assert HashOperations.verifyStore(getContext(), hash);

final int hashed = hashNode.hash(frame, key);

final Object[] store = (Object[]) Layouts.HASH.getStore(hash);
final int size = Layouts.HASH.getSize(hash);

for (int n = 0; n < Options.HASH_PACKED_ARRAY_MAX; n++) {
for (int n = 0; n < getContext().getOptions().HASH_PACKED_ARRAY_MAX; n++) {
if (n < size) {
if (hashed == PackedArrayStrategy.getHashed(store, n)) {
final boolean equal;
@@ -104,7 +104,7 @@ public Object setPackedArray(VirtualFrame frame, DynamicObject hash, Object key,

if (equal) {
PackedArrayStrategy.setValue(store, n, value);
assert HashOperations.verifyStore(hash);
assert HashOperations.verifyStore(getContext(), hash);
return value;
}
}
@@ -113,16 +113,16 @@ public Object setPackedArray(VirtualFrame frame, DynamicObject hash, Object key,

extendProfile.enter();

if (strategyProfile.profile(size + 1 <= Options.HASH_PACKED_ARRAY_MAX)) {
if (strategyProfile.profile(size + 1 <= getContext().getOptions().HASH_PACKED_ARRAY_MAX)) {
PackedArrayStrategy.setHashedKeyValue(store, size, hashed, key, value);
Layouts.HASH.setSize(hash, size + 1);
return value;
} else {
PackedArrayStrategy.promoteToBuckets(hash, store, size);
BucketsStrategy.addNewEntry(hash, hashed, key, value);
PackedArrayStrategy.promoteToBuckets(getContext(), hash, store, size);
BucketsStrategy.addNewEntry(getContext(), hash, hashed, key, value);
}

assert HashOperations.verifyStore(hash);
assert HashOperations.verifyStore(getContext(), hash);

return value;
}
@@ -145,7 +145,7 @@ public Object setPackedArrayNotByIdentity(VirtualFrame frame, DynamicObject hash

@Specialization(guards = {"isBucketHash(hash)", "!isRubyString(key)"})
public Object setBuckets(VirtualFrame frame, DynamicObject hash, Object key, Object value, boolean byIdentity) {
assert HashOperations.verifyStore(hash);
assert HashOperations.verifyStore(getContext(), hash);

if (lookupEntryNode == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
@@ -185,13 +185,13 @@ public Object setBuckets(VirtualFrame frame, DynamicObject hash, Object key, Obj
// TODO CS 11-May-15 could store the next size for resize instead of doing a float operation each time

if (resizeProfile.profile(newSize / (double) entries.length > BucketsStrategy.LOAD_FACTOR)) {
BucketsStrategy.resize(hash);
BucketsStrategy.resize(getContext(), hash);
}
} else {
entry.setKeyValue(result.getHashed(), key, value);
}

assert HashOperations.verifyStore(hash);
assert HashOperations.verifyStore(getContext(), hash);

return value;
}
Original file line number Diff line number Diff line change
@@ -63,12 +63,12 @@ public CachedBoxedMethodMissingDispatchNode(
*/

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

if (callNode.isInlinable() && Options.DISPATCH_METHODMISSING_ALWAYS_INLINED) {
if (callNode.isInlinable() && getContext().getOptions().DISPATCH_METHODMISSING_ALWAYS_INLINED) {
insert(callNode);
callNode.forceInlining();
}
Original file line number Diff line number Diff line change
@@ -91,7 +91,7 @@ public DispatchNode call() throws Exception {

final DispatchNode newDispathNode;

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

if ((boolean) Options.DISPATCH_METAPROGRAMMING_ALWAYS_UNCACHED) {
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, Options.DISPATCH_METAPROGRAMMING_ALWAYS_INDIRECT, getDispatchAction());
getContext().getCoreLibrary().getMetaClass(receiverObject), method, getContext().getOptions().DISPATCH_METAPROGRAMMING_ALWAYS_INDIRECT, getDispatchAction());
}

default: {
Original file line number Diff line number Diff line change
@@ -90,15 +90,15 @@ public Object execute(VirtualFrame frame) {
}

private DynamicObject translate(ArithmeticException exception) {
if (Options.EXCEPTIONS_PRINT_JAVA) {
if (getContext().getOptions().EXCEPTIONS_PRINT_JAVA) {
exception.printStackTrace();
}

return getContext().getCoreLibrary().zeroDivisionError(this);
}

private DynamicObject translate(UnsupportedSpecializationException exception) {
if (Options.EXCEPTIONS_PRINT_JAVA) {
if (getContext().getOptions().EXCEPTIONS_PRINT_JAVA) {
exception.printStackTrace();
}

@@ -163,7 +163,7 @@ private DynamicObject translate(UnsupportedSpecializationException exception) {
}

public DynamicObject translate(Throwable throwable) {
if (Options.EXCEPTIONS_PRINT_JAVA || (boolean) Options.EXCEPTIONS_PRINT_UNCAUGHT_JAVA) {
if (getContext().getOptions().EXCEPTIONS_PRINT_JAVA || (boolean) getContext().getOptions().EXCEPTIONS_PRINT_UNCAUGHT_JAVA) {
throwable.printStackTrace();
}

Original file line number Diff line number Diff line change
@@ -85,10 +85,10 @@ protected CallNodeWrapperNode createBlockCallNode(CallTarget callTarget) {
final DirectCallNode callNode = Truffle.getRuntime().createDirectCallNode(callTarget);
final CallNodeWrapperNode callNodeWrapperNode = new CallNodeWrapperNode(callNode);

if (Options.INLINER_ALWAYS_CLONE_YIELD && callNode.isCallTargetCloningAllowed()) {
if (getContext().getOptions().INLINER_ALWAYS_CLONE_YIELD && callNode.isCallTargetCloningAllowed()) {
callNode.cloneCallTarget();
}
if (Options.INLINER_ALWAYS_INLINE_YIELD && callNode.isInlinable()) {
if (getContext().getOptions().INLINER_ALWAYS_INLINE_YIELD && callNode.isInlinable()) {
callNode.forceInlining();
}
return callNodeWrapperNode;
Original file line number Diff line number Diff line change
@@ -42,7 +42,7 @@ public NNode(RubyContext context, int repeats, PackNode child) {
public Object execute(VirtualFrame frame) {
if (CompilerDirectives.inCompiledCode()
&& CompilerDirectives.isCompilationConstant(repeats)
&& repeats <= Options.PACK_UNROLL_LIMIT) {
&& repeats <= getContext().getOptions().PACK_UNROLL_LIMIT) {
return executeExploded(frame);
}

34 changes: 17 additions & 17 deletions truffle/src/main/java/org/jruby/truffle/runtime/Options.java
Original file line number Diff line number Diff line change
@@ -11,27 +11,27 @@

public class Options {

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

public static final int DISPATCH_POLYMORPHIC_MAX = org.jruby.util.cli.Options.TRUFFLE_DISPATCH_POLYMORPHIC_MAX.load();
public static final int ARRAYS_UNINITIALIZED_SIZE = org.jruby.util.cli.Options.TRUFFLE_ARRAYS_UNINITIALIZED_SIZE.load();
public static final int ARRAYS_SMALL = org.jruby.util.cli.Options.TRUFFLE_ARRAYS_SMALL.load();
public static final int HASH_PACKED_ARRAY_MAX = org.jruby.util.cli.Options.TRUFFLE_HASH_PACKED_ARRAY_MAX.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();
public final int HASH_PACKED_ARRAY_MAX = org.jruby.util.cli.Options.TRUFFLE_HASH_PACKED_ARRAY_MAX.load();

public static final int INSTRUMENTATION_SERVER_PORT = org.jruby.util.cli.Options.TRUFFLE_INSTRUMENTATION_SERVER_PORT.load();
public static final boolean EXCEPTIONS_PRINT_JAVA = org.jruby.util.cli.Options.TRUFFLE_EXCEPTIONS_PRINT_JAVA.load();
public static final boolean EXCEPTIONS_PRINT_UNCAUGHT_JAVA = org.jruby.util.cli.Options.TRUFFLE_EXCEPTIONS_PRINT_UNCAUGHT_JAVA.load();
public static final boolean COVERAGE = org.jruby.util.cli.Options.TRUFFLE_COVERAGE.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();

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

public static final boolean INLINER_ALWAYS_CLONE_YIELD = org.jruby.util.cli.Options.TRUFFLE_INLINER_ALWAYS_CLONE_YIELD.load();
public static final boolean INLINER_ALWAYS_INLINE_YIELD = org.jruby.util.cli.Options.TRUFFLE_INLINER_ALWAYS_INLINE_YIELD.load();
public static final boolean DISPATCH_METAPROGRAMMING_ALWAYS_UNCACHED = org.jruby.util.cli.Options.TRUFFLE_DISPATCH_METAPROGRAMMING_ALWAYS_UNCACHED.load();
public static final boolean DISPATCH_METAPROGRAMMING_ALWAYS_INDIRECT = org.jruby.util.cli.Options.TRUFFLE_DISPATCH_METAPROGRAMMING_ALWAYS_INDIRECT.load();
public static final boolean DISPATCH_METHODMISSING_ALWAYS_CLONED = org.jruby.util.cli.Options.TRUFFLE_DISPATCH_METHODMISSING_ALWAYS_CLONED.load();
public static final boolean DISPATCH_METHODMISSING_ALWAYS_INLINED = org.jruby.util.cli.Options.TRUFFLE_DISPATCH_METHODMISSING_ALWAYS_INLINED.load();
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 static final int PACK_UNROLL_LIMIT = org.jruby.util.cli.Options.TRUFFLE_PACK_UNROLL_LIMIT.load();
public final int PACK_UNROLL_LIMIT = org.jruby.util.cli.Options.TRUFFLE_PACK_UNROLL_LIMIT.load();

}
14 changes: 11 additions & 3 deletions truffle/src/main/java/org/jruby/truffle/runtime/RubyContext.java
Original file line number Diff line number Diff line change
@@ -80,6 +80,8 @@ public class RubyContext extends ExecutionContext implements TruffleContextInter

private final Ruby runtime;

private final Options options;

private final POSIX posix;
private final NativeSockets nativeSockets;

@@ -108,6 +110,8 @@ public class RubyContext extends ExecutionContext implements TruffleContextInter
private final PrintStream debugStandardOut;

public RubyContext(Ruby runtime) {
options = new Options();

latestInstance = this;

assert runtime != null;
@@ -127,7 +131,7 @@ public RubyContext(Ruby runtime) {

// TODO(CS, 28-Jan-15) this is global
// TODO(CS, 28-Jan-15) maybe not do this for core?
if ((boolean) Options.COVERAGE) {
if (options.COVERAGE) {
coverageTracker = new CoverageTracker();
} else {
coverageTracker = null;
@@ -163,8 +167,8 @@ public RubyContext(Ruby runtime) {
rubiniusPrimitiveManager = new RubiniusPrimitiveManager();
rubiniusPrimitiveManager.addAnnotatedPrimitives();

if (Options.INSTRUMENTATION_SERVER_PORT != 0) {
instrumentationServerManager = new InstrumentationServerManager(this, Options.INSTRUMENTATION_SERVER_PORT);
if (options.INSTRUMENTATION_SERVER_PORT != 0) {
instrumentationServerManager = new InstrumentationServerManager(this, options.INSTRUMENTATION_SERVER_PORT);
instrumentationServerManager.start();
} else {
instrumentationServerManager = null;
@@ -674,4 +678,8 @@ public PrintStream getDebugStandardOut() {
return debugStandardOut;
}

public Options getOptions() {
return options;
}

}
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ public enum FormattingFlags {
public static BacktraceFormatter createDefaultFormatter(RubyContext context) {
final EnumSet<FormattingFlags> flags = EnumSet.noneOf(FormattingFlags.class);

if (!Options.BACKTRACES_HIDE_CORE_FILES) {
if (!context.getOptions().BACKTRACES_HIDE_CORE_FILES) {
flags.add(FormattingFlags.INCLUDE_CORE_FILES);
}

Original file line number Diff line number Diff line change
@@ -72,8 +72,6 @@

public class CoreLibrary {

public static final String CORE_LOAD_PATH = getCoreLoadPath();

private static final String CLI_RECORD_SEPARATOR = org.jruby.util.cli.Options.CLI_RECORD_SEPARATOR.load();

private final RubyContext context;
@@ -179,8 +177,8 @@ public class CoreLibrary {

@CompilationFinal private InternalMethod basicObjectSendMethod;

private static String getCoreLoadPath() {
String path = Options.CORE_LOAD_PATH;
public String getCoreLoadPath() {
String path = context.getOptions().CORE_LOAD_PATH;

while (path.endsWith("/")) {
path = path.substring(0, path.length() - 1);
@@ -673,7 +671,7 @@ public void initializeAfterMethodsAdded() {

state = State.LOADING_RUBY_CORE;
try {
context.load(context.getSourceCache().getSource(CoreLibrary.CORE_LOAD_PATH + "/core.rb"), node, NodeWrapper.IDENTITY);
context.load(context.getSourceCache().getSource(getCoreLoadPath() + "/core.rb"), node, NodeWrapper.IDENTITY);
} catch (IOException e) {
throw new RuntimeException(e);
}
Original file line number Diff line number Diff line change
@@ -124,9 +124,9 @@ public static int getBucketIndex(int hashed, int bucketsCount) {
return (hashed & SIGN_BIT_MASK) % bucketsCount;
}

public static void addNewEntry(DynamicObject hash, int hashed, Object key, Object value) {
public static void addNewEntry(RubyContext context, DynamicObject hash, int hashed, Object key, Object value) {
assert HashGuards.isBucketHash(hash);
assert HashOperations.verifyStore(hash);
assert HashOperations.verifyStore(context, hash);

final Entry[] buckets = (Entry[]) Layouts.HASH.getStore(hash);

@@ -157,13 +157,13 @@ public static void addNewEntry(DynamicObject hash, int hashed, Object key, Objec

Layouts.HASH.setSize(hash, Layouts.HASH.getSize(hash) + 1);

assert HashOperations.verifyStore(hash);
assert HashOperations.verifyStore(context, hash);
}

@TruffleBoundary
public static void resize(DynamicObject hash) {
public static void resize(RubyContext context, DynamicObject hash) {
assert HashGuards.isBucketHash(hash);
assert HashOperations.verifyStore(hash);
assert HashOperations.verifyStore(context, hash);

final int bucketsCount = capacityGreaterThan(Layouts.HASH.getSize(hash)) * OVERALLOCATE_FACTOR;
final Entry[] newEntries = new Entry[bucketsCount];
@@ -191,13 +191,13 @@ public static void resize(DynamicObject hash) {
int size = Layouts.HASH.getSize(hash);
Entry firstInSequence = Layouts.HASH.getFirstInSequence(hash);
Entry lastInSequence = Layouts.HASH.getLastInSequence(hash);
assert HashOperations.verifyStore(newEntries, size, firstInSequence, lastInSequence);
assert HashOperations.verifyStore(context, newEntries, size, firstInSequence, lastInSequence);
Layouts.HASH.setStore(hash, newEntries);
Layouts.HASH.setSize(hash, size);
Layouts.HASH.setFirstInSequence(hash, firstInSequence);
Layouts.HASH.setLastInSequence(hash, lastInSequence);

assert HashOperations.verifyStore(hash);
assert HashOperations.verifyStore(context, hash);
}

public static Iterator<Map.Entry<Object, Object>> iterateKeyValues(final Entry firstInSequence) {
@@ -261,12 +261,12 @@ public Iterator<Map.Entry<Object, Object>> iterator() {
};
}

public static void copyInto(DynamicObject from, DynamicObject to) {
public static void copyInto(RubyContext context, DynamicObject from, DynamicObject to) {
assert RubyGuards.isRubyHash(from);
assert HashGuards.isBucketHash(from);
assert HashOperations.verifyStore(from);
assert HashOperations.verifyStore(context, from);
assert RubyGuards.isRubyHash(to);
assert HashOperations.verifyStore(to);
assert HashOperations.verifyStore(context, to);

final Entry[] newEntries = new Entry[((Entry[]) Layouts.HASH.getStore(from)).length];

@@ -298,7 +298,7 @@ public static void copyInto(DynamicObject from, DynamicObject to) {
}

int size = Layouts.HASH.getSize(from);
assert HashOperations.verifyStore(newEntries, size, firstInSequence, lastInSequence);
assert HashOperations.verifyStore(context, newEntries, size, firstInSequence, lastInSequence);
Layouts.HASH.setStore(to, newEntries);
Layouts.HASH.setSize(to, size);
Layouts.HASH.setFirstInSequence(to, firstInSequence);
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@
import org.jruby.truffle.nodes.RubyGuards;
import org.jruby.truffle.nodes.core.hash.HashGuards;
import org.jruby.truffle.runtime.Options;
import org.jruby.truffle.runtime.RubyContext;
import org.jruby.truffle.runtime.layouts.Layouts;

import java.util.Collections;
@@ -22,11 +23,11 @@

public abstract class HashOperations {

public static boolean verifyStore(DynamicObject hash) {
return verifyStore(Layouts.HASH.getStore(hash), Layouts.HASH.getSize(hash), Layouts.HASH.getFirstInSequence(hash), Layouts.HASH.getLastInSequence(hash));
public static boolean verifyStore(RubyContext context, DynamicObject hash) {
return verifyStore(context, Layouts.HASH.getStore(hash), Layouts.HASH.getSize(hash), Layouts.HASH.getFirstInSequence(hash), Layouts.HASH.getLastInSequence(hash));
}

public static boolean verifyStore(Object store, int size, Entry firstInSequence, Entry lastInSequence) {
public static boolean verifyStore(RubyContext context, Object store, int size, Entry firstInSequence, Entry lastInSequence) {
assert store == null || store instanceof Object[] || store instanceof Entry[];

if (store == null) {
@@ -87,11 +88,11 @@ public static boolean verifyStore(Object store, int size, Entry firstInSequence,

assert foundSizeSequence == size : String.format("%d %d", foundSizeSequence, size);
} else if (store instanceof Object[]) {
assert ((Object[]) store).length == Options.HASH_PACKED_ARRAY_MAX * PackedArrayStrategy.ELEMENTS_PER_ENTRY : ((Object[]) store).length;
assert ((Object[]) store).length == context.getOptions().HASH_PACKED_ARRAY_MAX * PackedArrayStrategy.ELEMENTS_PER_ENTRY : ((Object[]) store).length;

final Object[] packedStore = (Object[]) store;

for (int n = 0; n < Options.HASH_PACKED_ARRAY_MAX; n++) {
for (int n = 0; n < context.getOptions().HASH_PACKED_ARRAY_MAX; n++) {
if (n < size) {
assert packedStore[n * 2] != null;
assert packedStore[n * 2 + 1] != null;
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@

import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
import com.oracle.truffle.api.object.DynamicObject;
import org.jruby.truffle.runtime.Options;
import org.jruby.truffle.runtime.RubyContext;
import org.jruby.truffle.runtime.layouts.Layouts;

import java.util.Iterator;
@@ -21,21 +21,20 @@
public abstract class PackedArrayStrategy {

public static final int ELEMENTS_PER_ENTRY = 3;
public static final int MAX_ELEMENTS = Options.HASH_PACKED_ARRAY_MAX * ELEMENTS_PER_ENTRY;

public static Object[] createStore(int hashed, Object key, Object value) {
final Object[] store = createStore();
public static Object[] createStore(RubyContext context, int hashed, Object key, Object value) {
final Object[] store = createStore(context);
setHashedKeyValue(store, 0, hashed, key, value);
return store;
}

public static Object[] createStore() {
return new Object[MAX_ELEMENTS];
public static Object[] createStore(RubyContext context) {
return new Object[context.getOptions().HASH_PACKED_ARRAY_MAX * ELEMENTS_PER_ENTRY];
}

public static Object[] copyStore(Object[] store) {
final Object[] copied = createStore();
System.arraycopy(store, 0, copied, 0, MAX_ELEMENTS);
public static Object[] copyStore(RubyContext context, Object[] store) {
final Object[] copied = createStore(context);
System.arraycopy(store, 0, copied, 0, context.getOptions().HASH_PACKED_ARRAY_MAX * ELEMENTS_PER_ENTRY);
return copied;
}

@@ -69,21 +68,21 @@ public static void setHashedKeyValue(Object[] store, int n, int hashed, Object k
setValue(store, n, value);
}

public static void removeEntry(Object[] store, int n) {
for (int i = 0; i < MAX_ELEMENTS; i += ELEMENTS_PER_ENTRY) {
public static void removeEntry(RubyContext context, Object[] store, int n) {
for (int i = 0; i < context.getOptions().HASH_PACKED_ARRAY_MAX * ELEMENTS_PER_ENTRY; i += ELEMENTS_PER_ENTRY) {
assert store[i] == null || store[i] instanceof Integer;
}

final int index = n * ELEMENTS_PER_ENTRY;
System.arraycopy(store, index + ELEMENTS_PER_ENTRY, store, index, MAX_ELEMENTS - ELEMENTS_PER_ENTRY - index);
System.arraycopy(store, index + ELEMENTS_PER_ENTRY, store, index, context.getOptions().HASH_PACKED_ARRAY_MAX * ELEMENTS_PER_ENTRY - ELEMENTS_PER_ENTRY - index);

for (int i = 0; i < MAX_ELEMENTS; i += ELEMENTS_PER_ENTRY) {
for (int i = 0; i < context.getOptions().HASH_PACKED_ARRAY_MAX * ELEMENTS_PER_ENTRY; i += ELEMENTS_PER_ENTRY) {
assert store[i] == null || store[i] instanceof Integer;
}
}

@TruffleBoundary
public static void promoteToBuckets(DynamicObject hash, Object[] store, int size) {
public static void promoteToBuckets(RubyContext context, DynamicObject hash, Object[] store, int size) {
final Entry[] buckets = new Entry[BucketsStrategy.capacityGreaterThan(size)];

Entry firstInSequence = null;
@@ -119,13 +118,13 @@ public static void promoteToBuckets(DynamicObject hash, Object[] store, int size
}
}

assert HashOperations.verifyStore(buckets, size, firstInSequence, lastInSequence);
assert HashOperations.verifyStore(context, buckets, size, firstInSequence, lastInSequence);
Layouts.HASH.setStore(hash, buckets);
Layouts.HASH.setSize(hash, size);
Layouts.HASH.setFirstInSequence(hash, firstInSequence);
Layouts.HASH.setLastInSequence(hash, lastInSequence);

assert HashOperations.verifyStore(hash);
assert HashOperations.verifyStore(context, hash);
}

@TruffleBoundary
Original file line number Diff line number Diff line change
@@ -432,7 +432,7 @@ public RubyNode visitCallNode(CallNode node) {
}
} else if (receiver instanceof VCallNode // undefined.equal?(obj)
&& ((VCallNode) receiver).getName().equals("undefined")
&& sourceSection.getSource().getPath().startsWith(CoreLibrary.CORE_LOAD_PATH + "/core/")
&& sourceSection.getSource().getPath().startsWith(context.getCoreLibrary().getCoreLoadPath() + "/core/")
&& methodName.equals("equal?")) {
RubyNode argument = translateArgumentsAndBlock(sourceSection, null, node.getArgsNode(), null, methodName).getArguments()[0];
final RubyNode ret = new IsRubiniusUndefinedNode(context, sourceSection, argument);
@@ -988,7 +988,7 @@ public RubyNode visitConstNode(org.jruby.ast.ConstNode node) {

final String name = ConstantReplacer.replacementName(sourceSection, node.getName());

if (name.equals("Rubinius") && sourceSection.getSource().getPath().startsWith(CoreLibrary.CORE_LOAD_PATH + "/core/rubinius")) {
if (name.equals("Rubinius") && sourceSection.getSource().getPath().startsWith(context.getCoreLibrary().getCoreLoadPath() + "/core/rubinius")) {
final RubyNode ret = new org.jruby.ast.Colon3Node(node.getPosition(), name).accept(this);
return addNewlineIfNeeded(node, ret);
}
@@ -1506,7 +1506,7 @@ public RubyNode visitGlobalVarNode(org.jruby.ast.GlobalVarNode node) {
RubyNode readNode = environment.findLocalVarNode(name, sourceSection);

if (name.equals("$_")) {
if (sourceSection.getSource().getPath().equals(CoreLibrary.CORE_LOAD_PATH + "/core/rubinius/common/regexp.rb")) {
if (sourceSection.getSource().getPath().equals(context.getCoreLibrary().getCoreLoadPath() + "/core/rubinius/common/regexp.rb")) {
readNode = new RubiniusLastStringReadNode(context, sourceSection);
} else {
readNode = GetFromThreadLocalNodeGen.create(context, sourceSection, readNode);
@@ -1607,7 +1607,7 @@ public RubyNode visitInstAsgnNode(org.jruby.ast.InstAsgnNode node) {
// Also note the check for frozen.
final RubyNode self = new RaiseIfFrozenNode(new SelfNode(context, sourceSection));

if (sourceSection.getSource().getPath().equals(CoreLibrary.CORE_LOAD_PATH + "/core/rubinius/common/time.rb")) {
if (sourceSection.getSource().getPath().equals(context.getCoreLibrary().getCoreLoadPath() + "/core/rubinius/common/time.rb")) {
if (name.equals("@is_gmt")) {
final RubyNode ret = TimeNodesFactory.InternalSetGMTNodeFactory.create(context, sourceSection, self, rhs);
return addNewlineIfNeeded(node, ret);
@@ -1617,7 +1617,7 @@ public RubyNode visitInstAsgnNode(org.jruby.ast.InstAsgnNode node) {
}
}

if (sourceSection.getSource().getPath().equals(CoreLibrary.CORE_LOAD_PATH + "/core/rubinius/common/hash.rb")) {
if (sourceSection.getSource().getPath().equals(context.getCoreLibrary().getCoreLoadPath() + "/core/rubinius/common/hash.rb")) {
if (name.equals("@default")) {
final RubyNode ret = HashNodesFactory.SetDefaultValueNodeFactory.create(context, sourceSection, self, rhs);
return addNewlineIfNeeded(node, ret);
@@ -1627,16 +1627,16 @@ public RubyNode visitInstAsgnNode(org.jruby.ast.InstAsgnNode node) {
}
}

if (sourceSection.getSource().getPath().equals(CoreLibrary.CORE_LOAD_PATH + "/core/rubinius/bootstrap/string.rb") ||
sourceSection.getSource().getPath().equals(CoreLibrary.CORE_LOAD_PATH + "/core/rubinius/common/string.rb")) {
if (sourceSection.getSource().getPath().equals(context.getCoreLibrary().getCoreLoadPath() + "/core/rubinius/bootstrap/string.rb") ||
sourceSection.getSource().getPath().equals(context.getCoreLibrary().getCoreLoadPath() + "/core/rubinius/common/string.rb")) {

if (name.equals("@hash")) {
final RubyNode ret = StringNodesFactory.ModifyBangNodeFactory.create(context, sourceSection, new RubyNode[]{});
return addNewlineIfNeeded(node, ret);
}
}

if (sourceSection.getSource().getPath().equals(CoreLibrary.CORE_LOAD_PATH + "/core/rubinius/common/range.rb")) {
if (sourceSection.getSource().getPath().equals(context.getCoreLibrary().getCoreLoadPath() + "/core/rubinius/common/range.rb")) {
if (name.equals("@begin")) {
final RubyNode ret = RangeNodesFactory.InternalSetBeginNodeGen.create(context, sourceSection, self, rhs);
return addNewlineIfNeeded(node, ret);
@@ -1650,7 +1650,7 @@ public RubyNode visitInstAsgnNode(org.jruby.ast.InstAsgnNode node) {
}

// TODO (pitr 08-Aug-2015): values of predefined OM properties should be casted to defined types automatically
if (sourceSection.getSource().getPath().equals(CoreLibrary.CORE_LOAD_PATH + "/core/rubinius/common/io.rb")) {
if (sourceSection.getSource().getPath().equals(context.getCoreLibrary().getCoreLoadPath() + "/core/rubinius/common/io.rb")) {
if (name.equals("@start") || name.equals("@used") || name.equals("@total") || name.equals("@lineno")) {
// Cast int-fitting longs back to int
return addNewlineIfNeeded(
@@ -1679,8 +1679,8 @@ public RubyNode visitInstVarNode(org.jruby.ast.InstVarNode node) {
* self, and @start to be 0.
*/

if (sourceSection.getSource().getPath().equals(CoreLibrary.CORE_LOAD_PATH + "/core/rubinius/common/array.rb") ||
sourceSection.getSource().getPath().equals(CoreLibrary.CORE_LOAD_PATH + "/core/rubinius/api/shims/array.rb")) {
if (sourceSection.getSource().getPath().equals(context.getCoreLibrary().getCoreLoadPath() + "/core/rubinius/common/array.rb") ||
sourceSection.getSource().getPath().equals(context.getCoreLibrary().getCoreLoadPath() + "/core/rubinius/api/shims/array.rb")) {

if (name.equals("@total")) {
final RubyNode ret = new RubyCallNode(context, sourceSection, "size", self, null, false);
@@ -1694,7 +1694,7 @@ public RubyNode visitInstVarNode(org.jruby.ast.InstVarNode node) {
}
}

if (sourceSection.getSource().getPath().equals(CoreLibrary.CORE_LOAD_PATH + "/core/rubinius/common/regexp.rb")) {
if (sourceSection.getSource().getPath().equals(context.getCoreLibrary().getCoreLoadPath() + "/core/rubinius/common/regexp.rb")) {
if (name.equals("@source")) {
final RubyNode ret = MatchDataNodesFactory.RubiniusSourceNodeGen.create(context, sourceSection, self);
return addNewlineIfNeeded(node, ret);
@@ -1711,8 +1711,8 @@ public RubyNode visitInstVarNode(org.jruby.ast.InstVarNode node) {
}
}

if (sourceSection.getSource().getPath().equals(CoreLibrary.CORE_LOAD_PATH + "/core/rubinius/bootstrap/string.rb") ||
sourceSection.getSource().getPath().equals(CoreLibrary.CORE_LOAD_PATH + "/core/rubinius/common/string.rb")) {
if (sourceSection.getSource().getPath().equals(context.getCoreLibrary().getCoreLoadPath() + "/core/rubinius/bootstrap/string.rb") ||
sourceSection.getSource().getPath().equals(context.getCoreLibrary().getCoreLoadPath() + "/core/rubinius/common/string.rb")) {

if (name.equals("@num_bytes")) {
final RubyNode ret = StringNodesFactory.ByteSizeNodeFactory.create(context, sourceSection, new RubyNode[] { self });
@@ -1726,7 +1726,7 @@ public RubyNode visitInstVarNode(org.jruby.ast.InstVarNode node) {
}
}

if (sourceSection.getSource().getPath().equals(CoreLibrary.CORE_LOAD_PATH + "/core/rubinius/common/time.rb")) {
if (sourceSection.getSource().getPath().equals(context.getCoreLibrary().getCoreLoadPath() + "/core/rubinius/common/time.rb")) {
if (name.equals("@is_gmt")) {
final RubyNode ret = TimeNodesFactory.InternalGMTNodeFactory.create(context, sourceSection, self);
return addNewlineIfNeeded(node, ret);
@@ -1736,7 +1736,7 @@ public RubyNode visitInstVarNode(org.jruby.ast.InstVarNode node) {
}
}

if (sourceSection.getSource().getPath().equals(CoreLibrary.CORE_LOAD_PATH + "/core/rubinius/common/hash.rb")) {
if (sourceSection.getSource().getPath().equals(context.getCoreLibrary().getCoreLoadPath() + "/core/rubinius/common/hash.rb")) {
if (name.equals("@default")) {
final RubyNode ret = HashNodesFactory.DefaultValueNodeFactory.create(context, sourceSection, self);
return addNewlineIfNeeded(node, ret);
@@ -1749,8 +1749,8 @@ public RubyNode visitInstVarNode(org.jruby.ast.InstVarNode node) {
}
}

if (sourceSection.getSource().getPath().equals(CoreLibrary.CORE_LOAD_PATH + "/core/rubinius/common/range.rb") ||
sourceSection.getSource().getPath().equals(CoreLibrary.CORE_LOAD_PATH + "/core/rubinius/api/shims/range.rb")) {
if (sourceSection.getSource().getPath().equals(context.getCoreLibrary().getCoreLoadPath() + "/core/rubinius/common/range.rb") ||
sourceSection.getSource().getPath().equals(context.getCoreLibrary().getCoreLoadPath() + "/core/rubinius/api/shims/range.rb")) {

if (name.equals("@begin")) {
final RubyNode ret = RangeNodesFactory.BeginNodeFactory.create(context, sourceSection, new RubyNode[] { self });
@@ -2753,7 +2753,7 @@ public RubyNode visitUntilNode(org.jruby.ast.UntilNode node) {
@Override
public RubyNode visitVCallNode(org.jruby.ast.VCallNode node) {
final SourceSection sourceSection = translate(node.getPosition());
if (node.getName().equals("undefined") && sourceSection.getSource().getPath().startsWith(CoreLibrary.CORE_LOAD_PATH + "/core/")) {
if (node.getName().equals("undefined") && sourceSection.getSource().getPath().startsWith(context.getCoreLibrary().getCoreLoadPath() + "/core/")) {
final RubyNode ret = new LiteralNode(context, sourceSection, context.getCoreLibrary().getRubiniusUndefined());
return addNewlineIfNeeded(node, ret);
}
Original file line number Diff line number Diff line change
@@ -83,11 +83,11 @@ public RubyNode visitDefnNode(org.jruby.ast.DefnNode node) {
String methodName = node.getName();
boolean rubiniusMethodRename = false;

if (sourceSection.getSource().getPath().equals(CoreLibrary.CORE_LOAD_PATH + "/core/rubinius/common/array.rb")) {
if (sourceSection.getSource().getPath().equals(context.getCoreLibrary().getCoreLoadPath() + "/core/rubinius/common/array.rb")) {
rubiniusMethodRename = methodName.equals("zip");
} else if (sourceSection.getSource().getPath().equals(CoreLibrary.CORE_LOAD_PATH + "/core/rubinius/common/float.rb")) {
} else if (sourceSection.getSource().getPath().equals(context.getCoreLibrary().getCoreLoadPath() + "/core/rubinius/common/float.rb")) {
rubiniusMethodRename = methodName.equals("round");
} else if (sourceSection.getSource().getPath().equals(CoreLibrary.CORE_LOAD_PATH + "/core/rubinius/common/range.rb")) {
} else if (sourceSection.getSource().getPath().equals(context.getCoreLibrary().getCoreLoadPath() + "/core/rubinius/common/range.rb")) {
rubiniusMethodRename = methodName.equals("each") || methodName.equals("step") || methodName.equals("to_a");
}