< prev index next >

src/hotspot/share/prims/unsafe.cpp

Print this page

        

*** 290,299 **** --- 290,311 ---- UNSAFE_ENTRY(jobject, Unsafe_GetUncompressedObject(JNIEnv *env, jobject unsafe, jlong addr)) { oop v = *(oop*) (address) addr; return JNIHandles::make_local(env, v); } UNSAFE_END + UNSAFE_LEAF(jboolean, Unsafe_isBigEndian0(JNIEnv *env, jobject unsafe)) { + #ifdef VM_LITTLE_ENDIAN + return false; + #else + return true; + #endif + } UNSAFE_END + + UNSAFE_LEAF(jint, Unsafe_unalignedAccess0(JNIEnv *env, jobject unsafe)) { + return UseUnalignedAccesses; + } UNSAFE_END + #define DEFINE_GETSETOOP(java_type, Type) \ \ UNSAFE_ENTRY(java_type, Unsafe_Get##Type(JNIEnv *env, jobject unsafe, jobject obj, jlong offset)) { \ return MemoryAccess<java_type>(thread, obj, offset).get(); \ } UNSAFE_END \
*** 432,441 **** --- 444,461 ---- } } UNSAFE_END ////// Random queries + UNSAFE_LEAF(jint, Unsafe_AddressSize0(JNIEnv *env, jobject unsafe)) { + return sizeof(void*); + } UNSAFE_END + + UNSAFE_LEAF(jint, Unsafe_PageSize()) { + return os::vm_page_size(); + } UNSAFE_END + static jlong find_field_offset(jclass clazz, jstring name, TRAPS) { assert(clazz != NULL, "clazz must not be NULL"); assert(name != NULL, "name must not be NULL"); ResourceMark rm(THREAD);
*** 1051,1060 **** --- 1071,1082 ---- {CC "staticFieldOffset0", CC "(" FLD ")J", FN_PTR(Unsafe_StaticFieldOffset0)}, {CC "staticFieldBase0", CC "(" FLD ")" OBJ, FN_PTR(Unsafe_StaticFieldBase0)}, {CC "ensureClassInitialized0", CC "(" CLS ")V", FN_PTR(Unsafe_EnsureClassInitialized0)}, {CC "arrayBaseOffset0", CC "(" CLS ")I", FN_PTR(Unsafe_ArrayBaseOffset0)}, {CC "arrayIndexScale0", CC "(" CLS ")I", FN_PTR(Unsafe_ArrayIndexScale0)}, + {CC "addressSize0", CC "()I", FN_PTR(Unsafe_AddressSize0)}, + {CC "pageSize", CC "()I", FN_PTR(Unsafe_PageSize)}, {CC "defineClass0", CC "(" DC_Args ")" CLS, FN_PTR(Unsafe_DefineClass0)}, {CC "allocateInstance", CC "(" CLS ")" OBJ, FN_PTR(Unsafe_AllocateInstance)}, {CC "throwException", CC "(" THR ")V", FN_PTR(Unsafe_ThrowException)}, {CC "compareAndSetReference",CC "(" OBJ "J" OBJ "" OBJ ")Z", FN_PTR(Unsafe_CompareAndSetReference)},
*** 1078,1087 **** --- 1100,1112 ---- {CC "shouldBeInitialized0", CC "(" CLS ")Z", FN_PTR(Unsafe_ShouldBeInitialized0)}, {CC "loadFence", CC "()V", FN_PTR(Unsafe_LoadFence)}, {CC "storeFence", CC "()V", FN_PTR(Unsafe_StoreFence)}, {CC "fullFence", CC "()V", FN_PTR(Unsafe_FullFence)}, + + {CC "isBigEndian0", CC "()Z", FN_PTR(Unsafe_isBigEndian0)}, + {CC "unalignedAccess0", CC "()Z", FN_PTR(Unsafe_unalignedAccess0)} }; #undef CC #undef FN_PTR
< prev index next >