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