Skip to content

Commit

Permalink
Showing 19 changed files with 307 additions and 310 deletions.
7 changes: 3 additions & 4 deletions core/src/main/java/org/jruby/truffle/nodes/RubyNode.java
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@
package org.jruby.truffle.nodes;

import com.oracle.truffle.api.CompilerAsserts;
import com.oracle.truffle.api.dsl.ImportGuards;
import com.oracle.truffle.api.source.SourceSection;
import com.oracle.truffle.api.dsl.TypeSystemReference;
import com.oracle.truffle.api.frame.VirtualFrame;
@@ -24,7 +23,7 @@
import org.jruby.truffle.runtime.core.RubyHash;
import org.jruby.truffle.runtime.core.RubyRange;
import org.jruby.truffle.runtime.core.RubyBasicObject;
import org.jruby.truffle.runtime.hash.BucketSearchResult;
import org.jruby.truffle.runtime.hash.HashSearchResult;
import org.jruby.truffle.runtime.rubinius.RubiniusByteArray;
import org.jruby.truffle.runtime.rubinius.RubiniusChannel;

@@ -192,8 +191,8 @@ public RubyEncodingConverter executeRubyEncodingConverter(VirtualFrame frame) th
return RubyTypesGen.RUBYTYPES.expectRubyEncodingConverter(execute(frame));
}

public BucketSearchResult executeBucketSearchResult(VirtualFrame frame) throws UnexpectedResultException {
return RubyTypesGen.RUBYTYPES.expectBucketSearchResult(execute(frame));
public HashSearchResult executeBucketSearchResult(VirtualFrame frame) throws UnexpectedResultException {

This comment has been minimized.

Copy link
@eregon

eregon Dec 16, 2014

Member

needs a rename here.

return RubyTypesGen.RUBYTYPES.expectHashSearchResult(execute(frame));
}

public Dispatch.DispatchAction executeDispatchAction(VirtualFrame frame) {
5 changes: 2 additions & 3 deletions core/src/main/java/org/jruby/truffle/nodes/RubyTypes.java
Original file line number Diff line number Diff line change
@@ -9,7 +9,6 @@
*/
package org.jruby.truffle.nodes;

import com.oracle.truffle.api.dsl.ImplicitCast;
import com.oracle.truffle.api.dsl.TypeSystem;
import org.jruby.truffle.nodes.dispatch.Dispatch;
import org.jruby.truffle.runtime.UndefinedPlaceholder;
@@ -18,7 +17,7 @@
import org.jruby.truffle.runtime.core.RubyHash;
import org.jruby.truffle.runtime.core.RubyRange;
import org.jruby.truffle.runtime.core.RubyBasicObject;
import org.jruby.truffle.runtime.hash.BucketSearchResult;
import org.jruby.truffle.runtime.hash.HashSearchResult;
import org.jruby.truffle.runtime.rubinius.RubiniusByteArray;
import org.jruby.truffle.runtime.rubinius.RubiniusChannel;
import org.jruby.truffle.runtime.LexicalScope;
@@ -62,7 +61,7 @@
RubiniusByteArray.class, //
RubyEncodingConverter.class, //
RubyBasicObject.class, //
BucketSearchResult.class, //
HashSearchResult.class, //
Object[].class})

public class RubyTypes {
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
package org.jruby.truffle.nodes.core;

import org.jruby.truffle.runtime.core.RubyHash;
import org.jruby.truffle.runtime.hash.Bucket;
import org.jruby.truffle.runtime.hash.Entry;

public class HashGuards {

@@ -20,11 +20,11 @@ public static boolean isNull(RubyHash hash) {

public static boolean isObjectArray(RubyHash hash) {
// Arrays are covariant in Java!
return hash.getStore() instanceof Object[] && !(hash.getStore() instanceof Bucket[]);
return hash.getStore() instanceof Object[] && !(hash.getStore() instanceof Entry[]);
}

public static boolean isBucketArray(RubyHash hash) {
return hash.getStore() instanceof Bucket[];
return hash.getStore() instanceof Entry[];

This comment has been minimized.

Copy link
@eregon

eregon Dec 16, 2014

Member

This looks funny but I guess it makes sense once you know this Entry is actually a chain of Entries, that is a bucket.

}

}
Loading

0 comments on commit 96c8da6

Please sign in to comment.