Skip to content

Commit 5f393e0

Browse files
committed
Rename Transition#hasConstantLocation() to #isWeak() for clarity
1 parent 782b28c commit 5f393e0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

truffle/src/com.oracle.truffle.api.object/src/com/oracle/truffle/api/object/ShapeImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ private static Object newTransitionMap(Transition firstTransition, ShapeImpl fir
384384
}
385385

386386
private static ShapeImpl addToTransitionMap(Transition transition, ShapeImpl successor, TransitionMap<Transition, ShapeImpl> map) {
387-
if (transition.hasConstantLocation()) {
387+
if (transition.isWeak()) {
388388
return map.putWeakKeyIfAbsent(transition, successor);
389389
} else {
390390
return map.putIfAbsent(transition, successor);
@@ -416,7 +416,7 @@ private static boolean isTransitionMap(Object trans) {
416416
private static Object newSingleEntry(Transition transition, ShapeImpl successor) {
417417
transitionSingleEntriesCreated.inc();
418418
Object key = transition;
419-
if (transition.hasConstantLocation()) {
419+
if (transition.isWeak()) {
420420
key = new WeakKey<>(transition);
421421
}
422422
return new StrongKeyWeakValueEntry<>(key, successor);

truffle/src/com.oracle.truffle.api.object/src/com/oracle/truffle/api/object/Transition.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public boolean equals(Object obj) {
6969

7070
public abstract boolean isDirect();
7171

72-
protected boolean hasConstantLocation() {
72+
protected boolean isWeak() {
7373
return false;
7474
}
7575

@@ -127,7 +127,7 @@ public int getPropertyFlags() {
127127
}
128128

129129
@Override
130-
protected boolean hasConstantLocation() {
130+
protected boolean isWeak() {
131131
return getProperty().getLocation().isConstant();
132132
}
133133
}
@@ -296,7 +296,7 @@ public String toString() {
296296
}
297297

298298
@Override
299-
protected boolean hasConstantLocation() {
299+
protected boolean isWeak() {
300300
return getPropertyBefore().getLocation().isConstant() || getPropertyAfter().getLocation().isConstant();
301301
}
302302
}

0 commit comments

Comments
 (0)