Skip to content

Commit

Permalink
jt test fast passes fully !
Browse files Browse the repository at this point in the history
  • Loading branch information
moste00 committed Sep 12, 2023
1 parent 317dc47 commit e42b62c
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 108 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ protected HashLiteralNode(RubyNode[] keyValues) {
public static HashLiteralNode create(RubyNode[] keyValues) {
if (keyValues.length == 0) {
return new EmptyHashStore.EmptyHashLiteralNode();
} else if (keyValues.length <= PackedHashStoreLibrary.MAX_ENTRIES * 2 && false) {
} else if (keyValues.length <= PackedHashStoreLibrary.MAX_ENTRIES * 2) {
return new PackedHashStoreLibrary.SmallHashLiteralNode(keyValues);
} else {
return bigHashTypeIsCompactHash
Expand Down
29 changes: 16 additions & 13 deletions src/main/java/org/truffleruby/core/hash/RubyHash.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,20 @@

import java.util.Set;

import org.truffleruby.RubyContext;
import org.truffleruby.collections.PEBiFunction;
import org.truffleruby.core.hash.library.BucketsHashStore;
import org.truffleruby.core.hash.library.CompactHashStore;
import org.truffleruby.core.hash.library.HashStoreLibrary;
import org.truffleruby.core.klass.RubyClass;
import org.truffleruby.interop.ForeignToRubyNode;
import org.truffleruby.language.Nil;
import org.truffleruby.language.RubyDynamicObject;
import org.truffleruby.language.dispatch.DispatchNode;
import org.truffleruby.language.library.RubyLibrary;
import org.truffleruby.language.objects.ObjectGraph;
import org.truffleruby.language.objects.ObjectGraphNode;

import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
import com.oracle.truffle.api.dsl.Cached;
import com.oracle.truffle.api.dsl.Cached.Exclusive;
Expand All @@ -24,20 +38,7 @@
import com.oracle.truffle.api.library.ExportLibrary;
import com.oracle.truffle.api.library.ExportMessage;
import com.oracle.truffle.api.object.Shape;

import com.oracle.truffle.api.profiles.ConditionProfile;
import org.truffleruby.RubyContext;
import org.truffleruby.collections.PEBiFunction;
import org.truffleruby.core.hash.library.BucketsHashStore;
import org.truffleruby.core.hash.library.HashStoreLibrary;
import org.truffleruby.core.klass.RubyClass;
import org.truffleruby.interop.ForeignToRubyNode;
import org.truffleruby.language.Nil;
import org.truffleruby.language.RubyDynamicObject;
import org.truffleruby.language.dispatch.DispatchNode;
import org.truffleruby.language.library.RubyLibrary;
import org.truffleruby.language.objects.ObjectGraph;
import org.truffleruby.language.objects.ObjectGraphNode;

@ExportLibrary(InteropLibrary.class)
@ImportStatic(HashGuards.class)
Expand Down Expand Up @@ -84,6 +85,8 @@ public String toString() {
public void getAdjacentObjects(Set<Object> reachable) {
if (store instanceof BucketsHashStore) {
((BucketsHashStore) store).getAdjacentObjects(reachable);
} else if (store instanceof CompactHashStore) {
((CompactHashStore) store).getAdjacentObjects(reachable);
} else {
ObjectGraph.addProperty(reachable, store);
}
Expand Down
Loading

0 comments on commit e42b62c

Please sign in to comment.