Skip to content

Commit

Permalink
Showing 15 changed files with 104 additions and 92 deletions.
Original file line number Diff line number Diff line change
@@ -162,7 +162,7 @@ public RubyString executeRubyString(VirtualFrame frame) throws UnexpectedResultE
public RubyArray executeRubyArray(VirtualFrame frame) throws UnexpectedResultException {
final Object value = execute(frame);

if (value instanceof RubyArray) {
if (RubyGuards.isRubyArray(value)) {
return (RubyArray) value;
} else {
throw new UnexpectedResultException(value);
Original file line number Diff line number Diff line change
@@ -41,7 +41,7 @@ protected Object castSingle(Object[] args) {

@TruffleBoundary
@Specialization(guards = { "!noArguments(args)", "!singleArgument(args)" })
protected RubyArray castMany(Object[] args) {
protected RubyBasicObject castMany(Object[] args) {
return ArrayNodes.fromObjects(getContext().getCoreLibrary().getArrayClass(), args);
}

Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@
import org.jruby.truffle.runtime.RubyContext;
import org.jruby.truffle.runtime.control.RaiseException;
import org.jruby.truffle.runtime.core.RubyArray;
import org.jruby.truffle.runtime.core.RubyBasicObject;

/**
* Splat as used to cast a value to an array if it isn't already, as in {@code *value}.
@@ -61,7 +62,7 @@ public SplatCastNode(RubyContext context, SourceSection sourceSection, NilBehavi
protected abstract RubyNode getChild();

@Specialization(guards = "isNil(nil)")
public RubyArray splat(Object nil) {
public RubyBasicObject splat(Object nil) {
switch (nilBehavior) {
case EMPTY_ARRAY:
return createEmptyArray();
@@ -84,7 +85,7 @@ public RubyArray splat(VirtualFrame frame, RubyArray array) {
}

@Specialization(guards = {"!isNil(object)", "!isRubyArray(object)"})
public RubyArray splat(VirtualFrame frame, Object object) {
public RubyBasicObject splat(VirtualFrame frame, Object object) {
final String method;

if (useToAry) {
32 changes: 16 additions & 16 deletions truffle/src/main/java/org/jruby/truffle/nodes/core/KernelNodes.java
Original file line number Diff line number Diff line change
@@ -1085,12 +1085,12 @@ public MethodsNode(RubyContext context, SourceSection sourceSection) {
}

@Specialization
public RubyArray methods(VirtualFrame frame, Object self, NotProvided regular) {
public RubyBasicObject methods(VirtualFrame frame, Object self, NotProvided regular) {
return methods(frame, self, true);
}

@Specialization
public RubyArray methods(VirtualFrame frame, Object self, boolean regular) {
public RubyBasicObject methods(VirtualFrame frame, Object self, boolean regular) {
RubyClass metaClass = metaClassNode.executeMetaClass(frame, self);

CompilerDirectives.transferToInterpreter();
@@ -1107,7 +1107,7 @@ public RubyArray methods(VirtualFrame frame, Object self, boolean regular) {
}

@Specialization
public RubyArray methods(VirtualFrame frame, RubyBasicObject self, Object regular) {
public RubyBasicObject methods(VirtualFrame frame, RubyBasicObject self, Object regular) {
if (booleanCastNode == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
booleanCastNode = insert(BooleanCastNodeGen.create(getContext(), getSourceSection(), null));
@@ -1142,12 +1142,12 @@ public PrivateMethodsNode(RubyContext context, SourceSection sourceSection) {
}

@Specialization
public RubyArray privateMethods(VirtualFrame frame, Object self, NotProvided includeAncestors) {
public RubyBasicObject privateMethods(VirtualFrame frame, Object self, NotProvided includeAncestors) {
return privateMethods(frame, self, true);
}

@Specialization
public RubyArray privateMethods(VirtualFrame frame, Object self, boolean includeAncestors) {
public RubyBasicObject privateMethods(VirtualFrame frame, Object self, boolean includeAncestors) {
RubyClass metaClass = metaClassNode.executeMetaClass(frame, self);

CompilerDirectives.transferToInterpreter();
@@ -1156,7 +1156,7 @@ public RubyArray privateMethods(VirtualFrame frame, Object self, boolean include
}

@Specialization
public RubyArray privateMethods(VirtualFrame frame, RubyBasicObject self, Object includeAncestors) {
public RubyBasicObject privateMethods(VirtualFrame frame, RubyBasicObject self, Object includeAncestors) {
if (booleanCastNode == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
booleanCastNode = insert(BooleanCastNodeGen.create(getContext(), getSourceSection(), null));
@@ -1196,12 +1196,12 @@ public ProtectedMethodsNode(RubyContext context, SourceSection sourceSection) {
}

@Specialization
public RubyArray protectedMethods(VirtualFrame frame, Object self, NotProvided includeAncestors) {
public RubyBasicObject protectedMethods(VirtualFrame frame, Object self, NotProvided includeAncestors) {
return protectedMethods(frame, self, true);
}

@Specialization
public RubyArray protectedMethods(VirtualFrame frame, Object self, boolean includeAncestors) {
public RubyBasicObject protectedMethods(VirtualFrame frame, Object self, boolean includeAncestors) {
RubyClass metaClass = metaClassNode.executeMetaClass(frame, self);

CompilerDirectives.transferToInterpreter();
@@ -1210,7 +1210,7 @@ public RubyArray protectedMethods(VirtualFrame frame, Object self, boolean inclu
}

@Specialization
public RubyArray protectedMethods(VirtualFrame frame, RubyBasicObject self, Object includeAncestors) {
public RubyBasicObject protectedMethods(VirtualFrame frame, RubyBasicObject self, Object includeAncestors) {
if (booleanCastNode == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
booleanCastNode = insert(BooleanCastNodeGen.create(getContext(), getSourceSection(), null));
@@ -1232,12 +1232,12 @@ public PublicMethodsNode(RubyContext context, SourceSection sourceSection) {
}

@Specialization
public RubyArray publicMethods(VirtualFrame frame, Object self, NotProvided includeAncestors) {
public RubyBasicObject publicMethods(VirtualFrame frame, Object self, NotProvided includeAncestors) {
return publicMethods(frame, self, true);
}

@Specialization
public RubyArray publicMethods(VirtualFrame frame, Object self, boolean includeAncestors) {
public RubyBasicObject publicMethods(VirtualFrame frame, Object self, boolean includeAncestors) {
RubyClass metaClass = metaClassNode.executeMetaClass(frame, self);

CompilerDirectives.transferToInterpreter();
@@ -1246,7 +1246,7 @@ public RubyArray publicMethods(VirtualFrame frame, Object self, boolean includeA
}

@Specialization
public RubyArray publicMethods(VirtualFrame frame, RubyBasicObject self, Object includeAncestors) {
public RubyBasicObject publicMethods(VirtualFrame frame, RubyBasicObject self, Object includeAncestors) {
if (booleanCastNode == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
booleanCastNode = insert(BooleanCastNodeGen.create(getContext(), getSourceSection(), null));
@@ -1529,15 +1529,15 @@ public SingletonMethodsNode(RubyContext context, SourceSection sourceSection) {
this.metaClassNode = MetaClassNodeGen.create(context, sourceSection, null);
}

public abstract RubyArray executeSingletonMethods(VirtualFrame frame, Object self, boolean includeAncestors);
public abstract RubyBasicObject executeSingletonMethods(VirtualFrame frame, Object self, boolean includeAncestors);

@Specialization
public RubyArray singletonMethods(VirtualFrame frame, Object self, NotProvided includeAncestors) {
public RubyBasicObject singletonMethods(VirtualFrame frame, Object self, NotProvided includeAncestors) {
return singletonMethods(frame, self, true);
}

@Specialization
public RubyArray singletonMethods(VirtualFrame frame, Object self, boolean includeAncestors) {
public RubyBasicObject singletonMethods(VirtualFrame frame, Object self, boolean includeAncestors) {
RubyClass metaClass = metaClassNode.executeMetaClass(frame, self);

if (!metaClass.isSingleton()) {
@@ -1550,7 +1550,7 @@ public RubyArray singletonMethods(VirtualFrame frame, Object self, boolean inclu
}

@Specialization
public RubyArray singletonMethods(VirtualFrame frame, Object self, Object includeAncestors) {
public RubyBasicObject singletonMethods(VirtualFrame frame, Object self, Object includeAncestors) {
if (booleanCastNode == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
booleanCastNode = insert(BooleanCastNodeGen.create(getContext(), getSourceSection(), null));
Original file line number Diff line number Diff line change
@@ -157,7 +157,7 @@ public CapturesNode(RubyContext context, SourceSection sourceSection) {
}

@Specialization
public RubyArray toA(RubyMatchData matchData) {
public RubyBasicObject toA(RubyMatchData matchData) {
CompilerDirectives.transferToInterpreter();

return ArrayNodes.fromObjects(getContext().getCoreLibrary().getArrayClass(), matchData.getCaptures());
@@ -239,7 +239,7 @@ public ToANode(RubyContext context, SourceSection sourceSection) {
}

@Specialization
public RubyArray toA(RubyMatchData matchData) {
public RubyBasicObject toA(RubyMatchData matchData) {
CompilerDirectives.transferToInterpreter();

return ArrayNodes.fromObjects(getContext().getCoreLibrary().getArrayClass(), matchData.getValues());
@@ -270,7 +270,7 @@ public ValuesAtNode(RubyContext context, SourceSection sourceSection) {
}

@Specialization
public RubyArray valuesAt(RubyMatchData matchData, Object[] args) {
public RubyBasicObject valuesAt(RubyMatchData matchData, Object[] args) {
CompilerDirectives.transferToInterpreter();

final int[] indicies = new int[args.length];
28 changes: 14 additions & 14 deletions truffle/src/main/java/org/jruby/truffle/nodes/core/ModuleNodes.java
Original file line number Diff line number Diff line change
@@ -322,7 +322,7 @@ public AncestorsNode(RubyContext context, SourceSection sourceSection) {
}

@Specialization
public RubyArray ancestors(RubyModule self) {
public RubyBasicObject ancestors(RubyModule self) {
CompilerDirectives.transferToInterpreter();

final List<RubyModule> ancestors = new ArrayList<>();
@@ -769,12 +769,12 @@ private boolean booleanCast(VirtualFrame frame, Object value) {
}

@Specialization
public RubyArray constants(RubyModule module, NotProvided inherit) {
public RubyBasicObject constants(RubyModule module, NotProvided inherit) {
return constants(module, true);
}

@Specialization
public RubyArray constants(RubyModule module, boolean inherit) {
public RubyBasicObject constants(RubyModule module, boolean inherit) {
CompilerDirectives.transferToInterpreter();

final List<RubySymbol> constantsArray = new ArrayList<>();
@@ -796,7 +796,7 @@ public RubyArray constants(RubyModule module, boolean inherit) {
}

@Specialization(guards = "wasProvided(inherit)")
public RubyArray constants(VirtualFrame frame, RubyModule module, Object inherit) {
public RubyBasicObject constants(VirtualFrame frame, RubyModule module, Object inherit) {
return constants(module, booleanCast(frame, inherit));
}

@@ -1163,7 +1163,7 @@ public IncludedModulesNode(RubyContext context, SourceSection sourceSection) {
}

@Specialization
RubyArray includedModules(RubyModule module) {
public RubyBasicObject includedModules(RubyModule module) {
CompilerDirectives.transferToInterpreter();

final List<RubyModule> modules = new ArrayList<>();
@@ -1264,7 +1264,7 @@ public NestingNode(RubyContext context, SourceSection sourceSection) {
}

@Specialization
public RubyArray nesting(VirtualFrame frame) {
public RubyBasicObject nesting(VirtualFrame frame) {
CompilerDirectives.transferToInterpreter();

final List<RubyModule> modules = new ArrayList<>();
@@ -1405,12 +1405,12 @@ public ProtectedInstanceMethodsNode(RubyContext context, SourceSection sourceSec
}

@Specialization
public RubyArray protectedInstanceMethods(RubyModule module, NotProvided includeAncestors) {
public RubyBasicObject protectedInstanceMethods(RubyModule module, NotProvided includeAncestors) {
return protectedInstanceMethods(module, true);
}

@Specialization
public RubyArray protectedInstanceMethods(RubyModule module, boolean includeAncestors) {
public RubyBasicObject protectedInstanceMethods(RubyModule module, boolean includeAncestors) {
CompilerDirectives.transferToInterpreter();


@@ -1453,12 +1453,12 @@ public PrivateInstanceMethodsNode(RubyContext context, SourceSection sourceSecti
}

@Specialization
public RubyArray privateInstanceMethods(RubyModule module, NotProvided includeAncestors) {
public RubyBasicObject privateInstanceMethods(RubyModule module, NotProvided includeAncestors) {
return privateInstanceMethods(module, true);
}

@Specialization
public RubyArray privateInstanceMethods(RubyModule module, boolean includeAncestors) {
public RubyBasicObject privateInstanceMethods(RubyModule module, boolean includeAncestors) {
CompilerDirectives.transferToInterpreter();

return ArrayNodes.fromObjects(getContext().getCoreLibrary().getArrayClass(),
@@ -1510,12 +1510,12 @@ public PublicInstanceMethodsNode(RubyContext context, SourceSection sourceSectio
}

@Specialization
public RubyArray publicInstanceMethods(RubyModule module, NotProvided includeAncestors) {
public RubyBasicObject publicInstanceMethods(RubyModule module, NotProvided includeAncestors) {
return publicInstanceMethods(module, true);
}

@Specialization
public RubyArray publicInstanceMethods(RubyModule module, boolean includeAncestors) {
public RubyBasicObject publicInstanceMethods(RubyModule module, boolean includeAncestors) {
CompilerDirectives.transferToInterpreter();

return ArrayNodes.fromObjects(getContext().getCoreLibrary().getArrayClass(),
@@ -1557,12 +1557,12 @@ public InstanceMethodsNode(RubyContext context, SourceSection sourceSection) {
}

@Specialization
public RubyArray instanceMethods(RubyModule module, NotProvided argument) {
public RubyBasicObject instanceMethods(RubyModule module, NotProvided argument) {
return instanceMethods(module, true);
}

@Specialization
public RubyArray instanceMethods(RubyModule module, boolean includeAncestors) {
public RubyBasicObject instanceMethods(RubyModule module, boolean includeAncestors) {
CompilerDirectives.transferToInterpreter();

return ArrayNodes.fromObjects(getContext().getCoreLibrary().getArrayClass(),
Original file line number Diff line number Diff line change
@@ -135,7 +135,7 @@ public DefineFinalizerNode(RubyContext context, SourceSection sourceSection) {

@TruffleBoundary
@Specialization
public RubyArray defineFinalizer(Object object, RubyProc finalizer) {
public RubyBasicObject defineFinalizer(Object object, RubyProc finalizer) {
getContext().getObjectSpaceManager().defineFinalizer((RubyBasicObject) object, finalizer);
return ArrayNodes.fromObjects(getContext().getCoreLibrary().getArrayClass(), 0, finalizer);
}
Original file line number Diff line number Diff line change
@@ -1791,7 +1791,7 @@ public ScanNode(RubyContext context, SourceSection sourceSection) {
}

@Specialization
public RubyArray scan(RubyString string, RubyString regexpString, NotProvided block) {
public RubyBasicObject scan(RubyString string, RubyString regexpString, NotProvided block) {
final RubyRegexp regexp = new RubyRegexp(this, getContext().getCoreLibrary().getRegexpClass(), getByteList(regexpString), Option.DEFAULT);
return scan(string, regexp, block);
}
@@ -1803,7 +1803,7 @@ public RubyString scan(VirtualFrame frame, RubyString string, RubyString regexpS
}

@Specialization
public RubyArray scan(RubyString string, RubyRegexp regexp, NotProvided block) {
public RubyBasicObject scan(RubyString string, RubyRegexp regexp, NotProvided block) {
return ArrayNodes.fromObjects(getContext().getCoreLibrary().getArrayClass(), (Object[]) regexp.scan(string));
}

@@ -2339,7 +2339,7 @@ public UnpackNode(RubyContext context, SourceSection sourceSection) {

@TruffleBoundary
@Specialization
public RubyArray unpack(RubyString string, RubyString format) {
public RubyBasicObject unpack(RubyString string, RubyString format) {
final org.jruby.RubyArray jrubyArray = Pack.unpack(getContext().getRuntime(), getByteList(string), getByteList(format));
return getContext().toTruffle(jrubyArray);
}
Original file line number Diff line number Diff line change
@@ -18,6 +18,7 @@
import org.jruby.truffle.nodes.RubyNode;
import org.jruby.truffle.runtime.RubyContext;
import org.jruby.truffle.runtime.core.RubyArray;
import org.jruby.truffle.runtime.core.RubyBasicObject;

import java.util.Arrays;

@@ -45,7 +46,7 @@ protected RubyArray makeGeneric(VirtualFrame frame, Object[] alreadyExecuted) {
}
}

return ArrayNodes.fromObjects(getContext().getCoreLibrary().getArrayClass(), executedValues);
return (RubyArray) ArrayNodes.fromObjects(getContext().getCoreLibrary().getArrayClass(), executedValues);
}

@Override
@@ -236,7 +237,7 @@ public RubyArray executeRubyArray(VirtualFrame frame) {
executedValues[n] = values[n].execute(frame);
}

final RubyArray array = ArrayNodes.fromObjects(getContext().getCoreLibrary().getArrayClass(), executedValues);
final RubyBasicObject array = ArrayNodes.fromObjects(getContext().getCoreLibrary().getArrayClass(), executedValues);
final Object store = ArrayNodes.getStore(array);

if (store == null) {
@@ -251,7 +252,7 @@ public RubyArray executeRubyArray(VirtualFrame frame) {
replace(new ObjectArrayLiteralNode(getContext(), getSourceSection(), values));
}

return array;
return (RubyArray) array;
}

}
Original file line number Diff line number Diff line change
@@ -23,6 +23,7 @@
import com.oracle.truffle.api.utilities.BranchProfile;
import org.jcodings.specific.USASCIIEncoding;
import org.jcodings.specific.UTF8Encoding;
import org.jruby.truffle.nodes.RubyGuards;
import org.jruby.truffle.nodes.RubyNode;
import org.jruby.truffle.nodes.RubyRootNode;
import org.jruby.truffle.nodes.arguments.MissingArgumentBehaviour;
@@ -76,11 +77,40 @@ public static class ArrayType extends BasicObjectType {
ARRAY_FACTORY = shape.createFactory();
}

public static Object getStore(RubyBasicObject array) {
assert RubyGuards.isRubyArray(array);
return ((RubyArray) array).store;
}

public static void setStore(RubyBasicObject array, Object store, int size) {
assert RubyGuards.isRubyArray(array);
assert verifyStore(store, size);

if (RANDOMIZE_STORAGE_ARRAY) {
store = randomizeStorageStrategy(array.getContext(), store, size);
assert verifyStore(store, size);
}

((RubyArray) array).store = store;
((RubyArray) array).size = size;
}

public static void setSize(RubyBasicObject array, int size) {
assert RubyGuards.isRubyArray(array);
assert verifyStore(((RubyArray) array).store, size);
((RubyArray) array).size = size;
}

public static int getSize(RubyBasicObject array) {
assert RubyGuards.isRubyArray(array);
return ((RubyArray) array).size;
}

public static final int ARRAYS_SMALL = Options.TRUFFLE_ARRAYS_SMALL.load();
public static final boolean RANDOMIZE_STORAGE_ARRAY = Options.TRUFFLE_RANDOMIZE_STORAGE_ARRAY.load();
private static final Random random = new Random(Options.TRUFFLE_RANDOMIZE_SEED.load());

public static RubyArray fromObject(RubyClass arrayClass, Object object) {
public static RubyBasicObject fromObject(RubyClass arrayClass, Object object) {
final Object store;

if (object instanceof Integer) {
@@ -96,7 +126,7 @@ public static RubyArray fromObject(RubyClass arrayClass, Object object) {
return createGeneralArray(arrayClass, store, 1);
}

public static RubyArray fromObjects(RubyClass arrayClass, Object... objects) {
public static RubyBasicObject fromObjects(RubyClass arrayClass, Object... objects) {
return createGeneralArray(arrayClass, storeFromObjects(arrayClass.getContext(), objects), objects.length);
}

@@ -244,54 +274,34 @@ public static Object randomizeStorageStrategy(RubyContext context, Object store,
}
}

public static Object[] slowToArray(RubyArray array) {
return ArrayUtils.boxUntil(array.store, array.size);
public static Object[] slowToArray(RubyBasicObject array) {
assert RubyGuards.isRubyArray(array);
return ArrayUtils.boxUntil(((RubyArray) array).store, ((RubyArray) array).size);
}

public static void slowUnshift(RubyArray array, Object... values) {
final Object[] newStore = new Object[array.size + values.length];
public static void slowUnshift(RubyBasicObject array, Object... values) {
assert RubyGuards.isRubyArray(array);
final Object[] newStore = new Object[((RubyArray) array).size + values.length];
System.arraycopy(values, 0, newStore, 0, values.length);
ArrayUtils.copy(array.store, newStore, values.length, array.size);
ArrayUtils.copy(((RubyArray) array).store, newStore, values.length, ((RubyArray) array).size);
setStore(array, newStore, newStore.length);
}

public static void slowPush(RubyArray array, Object value) {
array.store = Arrays.copyOf(ArrayUtils.box(array.store), array.size + 1);
((Object[]) array.store)[array.size] = value;
array.size++;
}

public static int normalizeIndex(RubyArray array, int index) {
return normalizeIndex(array.size, index);
}

public static int clampExclusiveIndex(RubyArray array, int index) {
return clampExclusiveIndex(array.size, index);
}

public static Object getStore(RubyArray array) {
return array.store;
}

public static void setStore(RubyArray array, Object store, int size) {
assert verifyStore(store, size);

if (RANDOMIZE_STORAGE_ARRAY) {
store = randomizeStorageStrategy(array.getContext(), store, size);
assert verifyStore(store, size);
}

array.store = store;
array.size = size;
public static void slowPush(RubyBasicObject array, Object value) {
assert RubyGuards.isRubyArray(array);
((RubyArray) array).store = Arrays.copyOf(ArrayUtils.box(((RubyArray) array).store), ((RubyArray) array).size + 1);
((Object[]) ((RubyArray) array).store)[((RubyArray) array).size] = value;
((RubyArray) array).size++;
}

public static void setSize(RubyArray array, int size) {
assert verifyStore(array.store, size);
array.size = size;
public static int normalizeIndex(RubyBasicObject array, int index) {
assert RubyGuards.isRubyArray(array);
return normalizeIndex(getSize(array), index);
}

public static int getSize(RubyArray array) {
return array.size;
public static int clampExclusiveIndex(RubyBasicObject array, int index) {
assert RubyGuards.isRubyArray(array);
return clampExclusiveIndex(getSize(array), index);
}

private static boolean verifyStore(Object store, int size) {
@@ -657,7 +667,7 @@ public Object fallbackSlice(VirtualFrame frame, RubyArray array, Object a, Objec
return fallback(frame, array, fromObjects(getContext().getCoreLibrary().getArrayClass(), a, b));
}

public Object fallback(VirtualFrame frame, RubyArray array, RubyArray args) {
public Object fallback(VirtualFrame frame, RubyBasicObject array, RubyBasicObject args) {
if (fallbackNode == null) {
CompilerDirectives.transferToInterpreter();
fallbackNode = insert(DispatchHeadNodeFactory.createMethodCall(getContext()));
Original file line number Diff line number Diff line change
@@ -1187,7 +1187,7 @@ public Object shiftEmptyDefaultProc(RubyBasicObject hash) {
}

@Specialization(guards = {"!isEmptyHash(hash)", "isPackedHash(hash)"})
public RubyArray shiftPackedArray(RubyBasicObject hash) {
public RubyBasicObject shiftPackedArray(RubyBasicObject hash) {
assert HashOperations.verifyStore(hash);

final Object[] store = (Object[]) getStore(hash);
@@ -1205,7 +1205,7 @@ public RubyArray shiftPackedArray(RubyBasicObject hash) {
}

@Specialization(guards = {"!isEmptyHash(hash)", "isBucketHash(hash)"})
public RubyArray shiftBuckets(RubyBasicObject hash) {
public RubyBasicObject shiftBuckets(RubyBasicObject hash) {
assert HashOperations.verifyStore(hash);

final Entry first = getFirstInSequence(hash);
Original file line number Diff line number Diff line change
@@ -122,7 +122,7 @@ public StringAwkSplitPrimitiveNode(RubyContext context, SourceSection sourceSect

@TruffleBoundary
@Specialization
public RubyArray stringAwkSplit(RubyString string, int lim) {
public RubyBasicObject stringAwkSplit(RubyString string, int lim) {
final List<RubyString> ret = new ArrayList<>();
final ByteList value = StringNodes.getByteList(string);
final boolean limit = lim > 0;
Original file line number Diff line number Diff line change
@@ -490,8 +490,8 @@ public VMGetConfigSectionPrimitiveNode(RubyContext context, SourceSection source

@TruffleBoundary
@Specialization
public RubyArray getSection(RubyString section) {
final List<RubyArray> sectionKeyValues = new ArrayList<>();
public RubyBasicObject getSection(RubyString section) {
final List<RubyBasicObject> sectionKeyValues = new ArrayList<>();

for (String key : getContext().getRubiniusConfiguration().getSection(section.toString())) {
Object value = getContext().getRubiniusConfiguration().get(key);
Original file line number Diff line number Diff line change
@@ -486,7 +486,7 @@ public Object toTruffle(IRubyObject object) {
}
}

public RubyArray toTruffle(org.jruby.RubyArray array) {
public RubyBasicObject toTruffle(org.jruby.RubyArray array) {
final Object[] store = new Object[array.size()];

for (int n = 0; n < store.length; n++) {
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@ public void setBacktrace(Backtrace backtrace) {
this.backtrace = backtrace;
}

public RubyArray asRubyStringArray() {
public RubyBasicObject asRubyStringArray() {
assert backtrace != null;
final String[] lines = Backtrace.EXCEPTION_FORMATTER.format(getContext(), this, backtrace);

0 comments on commit 4459d12

Please sign in to comment.