12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "classfile/classLoader.hpp"
27 #include "classfile/javaClasses.hpp"
28 #include "classfile/moduleEntry.hpp"
29 #include "classfile/systemDictionary.hpp"
30 #include "classfile/vmSymbols.hpp"
31 #include "code/codeCache.hpp"
32 #include "code/codeCacheExtensions.hpp"
33 #include "code/scopeDesc.hpp"
34 #include "compiler/compileBroker.hpp"
35 #include "compiler/compileTask.hpp"
36 #include "gc/shared/gcId.hpp"
37 #include "gc/shared/gcLocker.inline.hpp"
38 #include "gc/shared/workgroup.hpp"
39 #include "interpreter/interpreter.hpp"
40 #include "interpreter/linkResolver.hpp"
41 #include "interpreter/oopMapCache.hpp"
42 #include "jvmtifiles/jvmtiEnv.hpp"
43 #include "logging/log.hpp"
44 #include "logging/logConfiguration.hpp"
45 #include "memory/metaspaceShared.hpp"
46 #include "memory/oopFactory.hpp"
47 #include "memory/resourceArea.hpp"
48 #include "memory/universe.inline.hpp"
49 #include "oops/instanceKlass.hpp"
50 #include "oops/objArrayOop.hpp"
51 #include "oops/oop.inline.hpp"
52 #include "oops/symbol.hpp"
3824 // The Java side of PostVMInitHook.run must deal with all
3825 // exceptions and provide means of diagnosis.
3826 if (HAS_PENDING_EXCEPTION) {
3827 CLEAR_PENDING_EXCEPTION;
3828 }
3829 }
3830
3831 {
3832 MutexLocker ml(PeriodicTask_lock);
3833 // Make sure the WatcherThread can be started by WatcherThread::start()
3834 // or by dynamic enrollment.
3835 WatcherThread::make_startable();
3836 // Start up the WatcherThread if there are any periodic tasks
3837 // NOTE: All PeriodicTasks should be registered by now. If they
3838 // aren't, late joiners might appear to start slowly (we might
3839 // take a while to process their first tick).
3840 if (PeriodicTask::num_tasks() > 0) {
3841 WatcherThread::start();
3842 }
3843 }
3844
3845 CodeCacheExtensions::complete_step(CodeCacheExtensionsSteps::CreateVM);
3846
3847 create_vm_timer.end();
3848 #ifdef ASSERT
3849 _vm_complete = true;
3850 #endif
3851 return JNI_OK;
3852 }
3853
3854 // type for the Agent_OnLoad and JVM_OnLoad entry points
3855 extern "C" {
3856 typedef jint (JNICALL *OnLoadEntry_t)(JavaVM *, char *, void *);
3857 }
3858 // Find a command line agent library and return its entry point for
3859 // -agentlib: -agentpath: -Xrun
3860 // num_symbol_entries must be passed-in since only the caller knows the number of symbols in the array.
3861 static OnLoadEntry_t lookup_on_load(AgentLibrary* agent,
3862 const char *on_load_symbols[],
3863 size_t num_symbol_entries) {
3864 OnLoadEntry_t on_load_entry = NULL;
3865 void *library = NULL;
|
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "classfile/classLoader.hpp"
27 #include "classfile/javaClasses.hpp"
28 #include "classfile/moduleEntry.hpp"
29 #include "classfile/systemDictionary.hpp"
30 #include "classfile/vmSymbols.hpp"
31 #include "code/codeCache.hpp"
32 #include "code/scopeDesc.hpp"
33 #include "compiler/compileBroker.hpp"
34 #include "compiler/compileTask.hpp"
35 #include "gc/shared/gcId.hpp"
36 #include "gc/shared/gcLocker.inline.hpp"
37 #include "gc/shared/workgroup.hpp"
38 #include "interpreter/interpreter.hpp"
39 #include "interpreter/linkResolver.hpp"
40 #include "interpreter/oopMapCache.hpp"
41 #include "jvmtifiles/jvmtiEnv.hpp"
42 #include "logging/log.hpp"
43 #include "logging/logConfiguration.hpp"
44 #include "memory/metaspaceShared.hpp"
45 #include "memory/oopFactory.hpp"
46 #include "memory/resourceArea.hpp"
47 #include "memory/universe.inline.hpp"
48 #include "oops/instanceKlass.hpp"
49 #include "oops/objArrayOop.hpp"
50 #include "oops/oop.inline.hpp"
51 #include "oops/symbol.hpp"
3823 // The Java side of PostVMInitHook.run must deal with all
3824 // exceptions and provide means of diagnosis.
3825 if (HAS_PENDING_EXCEPTION) {
3826 CLEAR_PENDING_EXCEPTION;
3827 }
3828 }
3829
3830 {
3831 MutexLocker ml(PeriodicTask_lock);
3832 // Make sure the WatcherThread can be started by WatcherThread::start()
3833 // or by dynamic enrollment.
3834 WatcherThread::make_startable();
3835 // Start up the WatcherThread if there are any periodic tasks
3836 // NOTE: All PeriodicTasks should be registered by now. If they
3837 // aren't, late joiners might appear to start slowly (we might
3838 // take a while to process their first tick).
3839 if (PeriodicTask::num_tasks() > 0) {
3840 WatcherThread::start();
3841 }
3842 }
3843
3844 create_vm_timer.end();
3845 #ifdef ASSERT
3846 _vm_complete = true;
3847 #endif
3848 return JNI_OK;
3849 }
3850
3851 // type for the Agent_OnLoad and JVM_OnLoad entry points
3852 extern "C" {
3853 typedef jint (JNICALL *OnLoadEntry_t)(JavaVM *, char *, void *);
3854 }
3855 // Find a command line agent library and return its entry point for
3856 // -agentlib: -agentpath: -Xrun
3857 // num_symbol_entries must be passed-in since only the caller knows the number of symbols in the array.
3858 static OnLoadEntry_t lookup_on_load(AgentLibrary* agent,
3859 const char *on_load_symbols[],
3860 size_t num_symbol_entries) {
3861 OnLoadEntry_t on_load_entry = NULL;
3862 void *library = NULL;
|