33 #include "ci/ciKlass.hpp" |
33 #include "ci/ciKlass.hpp" |
34 #include "ci/ciMemberName.hpp" |
34 #include "ci/ciMemberName.hpp" |
35 #include "ci/ciUtilities.inline.hpp" |
35 #include "ci/ciUtilities.inline.hpp" |
36 #include "compiler/compileBroker.hpp" |
36 #include "compiler/compileBroker.hpp" |
37 #include "interpreter/bytecode.hpp" |
37 #include "interpreter/bytecode.hpp" |
|
38 #include "jfr/jfrEvents.hpp" |
38 #include "memory/resourceArea.hpp" |
39 #include "memory/resourceArea.hpp" |
39 #include "oops/oop.inline.hpp" |
40 #include "oops/oop.inline.hpp" |
40 #include "runtime/sharedRuntime.hpp" |
41 #include "runtime/sharedRuntime.hpp" |
41 #include "runtime/compilationPolicy.hpp" |
42 #include "runtime/compilationPolicy.hpp" |
42 #include "runtime/vm_version.hpp" |
43 #include "runtime/vm_version.hpp" |
4298 load->set_flag(Instruction::NeedsRangeCheckFlag, false); |
4299 load->set_flag(Instruction::NeedsRangeCheckFlag, false); |
4299 push(load->type(), load); |
4300 push(load->type(), load); |
4300 } |
4301 } |
4301 } |
4302 } |
4302 |
4303 |
|
4304 static void post_inlining_event(EventCompilerInlining* event, |
|
4305 int compile_id, |
|
4306 const char* msg, |
|
4307 bool success, |
|
4308 int bci, |
|
4309 ciMethod* caller, |
|
4310 ciMethod* callee) { |
|
4311 assert(caller != NULL, "invariant"); |
|
4312 assert(callee != NULL, "invariant"); |
|
4313 assert(event != NULL, "invariant"); |
|
4314 assert(event->should_commit(), "invariant"); |
|
4315 JfrStructCalleeMethod callee_struct; |
|
4316 callee_struct.set_type(callee->holder()->name()->as_utf8()); |
|
4317 callee_struct.set_name(callee->name()->as_utf8()); |
|
4318 callee_struct.set_descriptor(callee->signature()->as_symbol()->as_utf8()); |
|
4319 event->set_compileId(compile_id); |
|
4320 event->set_message(msg); |
|
4321 event->set_succeeded(success); |
|
4322 event->set_bci(bci); |
|
4323 event->set_caller(caller->get_Method()); |
|
4324 event->set_callee(callee_struct); |
|
4325 event->commit(); |
|
4326 } |
|
4327 |
4303 void GraphBuilder::print_inlining(ciMethod* callee, const char* msg, bool success) { |
4328 void GraphBuilder::print_inlining(ciMethod* callee, const char* msg, bool success) { |
4304 CompileLog* log = compilation()->log(); |
4329 CompileLog* log = compilation()->log(); |
4305 if (log != NULL) { |
4330 if (log != NULL) { |
4306 if (success) { |
4331 if (success) { |
4307 if (msg != NULL) |
4332 if (msg != NULL) |
4313 log->inline_fail(msg); |
4338 log->inline_fail(msg); |
4314 else |
4339 else |
4315 log->inline_fail("reason unknown"); |
4340 log->inline_fail("reason unknown"); |
4316 } |
4341 } |
4317 } |
4342 } |
4318 #if INCLUDE_TRACE |
|
4319 EventCompilerInlining event; |
4343 EventCompilerInlining event; |
4320 if (event.should_commit()) { |
4344 if (event.should_commit()) { |
4321 event.set_compileId(compilation()->env()->task()->compile_id()); |
4345 post_inlining_event(&event, compilation()->env()->task()->compile_id(), msg, success, bci(), method(), callee); |
4322 event.set_message(msg); |
4346 } |
4323 event.set_succeeded(success); |
|
4324 event.set_bci(bci()); |
|
4325 event.set_caller(method()->get_Method()); |
|
4326 event.set_callee(callee->to_trace_struct()); |
|
4327 event.commit(); |
|
4328 } |
|
4329 #endif // INCLUDE_TRACE |
|
4330 |
4347 |
4331 CompileTask::print_inlining_ul(callee, scope()->level(), bci(), msg); |
4348 CompileTask::print_inlining_ul(callee, scope()->level(), bci(), msg); |
4332 |
4349 |
4333 if (!compilation()->directive()->PrintInliningOption) { |
4350 if (!compilation()->directive()->PrintInliningOption) { |
4334 return; |
4351 return; |