42 #include "runtime/handles.inline.hpp" |
42 #include "runtime/handles.inline.hpp" |
43 #include "runtime/interfaceSupport.inline.hpp" |
43 #include "runtime/interfaceSupport.inline.hpp" |
44 #include "runtime/jniHandles.inline.hpp" |
44 #include "runtime/jniHandles.inline.hpp" |
45 #include "runtime/orderAccess.hpp" |
45 #include "runtime/orderAccess.hpp" |
46 #include "runtime/reflection.hpp" |
46 #include "runtime/reflection.hpp" |
|
47 #include "runtime/sharedRuntime.hpp" |
47 #include "runtime/thread.hpp" |
48 #include "runtime/thread.hpp" |
48 #include "runtime/threadSMR.hpp" |
49 #include "runtime/threadSMR.hpp" |
49 #include "runtime/vm_version.hpp" |
50 #include "runtime/vm_version.hpp" |
50 #include "services/threadService.hpp" |
51 #include "services/threadService.hpp" |
51 #include "utilities/align.hpp" |
52 #include "utilities/align.hpp" |
441 GuardUnsafeAccess guard(thread); |
442 GuardUnsafeAccess guard(thread); |
442 Copy::conjoint_swap(src, dst, sz, esz); |
443 Copy::conjoint_swap(src, dst, sz, esz); |
443 } |
444 } |
444 } JVM_END |
445 } JVM_END |
445 } |
446 } |
|
447 } UNSAFE_END |
|
448 |
|
449 UNSAFE_LEAF (void, Unsafe_WriteBack0(JNIEnv *env, jobject unsafe, jlong line)) { |
|
450 assert(VM_Version::supports_data_cache_line_flush(), "should not get here"); |
|
451 #ifdef ASSERT |
|
452 if (TraceMemoryWriteback) { |
|
453 tty->print_cr("Unsafe: writeback 0x%p", addr_from_java(line)); |
|
454 } |
|
455 #endif |
|
456 |
|
457 assert(StubRoutines::data_cache_writeback() != NULL, "sanity"); |
|
458 (StubRoutines::DataCacheWriteback_stub())(addr_from_java(line)); |
|
459 } UNSAFE_END |
|
460 |
|
461 static void doWriteBackSync0(bool is_pre) |
|
462 { |
|
463 assert(StubRoutines::data_cache_writeback_sync() != NULL, "sanity"); |
|
464 (StubRoutines::DataCacheWritebackSync_stub())(is_pre); |
|
465 } |
|
466 |
|
467 UNSAFE_LEAF (void, Unsafe_WriteBackPreSync0(JNIEnv *env, jobject unsafe)) { |
|
468 assert(VM_Version::supports_data_cache_line_flush(), "should not get here"); |
|
469 #ifdef ASSERT |
|
470 if (TraceMemoryWriteback) { |
|
471 tty->print_cr("Unsafe: writeback pre-sync"); |
|
472 } |
|
473 #endif |
|
474 |
|
475 doWriteBackSync0(true); |
|
476 } UNSAFE_END |
|
477 |
|
478 UNSAFE_LEAF (void, Unsafe_WriteBackPostSync0(JNIEnv *env, jobject unsafe)) { |
|
479 assert(VM_Version::supports_data_cache_line_flush(), "should not get here"); |
|
480 #ifdef ASSERT |
|
481 if (TraceMemoryWriteback) { |
|
482 tty->print_cr("Unsafe: writeback pre-sync"); |
|
483 } |
|
484 #endif |
|
485 |
|
486 doWriteBackSync0(false); |
446 } UNSAFE_END |
487 } UNSAFE_END |
447 |
488 |
448 ////// Random queries |
489 ////// Random queries |
449 |
490 |
450 static jlong find_field_offset(jclass clazz, jstring name, TRAPS) { |
491 static jlong find_field_offset(jclass clazz, jstring name, TRAPS) { |
1071 |
1112 |
1072 {CC "getLoadAverage0", CC "([DI)I", FN_PTR(Unsafe_GetLoadAverage0)}, |
1113 {CC "getLoadAverage0", CC "([DI)I", FN_PTR(Unsafe_GetLoadAverage0)}, |
1073 |
1114 |
1074 {CC "copyMemory0", CC "(" OBJ "J" OBJ "JJ)V", FN_PTR(Unsafe_CopyMemory0)}, |
1115 {CC "copyMemory0", CC "(" OBJ "J" OBJ "JJ)V", FN_PTR(Unsafe_CopyMemory0)}, |
1075 {CC "copySwapMemory0", CC "(" OBJ "J" OBJ "JJJ)V", FN_PTR(Unsafe_CopySwapMemory0)}, |
1116 {CC "copySwapMemory0", CC "(" OBJ "J" OBJ "JJJ)V", FN_PTR(Unsafe_CopySwapMemory0)}, |
|
1117 {CC "writeback0", CC "(" "J" ")V", FN_PTR(Unsafe_WriteBack0)}, |
|
1118 {CC "writebackPreSync0", CC "()V", FN_PTR(Unsafe_WriteBackPreSync0)}, |
|
1119 {CC "writebackPostSync0", CC "()V", FN_PTR(Unsafe_WriteBackPostSync0)}, |
1076 {CC "setMemory0", CC "(" OBJ "JJB)V", FN_PTR(Unsafe_SetMemory0)}, |
1120 {CC "setMemory0", CC "(" OBJ "JJB)V", FN_PTR(Unsafe_SetMemory0)}, |
1077 |
1121 |
1078 {CC "defineAnonymousClass0", CC "(" DAC_Args ")" CLS, FN_PTR(Unsafe_DefineAnonymousClass0)}, |
1122 {CC "defineAnonymousClass0", CC "(" DAC_Args ")" CLS, FN_PTR(Unsafe_DefineAnonymousClass0)}, |
1079 |
1123 |
1080 {CC "shouldBeInitialized0", CC "(" CLS ")Z", FN_PTR(Unsafe_ShouldBeInitialized0)}, |
1124 {CC "shouldBeInitialized0", CC "(" CLS ")Z", FN_PTR(Unsafe_ShouldBeInitialized0)}, |