< prev index next >
src/hotspot/share/prims/jni.cpp
Print this page
*** 3773,3783 ****
void copy_jni_function_table(const struct JNINativeInterface_ *new_jni_NativeInterface) {
assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
intptr_t *a = (intptr_t *) jni_functions();
intptr_t *b = (intptr_t *) new_jni_NativeInterface;
for (uint i=0; i < sizeof(struct JNINativeInterface_)/sizeof(void *); i++) {
! Atomic::store_ptr(*b++, a++);
}
}
void quicken_jni_functions() {
// Replace Get<Primitive>Field with fast versions
--- 3773,3783 ----
void copy_jni_function_table(const struct JNINativeInterface_ *new_jni_NativeInterface) {
assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
intptr_t *a = (intptr_t *) jni_functions();
intptr_t *b = (intptr_t *) new_jni_NativeInterface;
for (uint i=0; i < sizeof(struct JNINativeInterface_)/sizeof(void *); i++) {
! Atomic::store(*b++, a++);
}
}
void quicken_jni_functions() {
// Replace Get<Primitive>Field with fast versions
*** 3896,3908 ****
#if defined(ZERO) && defined(ASSERT)
{
jint a = 0xcafebabe;
jint b = Atomic::xchg(0xdeadbeef, &a);
void *c = &a;
! void *d = Atomic::xchg_ptr(&b, &c);
assert(a == (jint) 0xdeadbeef && b == (jint) 0xcafebabe, "Atomic::xchg() works");
! assert(c == &b && d == &a, "Atomic::xchg_ptr() works");
}
#endif // ZERO && ASSERT
// At the moment it's only possible to have one Java VM,
// since some of the runtime state is in global variables.
--- 3896,3908 ----
#if defined(ZERO) && defined(ASSERT)
{
jint a = 0xcafebabe;
jint b = Atomic::xchg(0xdeadbeef, &a);
void *c = &a;
! void *d = Atomic::xchg(&b, &c);
assert(a == (jint) 0xdeadbeef && b == (jint) 0xcafebabe, "Atomic::xchg() works");
! assert(c == &b && d == &a, "Atomic::xchg() works");
}
#endif // ZERO && ASSERT
// At the moment it's only possible to have one Java VM,
// since some of the runtime state is in global variables.
< prev index next >