64 ciMethodData* _method_data;
65 ciMethodBlocks* _method_blocks;
66
67 // Code attributes.
68 int _code_size;
69 int _max_stack;
70 int _max_locals;
71 vmIntrinsics::ID _intrinsic_id;
72 int _handler_count;
73 int _nmethod_age;
74 int _interpreter_invocation_count;
75 int _interpreter_throwout_count;
76 int _instructions_size;
77 int _size_of_parameters;
78
79 bool _uses_monitors;
80 bool _balanced_monitors;
81 bool _is_c1_compilable;
82 bool _is_c2_compilable;
83 bool _can_be_statically_bound;
84 bool _has_injected_profile;
85
86 // Lazy fields, filled in on demand
87 address _code;
88 ciExceptionHandler** _exception_handlers;
89
90 // Optional liveness analyzer.
91 MethodLiveness* _liveness;
92 #if defined(COMPILER2) || defined(SHARK)
93 ciTypeFlow* _flow;
94 BCEscapeAnalyzer* _bcea;
95 #endif
96
97 ciMethod(methodHandle h_m, ciInstanceKlass* holder);
98 ciMethod(ciInstanceKlass* holder, ciSymbol* name, ciSymbol* signature, ciInstanceKlass* accessor);
99
100 oop loader() const { return _holder->loader(); }
101
102 const char* type_string() { return "ciMethod"; }
103
104 void print_impl(outputStream* st);
162
163 // Method code and related information.
164 address code() { if (_code == NULL) load_code(); return _code; }
165 int code_size() const { check_is_loaded(); return _code_size; }
166 int max_stack() const { check_is_loaded(); return _max_stack; }
167 int max_locals() const { check_is_loaded(); return _max_locals; }
168 vmIntrinsics::ID intrinsic_id() const { check_is_loaded(); return _intrinsic_id; }
169 bool has_exception_handlers() const { check_is_loaded(); return _handler_count > 0; }
170 int exception_table_length() const { check_is_loaded(); return _handler_count; }
171 int interpreter_invocation_count() const { check_is_loaded(); return _interpreter_invocation_count; }
172 int interpreter_throwout_count() const { check_is_loaded(); return _interpreter_throwout_count; }
173 int size_of_parameters() const { check_is_loaded(); return _size_of_parameters; }
174 int nmethod_age() const { check_is_loaded(); return _nmethod_age; }
175
176 // Should the method be compiled with an age counter?
177 bool profile_aging() const;
178
179 // Code size for inlining decisions.
180 int code_size_for_inlining();
181
182 bool caller_sensitive() { return get_Method()->caller_sensitive(); }
183 bool force_inline() { return get_Method()->force_inline(); }
184 bool dont_inline() { return get_Method()->dont_inline(); }
185
186 int comp_level();
187 int highest_osr_comp_level();
188
189 Bytecodes::Code java_code_at_bci(int bci) {
190 address bcp = code() + bci;
191 return Bytecodes::java_code_at(NULL, bcp);
192 }
193 Bytecodes::Code raw_code_at_bci(int bci) {
194 address bcp = code() + bci;
195 return Bytecodes::code_at(NULL, bcp);
196 }
197 BCEscapeAnalyzer *get_bcea();
198 ciMethodBlocks *get_method_blocks();
199
200 bool has_linenumber_table() const; // length unknown until decompression
201 u_char* compressed_linenumber_table() const; // not preserved by gc
202
203 int line_number_from_bci(int bci) const;
204
272 bool should_print_assembly();
273 bool break_at_execute();
274 bool has_option(const char *option);
275 template<typename T>
276 bool has_option_value(const char* option, T& value);
277 bool can_be_compiled();
278 bool can_be_osr_compiled(int entry_bci);
279 void set_not_compilable(const char* reason = NULL);
280 bool has_compiled_code();
281 void log_nmethod_identity(xmlStream* log);
282 bool is_not_reached(int bci);
283 bool was_executed_more_than(int times);
284 bool has_unloaded_classes_in_signature();
285 bool is_klass_loaded(int refinfo_index, bool must_be_resolved) const;
286 bool check_call(int refinfo_index, bool is_static) const;
287 bool ensure_method_data(); // make sure it exists in the VM also
288 MethodCounters* ensure_method_counters();
289 int instructions_size();
290 int scale_count(int count, float prof_factor = 1.); // make MDO count commensurate with IIC
291
292 bool has_injected_profile() const { return _has_injected_profile; }
293 void set_injected_profile(bool x) { _has_injected_profile = x; }
294
295 // Stack walking support
296 bool is_ignored_by_security_stack_walk() const;
297
298 // JSR 292 support
299 bool is_method_handle_intrinsic() const;
300 bool is_compiled_lambda_form() const;
301 bool has_member_arg() const;
302
303 // What kind of ciObject is this?
304 bool is_method() const { return true; }
305
306 // Java access flags
307 bool is_public () const { return flags().is_public(); }
308 bool is_private () const { return flags().is_private(); }
309 bool is_protected () const { return flags().is_protected(); }
310 bool is_static () const { return flags().is_static(); }
311 bool is_final () const { return flags().is_final(); }
312 bool is_synchronized() const { return flags().is_synchronized(); }
313 bool is_native () const { return flags().is_native(); }
314 bool is_interface () const { return flags().is_interface(); }
|
64 ciMethodData* _method_data;
65 ciMethodBlocks* _method_blocks;
66
67 // Code attributes.
68 int _code_size;
69 int _max_stack;
70 int _max_locals;
71 vmIntrinsics::ID _intrinsic_id;
72 int _handler_count;
73 int _nmethod_age;
74 int _interpreter_invocation_count;
75 int _interpreter_throwout_count;
76 int _instructions_size;
77 int _size_of_parameters;
78
79 bool _uses_monitors;
80 bool _balanced_monitors;
81 bool _is_c1_compilable;
82 bool _is_c2_compilable;
83 bool _can_be_statically_bound;
84
85 // Lazy fields, filled in on demand
86 address _code;
87 ciExceptionHandler** _exception_handlers;
88
89 // Optional liveness analyzer.
90 MethodLiveness* _liveness;
91 #if defined(COMPILER2) || defined(SHARK)
92 ciTypeFlow* _flow;
93 BCEscapeAnalyzer* _bcea;
94 #endif
95
96 ciMethod(methodHandle h_m, ciInstanceKlass* holder);
97 ciMethod(ciInstanceKlass* holder, ciSymbol* name, ciSymbol* signature, ciInstanceKlass* accessor);
98
99 oop loader() const { return _holder->loader(); }
100
101 const char* type_string() { return "ciMethod"; }
102
103 void print_impl(outputStream* st);
161
162 // Method code and related information.
163 address code() { if (_code == NULL) load_code(); return _code; }
164 int code_size() const { check_is_loaded(); return _code_size; }
165 int max_stack() const { check_is_loaded(); return _max_stack; }
166 int max_locals() const { check_is_loaded(); return _max_locals; }
167 vmIntrinsics::ID intrinsic_id() const { check_is_loaded(); return _intrinsic_id; }
168 bool has_exception_handlers() const { check_is_loaded(); return _handler_count > 0; }
169 int exception_table_length() const { check_is_loaded(); return _handler_count; }
170 int interpreter_invocation_count() const { check_is_loaded(); return _interpreter_invocation_count; }
171 int interpreter_throwout_count() const { check_is_loaded(); return _interpreter_throwout_count; }
172 int size_of_parameters() const { check_is_loaded(); return _size_of_parameters; }
173 int nmethod_age() const { check_is_loaded(); return _nmethod_age; }
174
175 // Should the method be compiled with an age counter?
176 bool profile_aging() const;
177
178 // Code size for inlining decisions.
179 int code_size_for_inlining();
180
181 bool caller_sensitive() const { return get_Method()->caller_sensitive(); }
182 bool force_inline() const { return get_Method()->force_inline(); }
183 bool dont_inline() const { return get_Method()->dont_inline(); }
184
185 int comp_level();
186 int highest_osr_comp_level();
187
188 Bytecodes::Code java_code_at_bci(int bci) {
189 address bcp = code() + bci;
190 return Bytecodes::java_code_at(NULL, bcp);
191 }
192 Bytecodes::Code raw_code_at_bci(int bci) {
193 address bcp = code() + bci;
194 return Bytecodes::code_at(NULL, bcp);
195 }
196 BCEscapeAnalyzer *get_bcea();
197 ciMethodBlocks *get_method_blocks();
198
199 bool has_linenumber_table() const; // length unknown until decompression
200 u_char* compressed_linenumber_table() const; // not preserved by gc
201
202 int line_number_from_bci(int bci) const;
203
271 bool should_print_assembly();
272 bool break_at_execute();
273 bool has_option(const char *option);
274 template<typename T>
275 bool has_option_value(const char* option, T& value);
276 bool can_be_compiled();
277 bool can_be_osr_compiled(int entry_bci);
278 void set_not_compilable(const char* reason = NULL);
279 bool has_compiled_code();
280 void log_nmethod_identity(xmlStream* log);
281 bool is_not_reached(int bci);
282 bool was_executed_more_than(int times);
283 bool has_unloaded_classes_in_signature();
284 bool is_klass_loaded(int refinfo_index, bool must_be_resolved) const;
285 bool check_call(int refinfo_index, bool is_static) const;
286 bool ensure_method_data(); // make sure it exists in the VM also
287 MethodCounters* ensure_method_counters();
288 int instructions_size();
289 int scale_count(int count, float prof_factor = 1.); // make MDO count commensurate with IIC
290
291 // Stack walking support
292 bool is_ignored_by_security_stack_walk() const;
293
294 // JSR 292 support
295 bool is_method_handle_intrinsic() const;
296 bool is_compiled_lambda_form() const;
297 bool has_member_arg() const;
298
299 // What kind of ciObject is this?
300 bool is_method() const { return true; }
301
302 // Java access flags
303 bool is_public () const { return flags().is_public(); }
304 bool is_private () const { return flags().is_private(); }
305 bool is_protected () const { return flags().is_protected(); }
306 bool is_static () const { return flags().is_static(); }
307 bool is_final () const { return flags().is_final(); }
308 bool is_synchronized() const { return flags().is_synchronized(); }
309 bool is_native () const { return flags().is_native(); }
310 bool is_interface () const { return flags().is_interface(); }
|