mirror of
https://github.com/corda/corda.git
synced 2025-01-06 05:04:20 +00:00
fix putstatic code order regression in compile.cpp
Also, ensure that class is initialized before getting or setting static fields in lazy loading code.
This commit is contained in:
parent
44020482e5
commit
110e2e1d52
@ -2922,6 +2922,8 @@ getStaticFieldValueFromReference(MyThread* t, object pair)
|
|||||||
object field = resolveField(t, pair);
|
object field = resolveField(t, pair);
|
||||||
PROTECT(t, field);
|
PROTECT(t, field);
|
||||||
|
|
||||||
|
initClass(t, fieldClass(t, field));
|
||||||
|
|
||||||
ACQUIRE_FIELD_FOR_READ(t, field);
|
ACQUIRE_FIELD_FOR_READ(t, field);
|
||||||
|
|
||||||
return getFieldValue(t, classStaticTable(t, fieldClass(t, field)), field);
|
return getFieldValue(t, classStaticTable(t, fieldClass(t, field)), field);
|
||||||
@ -2946,6 +2948,8 @@ setStaticLongFieldValueFromReference(MyThread* t, object pair, uint64_t value)
|
|||||||
object field = resolveField(t, pair);
|
object field = resolveField(t, pair);
|
||||||
PROTECT(t, field);
|
PROTECT(t, field);
|
||||||
|
|
||||||
|
initClass(t, fieldClass(t, field));
|
||||||
|
|
||||||
ACQUIRE_FIELD_FOR_WRITE(t, field);
|
ACQUIRE_FIELD_FOR_WRITE(t, field);
|
||||||
|
|
||||||
cast<int64_t>
|
cast<int64_t>
|
||||||
@ -2974,6 +2978,8 @@ setStaticObjectFieldValueFromReference(MyThread* t, object pair, object value)
|
|||||||
object field = resolveField(t, pair);
|
object field = resolveField(t, pair);
|
||||||
PROTECT(t, field);
|
PROTECT(t, field);
|
||||||
|
|
||||||
|
initClass(t, fieldClass(t, field));
|
||||||
|
|
||||||
ACQUIRE_FIELD_FOR_WRITE(t, field);
|
ACQUIRE_FIELD_FOR_WRITE(t, field);
|
||||||
|
|
||||||
set(t, classStaticTable(t, fieldClass(t, field)), fieldOffset(t, field),
|
set(t, classStaticTable(t, fieldClass(t, field)), fieldOffset(t, field),
|
||||||
@ -3025,6 +3031,8 @@ setStaticFieldValueFromReference(MyThread* t, object pair, uint32_t value)
|
|||||||
object field = resolveField(t, pair);
|
object field = resolveField(t, pair);
|
||||||
PROTECT(t, field);
|
PROTECT(t, field);
|
||||||
|
|
||||||
|
initClass(t, fieldClass(t, field));
|
||||||
|
|
||||||
ACQUIRE_FIELD_FOR_WRITE(t, field);
|
ACQUIRE_FIELD_FOR_WRITE(t, field);
|
||||||
|
|
||||||
setFieldValue(t, classStaticTable(t, fieldClass(t, field)), field, value);
|
setFieldValue(t, classStaticTable(t, fieldClass(t, field)), field, value);
|
||||||
@ -5452,7 +5460,6 @@ compile(MyThread* t, Frame* initialFrame, unsigned ip,
|
|||||||
|
|
||||||
if (LIKELY(field)) {
|
if (LIKELY(field)) {
|
||||||
int fieldCode = vm::fieldCode(t, field);
|
int fieldCode = vm::fieldCode(t, field);
|
||||||
Compiler::Operand* value = popField(t, frame, fieldCode);
|
|
||||||
|
|
||||||
object staticTable = 0;
|
object staticTable = 0;
|
||||||
|
|
||||||
@ -5485,6 +5492,8 @@ compile(MyThread* t, Frame* initialFrame, unsigned ip,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Compiler::Operand* value = popField(t, frame, fieldCode);
|
||||||
|
|
||||||
Compiler::Operand* table;
|
Compiler::Operand* table;
|
||||||
|
|
||||||
if (instruction == putstatic) {
|
if (instruction == putstatic) {
|
||||||
@ -7828,7 +7837,7 @@ class ArgumentList {
|
|||||||
default:
|
default:
|
||||||
addInt(cast<int32_t>(objectArrayBody(t, arguments, index++),
|
addInt(cast<int32_t>(objectArrayBody(t, arguments, index++),
|
||||||
BytesPerWord));
|
BytesPerWord));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user