src/share/vm/prims/jni.cpp

Print this page


   1 /*
   2  * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * Copyright (c) 2012 Red Hat, Inc.
   4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5  *
   6  * This code is free software; you can redistribute it and/or modify it
   7  * under the terms of the GNU General Public License version 2 only, as
   8  * published by the Free Software Foundation.
   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file that
  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.


5046 #endif
5047 #include "utilities/quickSort.hpp"
5048 #include "utilities/ostream.hpp"
5049 #if INCLUDE_VM_STRUCTS
5050 #include "runtime/vmStructs.hpp"
5051 #endif
5052 
5053 #define run_unit_test(unit_test_function_call)              \
5054   tty->print_cr("Running test: " #unit_test_function_call); \
5055   unit_test_function_call
5056 
5057 // Forward declaration
5058 void TestReservedSpace_test();
5059 void TestReserveMemorySpecial_test();
5060 void TestVirtualSpace_test();
5061 void TestMetaspaceAux_test();
5062 void TestMetachunk_test();
5063 void TestVirtualSpaceNode_test();
5064 #if INCLUDE_ALL_GCS
5065 void TestG1BiasedArray_test();

5066 #endif
5067 
5068 void execute_internal_vm_tests() {
5069   if (ExecuteInternalVMTests) {
5070     tty->print_cr("Running internal VM tests");
5071     run_unit_test(TestReservedSpace_test());
5072     run_unit_test(TestReserveMemorySpecial_test());
5073     run_unit_test(TestVirtualSpace_test());
5074     run_unit_test(TestMetaspaceAux_test());
5075     run_unit_test(TestMetachunk_test());
5076     run_unit_test(TestVirtualSpaceNode_test());
5077     run_unit_test(GlobalDefinitions::test_globals());
5078     run_unit_test(GCTimerAllTest::all());
5079     run_unit_test(arrayOopDesc::test_max_array_length());
5080     run_unit_test(CollectedHeap::test_is_in());
5081     run_unit_test(QuickSort::test_quick_sort());
5082     run_unit_test(AltHashing::test_alt_hash());
5083     run_unit_test(test_loggc_filename());
5084 #if INCLUDE_VM_STRUCTS
5085     run_unit_test(VMStructs::test());
5086 #endif
5087 #if INCLUDE_ALL_GCS
5088     run_unit_test(TestG1BiasedArray_test());
5089     run_unit_test(HeapRegionRemSet::test_prt());

5090 #endif
5091     tty->print_cr("All internal VM tests passed");
5092   }
5093 }
5094 
5095 #undef run_unit_test
5096 
5097 #endif
5098 
5099 #ifndef USDT2
5100 HS_DTRACE_PROBE_DECL3(hotspot_jni, CreateJavaVM__entry, vm, penv, args);
5101 DT_RETURN_MARK_DECL(CreateJavaVM, jint);
5102 #else /* USDT2 */
5103 DT_RETURN_MARK_DECL(CreateJavaVM, jint
5104                     , HOTSPOT_JNI_CREATEJAVAVM_RETURN(_ret_ref));
5105 #endif /* USDT2 */
5106 
5107 _JNI_IMPORT_OR_EXPORT_ jint JNICALL JNI_CreateJavaVM(JavaVM **vm, void **penv, void *args) {
5108 #ifndef USDT2
5109   HS_DTRACE_PROBE3(hotspot_jni, CreateJavaVM__entry, vm, penv, args);


   1 /*
   2  * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * Copyright (c) 2012 Red Hat, Inc.
   4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5  *
   6  * This code is free software; you can redistribute it and/or modify it
   7  * under the terms of the GNU General Public License version 2 only, as
   8  * published by the Free Software Foundation.
   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file that
  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.


5046 #endif
5047 #include "utilities/quickSort.hpp"
5048 #include "utilities/ostream.hpp"
5049 #if INCLUDE_VM_STRUCTS
5050 #include "runtime/vmStructs.hpp"
5051 #endif
5052 
5053 #define run_unit_test(unit_test_function_call)              \
5054   tty->print_cr("Running test: " #unit_test_function_call); \
5055   unit_test_function_call
5056 
5057 // Forward declaration
5058 void TestReservedSpace_test();
5059 void TestReserveMemorySpecial_test();
5060 void TestVirtualSpace_test();
5061 void TestMetaspaceAux_test();
5062 void TestMetachunk_test();
5063 void TestVirtualSpaceNode_test();
5064 #if INCLUDE_ALL_GCS
5065 void TestG1BiasedArray_test();
5066 void TestBufferingOopClosure_test();
5067 #endif
5068 
5069 void execute_internal_vm_tests() {
5070   if (ExecuteInternalVMTests) {
5071     tty->print_cr("Running internal VM tests");
5072     run_unit_test(TestReservedSpace_test());
5073     run_unit_test(TestReserveMemorySpecial_test());
5074     run_unit_test(TestVirtualSpace_test());
5075     run_unit_test(TestMetaspaceAux_test());
5076     run_unit_test(TestMetachunk_test());
5077     run_unit_test(TestVirtualSpaceNode_test());
5078     run_unit_test(GlobalDefinitions::test_globals());
5079     run_unit_test(GCTimerAllTest::all());
5080     run_unit_test(arrayOopDesc::test_max_array_length());
5081     run_unit_test(CollectedHeap::test_is_in());
5082     run_unit_test(QuickSort::test_quick_sort());
5083     run_unit_test(AltHashing::test_alt_hash());
5084     run_unit_test(test_loggc_filename());
5085 #if INCLUDE_VM_STRUCTS
5086     run_unit_test(VMStructs::test());
5087 #endif
5088 #if INCLUDE_ALL_GCS
5089     run_unit_test(TestG1BiasedArray_test());
5090     run_unit_test(HeapRegionRemSet::test_prt());
5091     run_unit_test(TestBufferingOopClosure_test());
5092 #endif
5093     tty->print_cr("All internal VM tests passed");
5094   }
5095 }
5096 
5097 #undef run_unit_test
5098 
5099 #endif
5100 
5101 #ifndef USDT2
5102 HS_DTRACE_PROBE_DECL3(hotspot_jni, CreateJavaVM__entry, vm, penv, args);
5103 DT_RETURN_MARK_DECL(CreateJavaVM, jint);
5104 #else /* USDT2 */
5105 DT_RETURN_MARK_DECL(CreateJavaVM, jint
5106                     , HOTSPOT_JNI_CREATEJAVAVM_RETURN(_ret_ref));
5107 #endif /* USDT2 */
5108 
5109 _JNI_IMPORT_OR_EXPORT_ jint JNICALL JNI_CreateJavaVM(JavaVM **vm, void **penv, void *args) {
5110 #ifndef USDT2
5111   HS_DTRACE_PROBE3(hotspot_jni, CreateJavaVM__entry, vm, penv, args);