Skip to content

Commit 569ae85

Browse files
[GR-55551] Espresso code cleanups
PullRequest: graal/18328
2 parents 3ed2890 + a3eb901 commit 569ae85

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

espresso/src/com.oracle.truffle.espresso/src/com/oracle/truffle/espresso/classfile/ImmutableConstantPool.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ ImmutableConstantPool patchForHiddenClass(int thisKlassIndex, Symbol<?> newName)
101101
PoolConstant[] newEntries = Arrays.copyOf(constants, constants.length + 1);
102102
newEntries[newNamePos] = newNameConstant;
103103
newEntries[thisKlassIndex] = ClassConstant.create(newNamePos);
104+
// This will get resolved in the ObjectKlass constructor
105+
// See initSelfReferenceInPool
104106

105107
int rawLengthIncrease = 2 /* u2 length */ + newName.length() /* symbol length */;
106108
return new ImmutableConstantPool(newEntries, majorVersion, minorVersion, totalPoolBytes + rawLengthIncrease);

espresso/src/com.oracle.truffle.espresso/src/com/oracle/truffle/espresso/impl/Field.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ private void setObjectHelper(StaticObject obj, Object value, boolean forceVolati
399399
assert getDeclaringKlass().isAssignableFrom(obj.getKlass()) : this + " does not exist in " + obj.getKlass();
400400

401401
if (getDeclaringKlass().getContext().anyHierarchyChanged()) {
402-
checkSetValueValifity(value);
402+
checkSetValueValidity(value);
403403
}
404404
if (isVolatile() || forceVolatile) {
405405
linkedField.setObjectVolatile(obj, value);
@@ -408,7 +408,7 @@ private void setObjectHelper(StaticObject obj, Object value, boolean forceVolati
408408
}
409409
}
410410

411-
protected void checkSetValueValifity(Object value) {
411+
protected void checkSetValueValidity(Object value) {
412412
if (value != StaticObject.NULL && value instanceof StaticObject) {
413413
Klass klass = null;
414414
try {

espresso/src/com.oracle.truffle.espresso/src/com/oracle/truffle/espresso/impl/Method.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1498,10 +1498,6 @@ private void checkPoisonPill(Meta meta) {
14981498
}
14991499
}
15001500

1501-
public int getCodeSize() {
1502-
return getOriginalCode() != null ? getOriginalCode().length : 0;
1503-
}
1504-
15051501
public LineNumberTableAttribute getLineNumberTableAttribute() {
15061502
if (codeAttribute != null) {
15071503
LineNumberTableAttribute lineNumberTable = codeAttribute.getLineNumberTableAttribute();

espresso/src/com.oracle.truffle.espresso/src/com/oracle/truffle/espresso/impl/RedefineAddedField.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public void setObject(StaticObject obj, Object value, boolean forceVolatile) {
163163
getCompatibleField().setObject(obj, value, forceVolatile);
164164
} else {
165165
if (getDeclaringKlass().getContext().anyHierarchyChanged()) {
166-
checkSetValueValifity(value);
166+
checkSetValueValidity(value);
167167
}
168168
FieldStorageObject storageObject = getStorageObject(obj);
169169
if (forceVolatile) {

espresso/src/com.oracle.truffle.espresso/src/com/oracle/truffle/espresso/meta/Meta.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,8 +1054,8 @@ public Meta(EspressoContext context) {
10541054
java_util_regex_IntHashSet = null;
10551055
}
10561056

1057-
java_util_concurrent_locks_abstractOwnableSynchronizer = knownKlass(Type.java_util_concurrent_locks_AbstractOwnableSynchronizer);
1058-
java_util_concurrent_locks_AbstractOwnableSynchronizer_exclusiveOwnerThread = java_util_concurrent_locks_abstractOwnableSynchronizer.requireDeclaredField(Name.exclusiveOwnerThread,
1057+
java_util_concurrent_locks_AbstractOwnableSynchronizer = knownKlass(Type.java_util_concurrent_locks_AbstractOwnableSynchronizer);
1058+
java_util_concurrent_locks_AbstractOwnableSynchronizer_exclusiveOwnerThread = java_util_concurrent_locks_AbstractOwnableSynchronizer.requireDeclaredField(Name.exclusiveOwnerThread,
10591059
Type.java_lang_Thread);
10601060
java_util_concurrent_locks_ReentrantLock_Sync = knownKlass(Type.java_util_concurrent_locks_ReentrantLock_Sync);
10611061
java_util_concurrent_locks_ReentrantReadWriteLock_Sync = knownKlass(Type.java_util_concurrent_locks_ReentrantReadWriteLock_Sync);
@@ -1888,7 +1888,7 @@ private DiffVersionLoadHelper diff() {
18881888
public final Field java_util_regex_Matcher_requireEnd;
18891889
public final Method java_util_regex_Matcher_groupCount;
18901890

1891-
public final ObjectKlass java_util_concurrent_locks_abstractOwnableSynchronizer;
1891+
public final ObjectKlass java_util_concurrent_locks_AbstractOwnableSynchronizer;
18921892
public final Field java_util_concurrent_locks_AbstractOwnableSynchronizer_exclusiveOwnerThread;
18931893
public final ObjectKlass java_util_concurrent_locks_ReentrantLock_Sync;
18941894
public final ObjectKlass java_util_concurrent_locks_ReentrantReadWriteLock_Sync;

0 commit comments

Comments
 (0)