Skip to content

Commit

Permalink
Showing 60 changed files with 181 additions and 183 deletions.
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@ public Object execute(VirtualFrame frame) {
}

final Object[] arguments = ArrayUtils.unshift(RubyArguments.getArguments(frame), methodSymbol);
return toEnumNode.call(frame, RubyArguments.getSelf(frame), "to_enum", null, arguments);
return toEnumNode.call(frame, RubyArguments.getSelf(frame), "to_enum", arguments);
} else {
return method.execute(frame);
}
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@ public Object execute(VirtualFrame frame) {
Object self = RubyArguments.getSelf(frame);

for (String requiredLibrary : getRequiredLibraries()) {
requireNode.call(frame, self, "require", null, createString(StringOperations.encodeRope(requiredLibrary, UTF8Encoding.INSTANCE)));
requireNode.call(frame, self, "require", createString(StringOperations.encodeRope(requiredLibrary, UTF8Encoding.INSTANCE)));
}

return nil();
Original file line number Diff line number Diff line change
@@ -160,10 +160,10 @@ public Object vmExtendedModules(VirtualFrame frame, Object object) {
final DynamicObject metaClass = coreLibrary().getMetaClass(object);

if (Layouts.CLASS.getIsSingleton(metaClass)) {
final Object ret = newArrayNode.call(frame, coreLibrary().getArrayClass(), "new", null);
final Object ret = newArrayNode.call(frame, coreLibrary().getArrayClass(), "new");

for (DynamicObject included : Layouts.MODULE.getFields(metaClass).prependedAndIncludedModules()) {
arrayAppendNode.call(frame, ret, "<<", null, included);
arrayAppendNode.call(frame, ret, "<<", included);
}

return ret;
30 changes: 15 additions & 15 deletions truffle/src/main/java/org/jruby/truffle/core/array/ArrayNodes.java
Original file line number Diff line number Diff line change
@@ -234,7 +234,7 @@ public Object mulObject(
DynamicObject array,
DynamicObject string,
@Cached("createMethodCall()") CallDispatchHeadNode callNode) {
return callNode.call(frame, array, "join", null, string);
return callNode.call(frame, array, "join", string);
}

@Specialization(guards = { "!isInteger(object)", "!isRubyString(object)" })
@@ -349,8 +349,8 @@ public Object fallback(VirtualFrame frame, DynamicObject array, DynamicObject ar
}

InternalMethod method = RubyArguments.getMethod(frame);
return fallbackNode.call(frame, array, "element_reference_fallback", null,
createString(StringOperations.encodeRope(method.getName(), UTF8Encoding.INSTANCE)), args);
return fallbackNode.call(frame, array, "element_reference_fallback", createString(StringOperations.encodeRope(method.getName(), UTF8Encoding.INSTANCE)),
args);
}

}
@@ -911,13 +911,13 @@ protected Object value(Object[] args) {
@Specialization
protected Object fillFallback(VirtualFrame frame, DynamicObject array, Object[] args, NotProvided block,
@Cached("createMethodCall()") CallDispatchHeadNode callFillInternal) {
return callFillInternal.call(frame, array, "fill_internal", null, args);
return callFillInternal.call(frame, array, "fill_internal", args);
}

@Specialization
protected Object fillFallback(VirtualFrame frame, DynamicObject array, Object[] args, DynamicObject block,
@Cached("createMethodCall()") CallDispatchHeadNode callFillInternal) {
return callFillInternal.call(frame, array, "fill_internal", block, args);
return callFillInternal.callWithBlock(frame, array, "fill_internal", block, args);
}

}
@@ -947,7 +947,7 @@ public long hash(VirtualFrame frame, DynamicObject array,

for (int n = 0; n < size; n++) {
final Object value = store.get(n);
final long valueHash = toLong(frame, toHashNode.call(frame, value, "hash", null));
final long valueHash = toLong(frame, toHashNode.call(frame, value, "hash"));
h = Helpers.murmurCombine(h, valueHash);
}

@@ -1132,7 +1132,7 @@ protected Object callToAry(VirtualFrame frame, Object object) {
CompilerDirectives.transferToInterpreterAndInvalidate();
toAryNode = insert(DispatchHeadNodeFactory.createMethodCall(getContext(), true));
}
return toAryNode.call(frame, object, "to_ary", null);
return toAryNode.call(frame, object, "to_ary");
}

protected int toInt(VirtualFrame frame, Object value) {
@@ -1262,7 +1262,7 @@ public Object injectSymbolHelper(VirtualFrame frame, DynamicObject array, Dynami

try {
for (; n < getSize(array); n++) {
accumulator = dispatch.call(frame, accumulator, symbol, null, store.get(n));
accumulator = dispatch.call(frame, accumulator, symbol, store.get(n));
}
} finally {
if (CompilerDirectives.inInterpreter()) {
@@ -1374,7 +1374,7 @@ public Object max(VirtualFrame frame, DynamicObject array, NotProvided blockNotP
maxBlock.getSharedMethodInfo(), maxBlock.getCallTarget(), maxBlock.getCallTarget(),
maximumClosureFrame.materialize(), method, array, null);

eachNode.call(frame, array, "each", block);
eachNode.callWithBlock(frame, array, "each", block);

if (maximum.get() == null) {
return nil();
@@ -1389,7 +1389,7 @@ public Object max(
DynamicObject array,
DynamicObject block,
@Cached("createMethodCall()") CallDispatchHeadNode callNode) {
return callNode.call(frame, array, "max_internal", block);
return callNode.callWithBlock(frame, array, "max_internal", block);
}

}
@@ -1415,7 +1415,7 @@ public DynamicObject max(VirtualFrame frame, Object maximumObject, Object value)
if (current == null) {
maximum.set(value);
} else {
final Object compared = compareNode.call(frame, value, "<=>", null, current);
final Object compared = compareNode.call(frame, value, "<=>", current);

if (compared instanceof Integer) {
if ((int) compared > 0) {
@@ -1496,7 +1496,7 @@ public Object min(VirtualFrame frame, DynamicObject array, NotProvided blockNotP
minBlock.getSharedMethodInfo(), minBlock.getCallTarget(), minBlock.getCallTarget(),
minimumClosureFrame.materialize(), method, array, null);

eachNode.call(frame, array, "each", block);
eachNode.callWithBlock(frame, array, "each", block);

if (minimum.get() == null) {
return nil();
@@ -1537,7 +1537,7 @@ public DynamicObject min(VirtualFrame frame, Object minimumObject, Object value)
if (current == null) {
minimum.set(value);
} else {
final Object compared = compareNode.call(frame, value, "<=>", null, current);
final Object compared = compareNode.call(frame, value, "<=>", current);

if (compared instanceof Integer) {
if ((int) compared < 0) {
@@ -2140,7 +2140,7 @@ public DynamicObject sortVeryShort(VirtualFrame frame, DynamicObject array, NotP
if (j < size) {
final Object a = store.get(i);
final Object b = store.get(j);
if (castSortValue(compareDispatchNode.call(frame, b, "<=>", null, a)) < 0) {
if (castSortValue(compareDispatchNode.call(frame, b, "<=>", a)) < 0) {
store.set(j, a);
store.set(i, b);
}
@@ -2258,7 +2258,7 @@ private Object zipRuby(VirtualFrame frame, DynamicObject array, DynamicObject bl

final Object[] others = RubyArguments.getArguments(frame);

return zipInternalCall.call(frame, array, "zip_internal", block, others);
return zipInternalCall.callWithBlock(frame, array, "zip_internal", block, others);
}

protected static boolean fallback(DynamicObject array, DynamicObject other, Object[] others) {
Original file line number Diff line number Diff line change
@@ -325,7 +325,7 @@ public Object send(VirtualFrame frame, Object self, Object name, Object[] args,

@Specialization
public Object send(VirtualFrame frame, Object self, Object name, Object[] args, DynamicObject block) {
return dispatchNode.call(frame, self, name, block, args);
return dispatchNode.callWithBlock(frame, self, name, block, args);
}

}
Original file line number Diff line number Diff line change
@@ -99,7 +99,7 @@ public Object cast(Object nil) {
@Specialization(guards = {"!isNil(object)", "!isRubyBignum(object)", "!isRubyArray(object)"})
public Object cast(VirtualFrame frame, DynamicObject object,
@Cached("create()") BranchProfile errorProfile) {
final Object result = toArrayNode.call(frame, object, "to_ary", null);
final Object result = toArrayNode.call(frame, object, "to_ary");

if (result == nil()) {
return nil();
Original file line number Diff line number Diff line change
@@ -77,7 +77,7 @@ public DynamicObject castHash(DynamicObject hash) {
@Specialization(guards = {"!isNil(object)", "!isRubyBignum(object)", "!isRubyHash(object)"})
public Object cast(VirtualFrame frame, DynamicObject object,
@Cached("create()") BranchProfile errorProfile) {
final Object result = toHashNode.call(frame, object, "to_hash", null);
final Object result = toHashNode.call(frame, object, "to_hash");

if (result == DispatchNode.MISSING) {
return nil();
Original file line number Diff line number Diff line change
@@ -81,7 +81,7 @@ public String coerceObjectToStr(VirtualFrame frame, Object object,
@Cached("createMethodCall()") CallDispatchHeadNode toStr) {
final Object coerced;
try {
coerced = toStr.call(frame, object, "to_str", null);
coerced = toStr.call(frame, object, "to_str");
} catch (RaiseException e) {
errorProfile.enter();
if (Layouts.BASIC_OBJECT.getLogicalClass(e.getException()) == coreLibrary().getNoMethodErrorClass()) {
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ public DynamicObject coerceObject(VirtualFrame frame, Object object,
@Cached("create()") BranchProfile errorProfile) {
final Object coerced;
try {
coerced = toStr.call(frame, object, "to_str", null);
coerced = toStr.call(frame, object, "to_str");
} catch (RaiseException e) {
errorProfile.enter();
if (Layouts.BASIC_OBJECT.getLogicalClass(e.getException()) == coreLibrary().getNoMethodErrorClass()) {
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ private Object callToFloat(VirtualFrame frame, DynamicObject value) {
CompilerDirectives.transferToInterpreterAndInvalidate();
toFloatCallNode = insert(DispatchHeadNodeFactory.createMethodCall(getContext(), MissingBehavior.RETURN_MISSING));
}
return toFloatCallNode.call(frame, value, method, null);
return toFloatCallNode.call(frame, value, method);
}

@Specialization(guards = "isNumeric(frame, value)")
Original file line number Diff line number Diff line change
@@ -73,7 +73,7 @@ public Object splatNil(VirtualFrame frame, Object nil) {
return Layouts.ARRAY.createArray(coreLibrary().getArrayFactory(), new Object[]{nil()}, 1);

case CONVERT:
return toA.call(frame, nil, "to_a", null);
return toA.call(frame, nil, "to_a");

case NIL:
return nil;
@@ -95,9 +95,9 @@ public DynamicObject splat(VirtualFrame frame, DynamicObject array) {
public DynamicObject splat(VirtualFrame frame, Object object,
@Cached("create()") BranchProfile errorProfile) {
// MRI tries to call dynamic respond_to? here.
Object respondToResult = respondToToA.call(frame, object, "respond_to?", null, conversionMethod, true);
Object respondToResult = respondToToA.call(frame, object, "respond_to?", conversionMethod, true);
if (respondToResult != DispatchNode.MISSING && respondToCast.executeBoolean(frame, respondToResult)) {
final Object array = toA.call(frame, object, conversionMethod, null);
final Object array = toA.call(frame, object, conversionMethod);

if (RubyGuards.isRubyArray(array)) {
return (DynamicObject) array;
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ public DynamicObject coerceObject(VirtualFrame frame, Object object,

final Object coerced;
try {
coerced = toAryNode.call(frame, object, "to_ary", null);
coerced = toAryNode.call(frame, object, "to_ary");
} catch (RaiseException e) {
errorProfile.enter();
if (Layouts.BASIC_OBJECT.getLogicalClass(e.getException()) == coreLibrary().getNoMethodErrorClass()) {
Original file line number Diff line number Diff line change
@@ -84,7 +84,7 @@ private double coerceObject(VirtualFrame frame, Object object, BranchProfile err

final Object coerced;
try {
coerced = toFNode.call(frame, object, "to_f", null);
coerced = toFNode.call(frame, object, "to_f");
} catch (RaiseException e) {
if (Layouts.BASIC_OBJECT.getLogicalClass(e.getException()) == coreLibrary().getNoMethodErrorClass()) {
errorProfile.enter();
Original file line number Diff line number Diff line change
@@ -114,7 +114,7 @@ private Object coerceObject(VirtualFrame frame, Object object, BranchProfile err

final Object coerced;
try {
coerced = toIntNode.call(frame, object, "to_int", null);
coerced = toIntNode.call(frame, object, "to_int");
} catch (RaiseException e) {
errorProfile.enter();
if (Layouts.BASIC_OBJECT.getLogicalClass(e.getException()) == coreLibrary().getNoMethodErrorClass()) {
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ public DynamicObject doObject(VirtualFrame frame, Object object,
@Cached("create()") BranchProfile errorProfile) {
final Object coerced;
try {
coerced = toProc.call(frame, object, "to_proc", null);
coerced = toProc.call(frame, object, "to_proc");
} catch (RaiseException e) {
errorProfile.enter();
if (Layouts.BASIC_OBJECT.getLogicalClass(e.getException()) == coreLibrary().getNoMethodErrorClass()) {
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ public DynamicObject toS(DynamicObject string) {

@Specialization(guards = "!isRubyString(object)", rewriteOn = UnexpectedResultException.class)
public DynamicObject toS(VirtualFrame frame, Object object) throws UnexpectedResultException {
final Object value = callToSNode.call(frame, object, "to_s", null);
final Object value = callToSNode.call(frame, object, "to_s");

if (RubyGuards.isRubyString(value)) {
return (DynamicObject) value;
@@ -61,7 +61,7 @@ public DynamicObject toS(VirtualFrame frame, Object object) throws UnexpectedRes

@Specialization(guards = "!isRubyString(object)")
public DynamicObject toSFallback(VirtualFrame frame, Object object) {
final Object value = callToSNode.call(frame, object, "to_s", null);
final Object value = callToSNode.call(frame, object, "to_s");

if (RubyGuards.isRubyString(value)) {
return (DynamicObject) value;
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@ public DynamicObject coerceObject(VirtualFrame frame, Object object,
@Cached("create()") BranchProfile errorProfile) {
final Object coerced;
try {
coerced = toStrNode.call(frame, object, "to_str", null);
coerced = toStrNode.call(frame, object, "to_str");
} catch (RaiseException e) {
if (Layouts.BASIC_OBJECT.getLogicalClass(e.getException()) == coreLibrary().getNoMethodErrorClass()) {
errorProfile.enter();
Loading

0 comments on commit ca2ae66

Please sign in to comment.