< prev index next >

src/share/vm/prims/jni.cpp

Print this page
rev 8362 : 8079792: GC directory structure cleanup
Reviewed-by:


  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  *
  24  */
  25 
  26 #include "precompiled.hpp"
  27 #include "ci/ciReplay.hpp"
  28 #include "classfile/altHashing.hpp"
  29 #include "classfile/classLoader.hpp"
  30 #include "classfile/javaClasses.hpp"
  31 #include "classfile/symbolTable.hpp"
  32 #include "classfile/systemDictionary.hpp"
  33 #include "classfile/vmSymbols.hpp"

  34 #include "interpreter/linkResolver.hpp"
  35 #include "memory/allocation.hpp"
  36 #include "memory/allocation.inline.hpp"
  37 #include "memory/gcLocker.inline.hpp"
  38 #include "memory/oopFactory.hpp"
  39 #include "memory/universe.inline.hpp"
  40 #include "oops/instanceKlass.hpp"
  41 #include "oops/instanceOop.hpp"
  42 #include "oops/markOop.hpp"
  43 #include "oops/method.hpp"
  44 #include "oops/objArrayKlass.hpp"
  45 #include "oops/objArrayOop.inline.hpp"
  46 #include "oops/oop.inline.hpp"
  47 #include "oops/symbol.hpp"
  48 #include "oops/typeArrayKlass.hpp"
  49 #include "oops/typeArrayOop.hpp"
  50 #include "prims/jni.h"
  51 #include "prims/jniCheck.hpp"
  52 #include "prims/jniExport.hpp"
  53 #include "prims/jniFastGetField.hpp"
  54 #include "prims/jvm.h"
  55 #include "prims/jvm_misc.hpp"
  56 #include "prims/jvmtiExport.hpp"
  57 #include "prims/jvmtiThreadState.hpp"


  62 #include "runtime/handles.inline.hpp"
  63 #include "runtime/interfaceSupport.hpp"
  64 #include "runtime/java.hpp"
  65 #include "runtime/javaCalls.hpp"
  66 #include "runtime/jfieldIDWorkaround.hpp"
  67 #include "runtime/orderAccess.inline.hpp"
  68 #include "runtime/reflection.hpp"
  69 #include "runtime/sharedRuntime.hpp"
  70 #include "runtime/signature.hpp"
  71 #include "runtime/thread.inline.hpp"
  72 #include "runtime/vm_operations.hpp"
  73 #include "services/memTracker.hpp"
  74 #include "services/runtimeService.hpp"
  75 #include "trace/tracing.hpp"
  76 #include "utilities/defaultStream.hpp"
  77 #include "utilities/dtrace.hpp"
  78 #include "utilities/events.hpp"
  79 #include "utilities/histogram.hpp"
  80 #include "utilities/macros.hpp"
  81 #if INCLUDE_ALL_GCS
  82 #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
  83 #endif // INCLUDE_ALL_GCS
  84 
  85 static jint CurrentVersion = JNI_VERSION_1_8;
  86 
  87 #ifdef _WIN32
  88 extern LONG WINAPI topLevelExceptionFilter(_EXCEPTION_POINTERS* );
  89 #endif
  90 
  91 // The DT_RETURN_MARK macros create a scoped object to fire the dtrace
  92 // '-return' probe regardless of the return path is taken out of the function.
  93 // Methods that have multiple return paths use this to avoid having to
  94 // instrument each return path.  Methods that use CHECK or THROW must use this
  95 // since those macros can cause an immedate uninstrumented return.
  96 //
  97 // In order to get the return value, a reference to the variable containing
  98 // the return value must be passed to the contructor of the object, and
  99 // the return value must be set before return (since the mark object has
 100 // a reference to it).
 101 //
 102 // Example:


3821   DT_RETURN_MARK(GetDefaultJavaVMInitArgs, jint, (const jint&)ret);
3822 
3823   if (Threads::is_supported_jni_version(args->version)) {
3824     ret = JNI_OK;
3825   }
3826   // 1.1 style no longer supported in hotspot.
3827   // According the JNI spec, we should update args->version on return.
3828   // We also use the structure to communicate with launcher about default
3829   // stack size.
3830   if (args->version == JNI_VERSION_1_1) {
3831     args->version = JNI_VERSION_1_2;
3832     // javaStackSize is int in arguments structure
3833     assert(jlong(ThreadStackSize) * K < INT_MAX, "integer overflow");
3834     args->javaStackSize = (jint)(ThreadStackSize * K);
3835   }
3836   return ret;
3837 }
3838 
3839 #ifndef PRODUCT
3840 
3841 #include "gc_implementation/shared/gcTimer.hpp"
3842 #include "gc_interface/collectedHeap.hpp"
3843 #if INCLUDE_ALL_GCS
3844 #include "gc_implementation/g1/heapRegionRemSet.hpp"
3845 #endif
3846 #include "memory/guardedMemory.hpp"
3847 #include "utilities/quickSort.hpp"
3848 #include "utilities/ostream.hpp"

3849 #if INCLUDE_VM_STRUCTS
3850 #include "runtime/vmStructs.hpp"
3851 #endif
3852 
3853 #define run_unit_test(unit_test_function_call)              \
3854   tty->print_cr("Running test: " #unit_test_function_call); \
3855   unit_test_function_call
3856 
3857 // Forward declaration
3858 void TestOS_test();
3859 void TestReservedSpace_test();
3860 void TestReserveMemorySpecial_test();
3861 void TestVirtualSpace_test();
3862 void TestMetaspaceAux_test();
3863 void TestMetachunk_test();
3864 void TestVirtualSpaceNode_test();
3865 void TestNewSize_test();
3866 void TestOldSize_test();
3867 void TestKlass_test();
3868 void TestBitMap_test();




  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  *
  24  */
  25 
  26 #include "precompiled.hpp"
  27 #include "ci/ciReplay.hpp"
  28 #include "classfile/altHashing.hpp"
  29 #include "classfile/classLoader.hpp"
  30 #include "classfile/javaClasses.hpp"
  31 #include "classfile/symbolTable.hpp"
  32 #include "classfile/systemDictionary.hpp"
  33 #include "classfile/vmSymbols.hpp"
  34 #include "gc/shared/gcLocker.inline.hpp"
  35 #include "interpreter/linkResolver.hpp"
  36 #include "memory/allocation.hpp"
  37 #include "memory/allocation.inline.hpp"

  38 #include "memory/oopFactory.hpp"
  39 #include "memory/universe.inline.hpp"
  40 #include "oops/instanceKlass.hpp"
  41 #include "oops/instanceOop.hpp"
  42 #include "oops/markOop.hpp"
  43 #include "oops/method.hpp"
  44 #include "oops/objArrayKlass.hpp"
  45 #include "oops/objArrayOop.inline.hpp"
  46 #include "oops/oop.inline.hpp"
  47 #include "oops/symbol.hpp"
  48 #include "oops/typeArrayKlass.hpp"
  49 #include "oops/typeArrayOop.hpp"
  50 #include "prims/jni.h"
  51 #include "prims/jniCheck.hpp"
  52 #include "prims/jniExport.hpp"
  53 #include "prims/jniFastGetField.hpp"
  54 #include "prims/jvm.h"
  55 #include "prims/jvm_misc.hpp"
  56 #include "prims/jvmtiExport.hpp"
  57 #include "prims/jvmtiThreadState.hpp"


  62 #include "runtime/handles.inline.hpp"
  63 #include "runtime/interfaceSupport.hpp"
  64 #include "runtime/java.hpp"
  65 #include "runtime/javaCalls.hpp"
  66 #include "runtime/jfieldIDWorkaround.hpp"
  67 #include "runtime/orderAccess.inline.hpp"
  68 #include "runtime/reflection.hpp"
  69 #include "runtime/sharedRuntime.hpp"
  70 #include "runtime/signature.hpp"
  71 #include "runtime/thread.inline.hpp"
  72 #include "runtime/vm_operations.hpp"
  73 #include "services/memTracker.hpp"
  74 #include "services/runtimeService.hpp"
  75 #include "trace/tracing.hpp"
  76 #include "utilities/defaultStream.hpp"
  77 #include "utilities/dtrace.hpp"
  78 #include "utilities/events.hpp"
  79 #include "utilities/histogram.hpp"
  80 #include "utilities/macros.hpp"
  81 #if INCLUDE_ALL_GCS
  82 #include "gc/g1/g1SATBCardTableModRefBS.hpp"
  83 #endif // INCLUDE_ALL_GCS
  84 
  85 static jint CurrentVersion = JNI_VERSION_1_8;
  86 
  87 #ifdef _WIN32
  88 extern LONG WINAPI topLevelExceptionFilter(_EXCEPTION_POINTERS* );
  89 #endif
  90 
  91 // The DT_RETURN_MARK macros create a scoped object to fire the dtrace
  92 // '-return' probe regardless of the return path is taken out of the function.
  93 // Methods that have multiple return paths use this to avoid having to
  94 // instrument each return path.  Methods that use CHECK or THROW must use this
  95 // since those macros can cause an immedate uninstrumented return.
  96 //
  97 // In order to get the return value, a reference to the variable containing
  98 // the return value must be passed to the contructor of the object, and
  99 // the return value must be set before return (since the mark object has
 100 // a reference to it).
 101 //
 102 // Example:


3821   DT_RETURN_MARK(GetDefaultJavaVMInitArgs, jint, (const jint&)ret);
3822 
3823   if (Threads::is_supported_jni_version(args->version)) {
3824     ret = JNI_OK;
3825   }
3826   // 1.1 style no longer supported in hotspot.
3827   // According the JNI spec, we should update args->version on return.
3828   // We also use the structure to communicate with launcher about default
3829   // stack size.
3830   if (args->version == JNI_VERSION_1_1) {
3831     args->version = JNI_VERSION_1_2;
3832     // javaStackSize is int in arguments structure
3833     assert(jlong(ThreadStackSize) * K < INT_MAX, "integer overflow");
3834     args->javaStackSize = (jint)(ThreadStackSize * K);
3835   }
3836   return ret;
3837 }
3838 
3839 #ifndef PRODUCT
3840 
3841 #include "gc/shared/collectedHeap.hpp"
3842 #include "gc/shared/gcTimer.hpp"
3843 #if INCLUDE_ALL_GCS
3844 #include "gc/g1/heapRegionRemSet.hpp"
3845 #endif
3846 #include "memory/guardedMemory.hpp"

3847 #include "utilities/ostream.hpp"
3848 #include "utilities/quickSort.hpp"
3849 #if INCLUDE_VM_STRUCTS
3850 #include "runtime/vmStructs.hpp"
3851 #endif
3852 
3853 #define run_unit_test(unit_test_function_call)              \
3854   tty->print_cr("Running test: " #unit_test_function_call); \
3855   unit_test_function_call
3856 
3857 // Forward declaration
3858 void TestOS_test();
3859 void TestReservedSpace_test();
3860 void TestReserveMemorySpecial_test();
3861 void TestVirtualSpace_test();
3862 void TestMetaspaceAux_test();
3863 void TestMetachunk_test();
3864 void TestVirtualSpaceNode_test();
3865 void TestNewSize_test();
3866 void TestOldSize_test();
3867 void TestKlass_test();
3868 void TestBitMap_test();


< prev index next >