Skip to content

Commit

Permalink
[Truffle] Rename buckets entries.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisseaton committed Dec 16, 2014
1 parent 35c1350 commit 96c8da6
Show file tree
Hide file tree
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
Expand Up @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -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) {
Expand Down
5 changes: 2 additions & 3 deletions core/src/main/java/org/jruby/truffle/nodes/RubyTypes.java
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -62,7 +61,7 @@
RubiniusByteArray.class, //
RubyEncodingConverter.class, //
RubyBasicObject.class, //
BucketSearchResult.class, //
HashSearchResult.class, //
Object[].class})

public class RubyTypes {
Expand Down
Expand Up @@ -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 {

Expand All @@ -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.

}

}

0 comments on commit 96c8da6

Please sign in to comment.