126
127 // Note: with several active threads, the must_be_compiled may be true
128 // while can_be_compiled is false; remove assert
129 // assert(CompilationPolicy::can_be_compiled(selected_method), "cannot compile");
130 if (!THREAD->can_call_java()) {
131 // don't force compilation, resolve was on behalf of compiler
132 return;
133 }
134 if (selected_method->method_holder()->is_not_initialized()) {
135 // 'is_not_initialized' means not only '!is_initialized', but also that
136 // initialization has not been started yet ('!being_initialized')
137 // Do not force compilation of methods in uninitialized classes.
138 // Note that doing this would throw an assert later,
139 // in CompileBroker::compile_method.
140 // We sometimes use the link resolver to do reflective lookups
141 // even before classes are initialized.
142 return;
143 }
144 CompileBroker::compile_method(selected_method, InvocationEntryBci,
145 CompilationPolicy::policy()->initial_compile_level(),
146 methodHandle(), 0, "must_be_compiled", CHECK);
147 }
148 }
149
150 // utility query for unreflecting a method
151 CallInfo::CallInfo(Method* resolved_method, Klass* resolved_klass) {
152 Klass* resolved_method_holder = resolved_method->method_holder();
153 if (resolved_klass == NULL) { // 2nd argument defaults to holder of 1st
154 resolved_klass = resolved_method_holder;
155 }
156 _resolved_klass = resolved_klass;
157 _selected_klass = resolved_klass;
158 _resolved_method = resolved_method;
159 _selected_method = resolved_method;
160 // classify:
161 CallKind kind = CallInfo::unknown_kind;
162 int index = resolved_method->vtable_index();
163 if (resolved_method->can_be_statically_bound()) {
164 kind = CallInfo::direct_call;
165 } else if (!resolved_method_holder->is_interface()) {
166 // Could be an Object method inherited into an interface, but still a vtable call.
|
126
127 // Note: with several active threads, the must_be_compiled may be true
128 // while can_be_compiled is false; remove assert
129 // assert(CompilationPolicy::can_be_compiled(selected_method), "cannot compile");
130 if (!THREAD->can_call_java()) {
131 // don't force compilation, resolve was on behalf of compiler
132 return;
133 }
134 if (selected_method->method_holder()->is_not_initialized()) {
135 // 'is_not_initialized' means not only '!is_initialized', but also that
136 // initialization has not been started yet ('!being_initialized')
137 // Do not force compilation of methods in uninitialized classes.
138 // Note that doing this would throw an assert later,
139 // in CompileBroker::compile_method.
140 // We sometimes use the link resolver to do reflective lookups
141 // even before classes are initialized.
142 return;
143 }
144 CompileBroker::compile_method(selected_method, InvocationEntryBci,
145 CompilationPolicy::policy()->initial_compile_level(),
146 methodHandle(), 0, "must_be_compiled", false, CHECK);
147 }
148 }
149
150 // utility query for unreflecting a method
151 CallInfo::CallInfo(Method* resolved_method, Klass* resolved_klass) {
152 Klass* resolved_method_holder = resolved_method->method_holder();
153 if (resolved_klass == NULL) { // 2nd argument defaults to holder of 1st
154 resolved_klass = resolved_method_holder;
155 }
156 _resolved_klass = resolved_klass;
157 _selected_klass = resolved_klass;
158 _resolved_method = resolved_method;
159 _selected_method = resolved_method;
160 // classify:
161 CallKind kind = CallInfo::unknown_kind;
162 int index = resolved_method->vtable_index();
163 if (resolved_method->can_be_statically_bound()) {
164 kind = CallInfo::direct_call;
165 } else if (!resolved_method_holder->is_interface()) {
166 // Could be an Object method inherited into an interface, but still a vtable call.
|