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