Skip to content

Commit 6d3cc40

Browse files
committed
Fix style
1 parent fd06e7c commit 6d3cc40

File tree

3 files changed

+25
-30
lines changed

3 files changed

+25
-30
lines changed

graalpython/com.oracle.graal.python.test/src/com/oracle/graal/python/test/objects/ObjectHashMapTests.java

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,18 @@
5555
import java.util.stream.Collectors;
5656
import java.util.stream.StreamSupport;
5757

58-
import com.oracle.truffle.api.profiles.BranchProfile;
59-
import com.oracle.truffle.api.profiles.ConditionProfile;
6058
import org.junit.Assert;
6159
import org.junit.Test;
6260

6361
import com.oracle.graal.python.builtins.objects.common.HashingStorageLibrary.ForEachNode;
6462
import com.oracle.graal.python.builtins.objects.common.ObjectHashMap;
65-
import com.oracle.graal.python.builtins.objects.common.ObjectHashMap.GetProfiles;
6663
import com.oracle.graal.python.builtins.objects.common.ObjectHashMap.MapCursor;
67-
import com.oracle.graal.python.builtins.objects.common.ObjectHashMap.PutProfiles;
68-
import com.oracle.graal.python.builtins.objects.common.ObjectHashMap.RemoveProfiles;
6964
import com.oracle.graal.python.lib.PyObjectHashNode;
7065
import com.oracle.graal.python.lib.PyObjectRichCompareBool;
7166
import com.oracle.truffle.api.frame.Frame;
7267
import com.oracle.truffle.api.interop.TruffleObject;
68+
import com.oracle.truffle.api.profiles.BranchProfile;
69+
import com.oracle.truffle.api.profiles.ConditionProfile;
7370
import com.oracle.truffle.api.profiles.LoopConditionProfile;
7471

7572
public class ObjectHashMapTests {
@@ -315,25 +312,25 @@ public static Object newValue() {
315312
private static long getKeyHash(Object key) {
316313
return key instanceof Long ? PyObjectHashNode.hash((Long) key) : ((DictKey) key).hash;
317314
}
318-
315+
319316
private static Object get(ObjectHashMap map, Object key, long hash) {
320-
return ObjectHashMap.GetNode.doGet(null, map, key, hash,//
321-
ConditionProfile.getUncached(), ConditionProfile.getUncached(), ConditionProfile.getUncached(),//
322-
ConditionProfile.getUncached(), ConditionProfile.getUncached(), ConditionProfile.getUncached(),//
323-
new EqNodeStub());
317+
return ObjectHashMap.GetNode.doGet(null, map, key, hash,
318+
ConditionProfile.getUncached(), ConditionProfile.getUncached(), ConditionProfile.getUncached(),
319+
ConditionProfile.getUncached(), ConditionProfile.getUncached(), ConditionProfile.getUncached(),
320+
new EqNodeStub());
324321
}
325322

326323
private static void remove(ObjectHashMap map, Object key, long hash) {
327-
ObjectHashMap.RemoveNode.doRemove(null, map, key, hash,//
328-
ConditionProfile.getUncached(), ConditionProfile.getUncached(), ConditionProfile.getUncached(),//
329-
ConditionProfile.getUncached(), BranchProfile.getUncached(), ConditionProfile.getUncached(),//
330-
new EqNodeStub());
324+
ObjectHashMap.RemoveNode.doRemove(null, map, key, hash,
325+
ConditionProfile.getUncached(), ConditionProfile.getUncached(), ConditionProfile.getUncached(),
326+
ConditionProfile.getUncached(), BranchProfile.getUncached(), ConditionProfile.getUncached(),
327+
new EqNodeStub());
331328
}
332329

333330
private static void put(ObjectHashMap map, Object key, long hash, Object value) {
334-
ObjectHashMap.PutNode.doPut(null, map, key, hash, value,//
335-
ConditionProfile.getUncached(), ConditionProfile.getUncached(), ConditionProfile.getUncached(),//
336-
ConditionProfile.getUncached(), BranchProfile.getUncached(), BranchProfile.getUncached(),//
337-
ConditionProfile.getUncached(), new EqNodeStub());
331+
ObjectHashMap.PutNode.doPut(null, map, key, hash, value,
332+
ConditionProfile.getUncached(), ConditionProfile.getUncached(), ConditionProfile.getUncached(),
333+
ConditionProfile.getUncached(), BranchProfile.getUncached(), BranchProfile.getUncached(),
334+
ConditionProfile.getUncached(), new EqNodeStub());
338335
}
339336
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/common/HashingCollectionNodes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ abstract static class SetValueHashingStorageNode extends PNodeWithContext {
122122

123123
@Specialization
124124
HashingStorage doEconomicStorage(VirtualFrame frame, EconomicMapStorage map, Object value,
125-
@Cached ObjectHashMap.PutNode putNode,
125+
@Cached ObjectHashMap.PutNode putNode,
126126
@Cached ConditionProfile hasFrameProfile,
127127
@Cached LoopConditionProfile loopProfile) {
128128
// We want to avoid calling __hash__() during map.put

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/common/ObjectHashMap.java

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,11 @@
5151
import com.oracle.graal.python.builtins.objects.function.PArguments.ThreadState;
5252
import com.oracle.graal.python.lib.PyObjectRichCompareBool;
5353
import com.oracle.graal.python.util.PythonUtils;
54-
import com.oracle.truffle.api.CompilerAsserts;
5554
import com.oracle.truffle.api.CompilerDirectives;
5655
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
5756
import com.oracle.truffle.api.dsl.Cached;
5857
import com.oracle.truffle.api.dsl.GenerateUncached;
5958
import com.oracle.truffle.api.dsl.Specialization;
60-
import com.oracle.truffle.api.frame.Frame;
6159
import com.oracle.truffle.api.frame.VirtualFrame;
6260
import com.oracle.truffle.api.nodes.LoopNode;
6361
import com.oracle.truffle.api.nodes.Node;
@@ -702,7 +700,6 @@ private boolean needsCompaction() {
702700
return dummyCnt > quarterOfUsable;
703701
}
704702

705-
706703
@GenerateUncached
707704
public abstract static class RemoveNode extends Node {
708705
public final void remove(ThreadState state, ObjectHashMap map, DictKey key) {
@@ -718,19 +715,20 @@ public final void remove(ThreadState state, ObjectHashMap map, Object key, long
718715
// "public" for testing...
719716
@Specialization
720717
public static void doRemove(ThreadState state, ObjectHashMap map, Object key, long keyHash,
721-
@Cached("createCountingProfile()") ConditionProfile foundNullKey,
722-
@Cached("createCountingProfile()") ConditionProfile foundEqKey,
723-
@Cached("createCountingProfile()") ConditionProfile collisionFoundNoValue,
724-
@Cached("createCountingProfile()") ConditionProfile collisionFoundEqKey,
725-
@Cached BranchProfile compactProfile,
726-
@Cached ConditionProfile hasState,
727-
@Cached PyObjectRichCompareBool.EqNode eqNode) {
718+
@Cached("createCountingProfile()") ConditionProfile foundNullKey,
719+
@Cached("createCountingProfile()") ConditionProfile foundEqKey,
720+
@Cached("createCountingProfile()") ConditionProfile collisionFoundNoValue,
721+
@Cached("createCountingProfile()") ConditionProfile collisionFoundEqKey,
722+
@Cached BranchProfile compactProfile,
723+
@Cached ConditionProfile hasState,
724+
@Cached PyObjectRichCompareBool.EqNode eqNode) {
728725
assert map.checkInternalState();
729726
if (CompilerDirectives.injectBranchProbability(SLOWPATH_PROBABILITY, map.needsCompaction())) {
730727
compactProfile.enter();
731728
map.compact();
732729
}
733-
// Note: CPython is not shrinking the capacity of the hash table on delete, we do the same
730+
// Note: CPython is not shrinking the capacity of the hash table on delete, we do the
731+
// same
734732
int compactIndex = map.getIndex(keyHash);
735733
int index = map.indices[compactIndex];
736734
if (foundNullKey.profile(index == EMPTY_INDEX)) {

0 commit comments

Comments
 (0)