70 }
71
72 void JVMCICompiler::bootstrap(TRAPS) {
73 if (Arguments::mode() == Arguments::_int) {
74 // Nothing to do in -Xint mode
75 return;
76 }
77 _bootstrapping = true;
78 ResourceMark rm(THREAD);
79 HandleMark hm(THREAD);
80 if (PrintBootstrap) {
81 tty->print("Bootstrapping JVMCI");
82 }
83 jlong start = os::javaTimeNanos();
84
85 Array<Method*>* objectMethods = vmClasses::Object_klass()->methods();
86 // Initialize compile queue with a selected set of methods.
87 int len = objectMethods->length();
88 for (int i = 0; i < len; i++) {
89 methodHandle mh(THREAD, objectMethods->at(i));
90 if (!mh->is_native() && !mh->is_static() && !mh->is_initializer()) {
91 ResourceMark rm;
92 int hot_count = 10; // TODO: what's the appropriate value?
93 CompileBroker::compile_method(mh, InvocationEntryBci, CompLevel_full_optimization, mh, hot_count, CompileTask::Reason_Bootstrap, CHECK);
94 }
95 }
96
97 int qsize;
98 bool first_round = true;
99 int z = 0;
100 do {
101 // Loop until there is something in the queue.
102 do {
103 THREAD->sleep(100);
104 qsize = CompileBroker::queue_size(CompLevel_full_optimization);
105 } while (!_bootstrap_compilation_request_handled && first_round && qsize == 0);
106 first_round = false;
107 if (PrintBootstrap) {
108 while (z < (_methods_compiled / 100)) {
109 ++z;
110 tty->print_raw(".");
|
70 }
71
72 void JVMCICompiler::bootstrap(TRAPS) {
73 if (Arguments::mode() == Arguments::_int) {
74 // Nothing to do in -Xint mode
75 return;
76 }
77 _bootstrapping = true;
78 ResourceMark rm(THREAD);
79 HandleMark hm(THREAD);
80 if (PrintBootstrap) {
81 tty->print("Bootstrapping JVMCI");
82 }
83 jlong start = os::javaTimeNanos();
84
85 Array<Method*>* objectMethods = vmClasses::Object_klass()->methods();
86 // Initialize compile queue with a selected set of methods.
87 int len = objectMethods->length();
88 for (int i = 0; i < len; i++) {
89 methodHandle mh(THREAD, objectMethods->at(i));
90 if (!mh->is_native() &&
91 !mh->is_static() &&
92 !mh->is_object_constructor() &&
93 !mh->is_class_initializer()) {
94 ResourceMark rm;
95 int hot_count = 10; // TODO: what's the appropriate value?
96 CompileBroker::compile_method(mh, InvocationEntryBci, CompLevel_full_optimization, mh, hot_count, CompileTask::Reason_Bootstrap, CHECK);
97 }
98 }
99
100 int qsize;
101 bool first_round = true;
102 int z = 0;
103 do {
104 // Loop until there is something in the queue.
105 do {
106 THREAD->sleep(100);
107 qsize = CompileBroker::queue_size(CompLevel_full_optimization);
108 } while (!_bootstrap_compilation_request_handled && first_round && qsize == 0);
109 first_round = false;
110 if (PrintBootstrap) {
111 while (z < (_methods_compiled / 100)) {
112 ++z;
113 tty->print_raw(".");
|