handle volatile fields properly in JNI Get/Set methods

This commit ensures that we use the proper memory barriers or locking
necessary to preserve volatile semantics for such fields when accessed
or updated via JNI.
This commit is contained in:
Joel Dice 2011-03-15 19:34:00 -06:00
parent 453ceb42ab
commit 7152c3fdb3
4 changed files with 714 additions and 110 deletions

View File

@ -15,7 +15,7 @@ public class VMField {
public byte code;
public short flags;
public short offset;
public short index;
public int nativeID;
public byte[] name;
public byte[] spec;
public FieldAddendum addendum;

File diff suppressed because it is too large Load Diff

View File

@ -1075,7 +1075,7 @@ parseFieldTable(Thread* t, Stream& s, object class_, object pool)
code,
flags,
0, // offset
i,
0, // native ID
singletonObject(t, pool, name - 1),
singletonObject(t, pool, spec - 1),
addendum,
@ -2388,6 +2388,7 @@ Thread::init()
setRoot(this, Machine::ClassRuntimeDataTable, makeVector(this, 0, 0));
setRoot(this, Machine::MethodRuntimeDataTable, makeVector(this, 0, 0));
setRoot(this, Machine::JNIMethodTable, makeVector(this, 0, 0));
setRoot(this, Machine::JNIFieldTable, makeVector(this, 0, 0));
m->localThread->set(this);

View File

@ -1256,6 +1256,7 @@ class Machine {
ClassRuntimeDataTable,
MethodRuntimeDataTable,
JNIMethodTable,
JNIFieldTable,
ShutdownHooks,
FinalizerThread,
ObjectsToFinalize,