110 _resolved_method_type = resolved_method_type;
111 }
112
113 void CallInfo::set_common(KlassHandle resolved_klass,
114 KlassHandle selected_klass,
115 const methodHandle& resolved_method,
116 const methodHandle& selected_method,
117 CallKind kind,
118 int index,
119 TRAPS) {
120 assert(resolved_method->signature() == selected_method->signature(), "signatures must correspond");
121 _resolved_klass = resolved_klass;
122 _selected_klass = selected_klass;
123 _resolved_method = resolved_method;
124 _selected_method = selected_method;
125 _call_kind = kind;
126 _call_index = index;
127 _resolved_appendix = Handle();
128 DEBUG_ONLY(verify()); // verify before making side effects
129
130 if (CompilationPolicy::must_be_compiled(selected_method)) {
131 // This path is unusual, mostly used by the '-Xcomp' stress test mode.
132
133 // Note: with several active threads, the must_be_compiled may be true
134 // while can_be_compiled is false; remove assert
135 // assert(CompilationPolicy::can_be_compiled(selected_method), "cannot compile");
136 if (!THREAD->can_call_java()) {
137 // don't force compilation, resolve was on behalf of compiler
138 return;
139 }
140 if (selected_method->method_holder()->is_not_initialized()) {
141 // 'is_not_initialized' means not only '!is_initialized', but also that
142 // initialization has not been started yet ('!being_initialized')
143 // Do not force compilation of methods in uninitialized classes.
144 // Note that doing this would throw an assert later,
145 // in CompileBroker::compile_method.
146 // We sometimes use the link resolver to do reflective lookups
147 // even before classes are initialized.
148 return;
149 }
150 CompileBroker::compile_method(selected_method, InvocationEntryBci,
151 CompilationPolicy::policy()->initial_compile_level(),
152 methodHandle(), 0, "must_be_compiled", CHECK);
153 }
154 }
155
156 // utility query for unreflecting a method
157 CallInfo::CallInfo(Method* resolved_method, Klass* resolved_klass) {
158 Klass* resolved_method_holder = resolved_method->method_holder();
159 if (resolved_klass == NULL) { // 2nd argument defaults to holder of 1st
160 resolved_klass = resolved_method_holder;
161 }
162 _resolved_klass = resolved_klass;
163 _selected_klass = resolved_klass;
164 _resolved_method = resolved_method;
165 _selected_method = resolved_method;
166 // classify:
167 CallKind kind = CallInfo::unknown_kind;
168 int index = resolved_method->vtable_index();
169 if (resolved_method->can_be_statically_bound()) {
170 kind = CallInfo::direct_call;
171 } else if (!resolved_method_holder->is_interface()) {
172 // Could be an Object method inherited into an interface, but still a vtable call.
173 kind = CallInfo::vtable_call;
|
110 _resolved_method_type = resolved_method_type;
111 }
112
113 void CallInfo::set_common(KlassHandle resolved_klass,
114 KlassHandle selected_klass,
115 const methodHandle& resolved_method,
116 const methodHandle& selected_method,
117 CallKind kind,
118 int index,
119 TRAPS) {
120 assert(resolved_method->signature() == selected_method->signature(), "signatures must correspond");
121 _resolved_klass = resolved_klass;
122 _selected_klass = selected_klass;
123 _resolved_method = resolved_method;
124 _selected_method = selected_method;
125 _call_kind = kind;
126 _call_index = index;
127 _resolved_appendix = Handle();
128 DEBUG_ONLY(verify()); // verify before making side effects
129
130 CompilationPolicy::compile_if_required(selected_method, THREAD);
131 }
132
133 // utility query for unreflecting a method
134 CallInfo::CallInfo(Method* resolved_method, Klass* resolved_klass) {
135 Klass* resolved_method_holder = resolved_method->method_holder();
136 if (resolved_klass == NULL) { // 2nd argument defaults to holder of 1st
137 resolved_klass = resolved_method_holder;
138 }
139 _resolved_klass = resolved_klass;
140 _selected_klass = resolved_klass;
141 _resolved_method = resolved_method;
142 _selected_method = resolved_method;
143 // classify:
144 CallKind kind = CallInfo::unknown_kind;
145 int index = resolved_method->vtable_index();
146 if (resolved_method->can_be_statically_bound()) {
147 kind = CallInfo::direct_call;
148 } else if (!resolved_method_holder->is_interface()) {
149 // Could be an Object method inherited into an interface, but still a vtable call.
150 kind = CallInfo::vtable_call;
|