src/share/vm/prims/unsafe.cpp

Print this page




  28 #include "oops/objArrayOop.inline.hpp"
  29 #include "oops/oop.inline.hpp"
  30 #include "prims/jni.h"
  31 #include "prims/jvm.h"
  32 #include "runtime/atomic.inline.hpp"
  33 #include "runtime/globals.hpp"
  34 #include "runtime/interfaceSupport.hpp"
  35 #include "runtime/orderAccess.inline.hpp"
  36 #include "runtime/reflection.hpp"
  37 #include "runtime/vm_version.hpp"
  38 #include "services/threadService.hpp"
  39 #include "trace/tracing.hpp"
  40 #include "utilities/copy.hpp"
  41 #include "utilities/dtrace.hpp"
  42 #include "utilities/macros.hpp"
  43 #if INCLUDE_ALL_GCS
  44 #include "gc/g1/g1SATBCardTableModRefBS.hpp"
  45 #endif // INCLUDE_ALL_GCS
  46 
  47 /*
  48  *      Implementation of class sun.misc.Unsafe
  49  */
  50 
  51 
  52 #define MAX_OBJECT_SIZE \
  53   ( arrayOopDesc::header_size(T_DOUBLE) * HeapWordSize \
  54     + ((julong)max_jint * sizeof(double)) )
  55 
  56 
  57 #define UNSAFE_ENTRY(result_type, header) \
  58   JVM_ENTRY(result_type, header)
  59 
  60 // Can't use UNSAFE_LEAF because it has the signature of a straight
  61 // call into the runtime (just like JVM_LEAF, funny that) but it's
  62 // called like a Java Native and thus the wrapper built for it passes
  63 // arguments like a JNI call.  It expects those arguments to be popped
  64 // from the stack on Intel like all good JNI args are, and adjusts the
  65 // stack according.  Since the JVM_LEAF call expects no extra
  66 // arguments the stack isn't popped in the C code, is pushed by the
  67 // wrapper and we get sick.
  68 //#define UNSAFE_LEAF(result_type, header) \




  28 #include "oops/objArrayOop.inline.hpp"
  29 #include "oops/oop.inline.hpp"
  30 #include "prims/jni.h"
  31 #include "prims/jvm.h"
  32 #include "runtime/atomic.inline.hpp"
  33 #include "runtime/globals.hpp"
  34 #include "runtime/interfaceSupport.hpp"
  35 #include "runtime/orderAccess.inline.hpp"
  36 #include "runtime/reflection.hpp"
  37 #include "runtime/vm_version.hpp"
  38 #include "services/threadService.hpp"
  39 #include "trace/tracing.hpp"
  40 #include "utilities/copy.hpp"
  41 #include "utilities/dtrace.hpp"
  42 #include "utilities/macros.hpp"
  43 #if INCLUDE_ALL_GCS
  44 #include "gc/g1/g1SATBCardTableModRefBS.hpp"
  45 #endif // INCLUDE_ALL_GCS
  46 
  47 /*
  48  *      Implementation of class [sun|jdk.internal].misc.Unsafe
  49  */
  50 
  51 
  52 #define MAX_OBJECT_SIZE \
  53   ( arrayOopDesc::header_size(T_DOUBLE) * HeapWordSize \
  54     + ((julong)max_jint * sizeof(double)) )
  55 
  56 
  57 #define UNSAFE_ENTRY(result_type, header) \
  58   JVM_ENTRY(result_type, header)
  59 
  60 // Can't use UNSAFE_LEAF because it has the signature of a straight
  61 // call into the runtime (just like JVM_LEAF, funny that) but it's
  62 // called like a Java Native and thus the wrapper built for it passes
  63 // arguments like a JNI call.  It expects those arguments to be popped
  64 // from the stack on Intel like all good JNI args are, and adjusts the
  65 // stack according.  Since the JVM_LEAF call expects no extra
  66 // arguments the stack isn't popped in the C code, is pushed by the
  67 // wrapper and we get sick.
  68 //#define UNSAFE_LEAF(result_type, header) \