< prev index next >

src/hotspot/share/prims/unsafe.cpp

Print this page

 49 #include "runtime/orderAccess.hpp"
 50 #include "runtime/reflection.hpp"
 51 #include "runtime/sharedRuntime.hpp"
 52 #include "runtime/stubRoutines.hpp"
 53 #include "runtime/thread.hpp"
 54 #include "runtime/threadSMR.hpp"
 55 #include "runtime/vmOperations.hpp"
 56 #include "runtime/vm_version.hpp"
 57 #include "services/threadService.hpp"
 58 #include "utilities/align.hpp"
 59 #include "utilities/copy.hpp"
 60 #include "utilities/dtrace.hpp"
 61 #include "utilities/macros.hpp"
 62 
 63 /**
 64  * Implementation of the jdk.internal.misc.Unsafe class
 65  */
 66 
 67 
 68 #define MAX_OBJECT_SIZE \
 69   ( arrayOopDesc::header_size(T_DOUBLE) * HeapWordSize \
 70     + ((julong)max_jint * sizeof(double)) )
 71 
 72 
 73 #define UNSAFE_ENTRY(result_type, header) \
 74   JVM_ENTRY(static result_type, header)
 75 
 76 #define UNSAFE_LEAF(result_type, header) \
 77   JVM_LEAF(static result_type, header)
 78 
 79 #define UNSAFE_END JVM_END
 80 
 81 
 82 static inline void* addr_from_java(jlong addr) {
 83   // This assert fails in a variety of ways on 32-bit systems.
 84   // It is impossible to predict whether native code that converts
 85   // pointers to longs will sign-extend or zero-extend the addresses.
 86   //assert(addr == (uintptr_t)addr, "must not be odd high bits");
 87   return (void*)(uintptr_t)addr;
 88 }
 89 

 49 #include "runtime/orderAccess.hpp"
 50 #include "runtime/reflection.hpp"
 51 #include "runtime/sharedRuntime.hpp"
 52 #include "runtime/stubRoutines.hpp"
 53 #include "runtime/thread.hpp"
 54 #include "runtime/threadSMR.hpp"
 55 #include "runtime/vmOperations.hpp"
 56 #include "runtime/vm_version.hpp"
 57 #include "services/threadService.hpp"
 58 #include "utilities/align.hpp"
 59 #include "utilities/copy.hpp"
 60 #include "utilities/dtrace.hpp"
 61 #include "utilities/macros.hpp"
 62 
 63 /**
 64  * Implementation of the jdk.internal.misc.Unsafe class
 65  */
 66 
 67 
 68 #define MAX_OBJECT_SIZE \
 69   ( arrayOopDesc::base_offset_in_bytes(T_DOUBLE) \
 70     + ((julong)max_jint * sizeof(double)) )
 71 
 72 
 73 #define UNSAFE_ENTRY(result_type, header) \
 74   JVM_ENTRY(static result_type, header)
 75 
 76 #define UNSAFE_LEAF(result_type, header) \
 77   JVM_LEAF(static result_type, header)
 78 
 79 #define UNSAFE_END JVM_END
 80 
 81 
 82 static inline void* addr_from_java(jlong addr) {
 83   // This assert fails in a variety of ways on 32-bit systems.
 84   // It is impossible to predict whether native code that converts
 85   // pointers to longs will sign-extend or zero-extend the addresses.
 86   //assert(addr == (uintptr_t)addr, "must not be odd high bits");
 87   return (void*)(uintptr_t)addr;
 88 }
 89 
< prev index next >