src/share/vm/c1/c1_GraphBuilder.cpp

changeset 9931
fd44df5e3bc3
parent 9174
e68eb4b91646
parent 9858
b985cbb00e68
child 10015
eb7ce841ccec
equal deleted inserted replaced
9855:274a1ea904c8 9931:fd44df5e3bc3
32 #include "ci/ciField.hpp" 32 #include "ci/ciField.hpp"
33 #include "ci/ciKlass.hpp" 33 #include "ci/ciKlass.hpp"
34 #include "ci/ciMemberName.hpp" 34 #include "ci/ciMemberName.hpp"
35 #include "compiler/compileBroker.hpp" 35 #include "compiler/compileBroker.hpp"
36 #include "interpreter/bytecode.hpp" 36 #include "interpreter/bytecode.hpp"
37 #include "jfr/jfrEvents.hpp"
37 #include "runtime/sharedRuntime.hpp" 38 #include "runtime/sharedRuntime.hpp"
38 #include "runtime/compilationPolicy.hpp" 39 #include "runtime/compilationPolicy.hpp"
39 #include "utilities/bitMap.inline.hpp" 40 #include "utilities/bitMap.inline.hpp"
40 41
41 class BlockListBuilder VALUE_OBJ_CLASS_SPEC { 42 class BlockListBuilder VALUE_OBJ_CLASS_SPEC {
3463 // Return false for mips since LIR_Assembler::emit_arraycopy isn't implemented yet. 3464 // Return false for mips since LIR_Assembler::emit_arraycopy isn't implemented yet.
3464 return false; 3465 return false;
3465 #endif 3466 #endif
3466 break; 3467 break;
3467 3468
3468 #ifdef TRACE_HAVE_INTRINSICS 3469 #ifdef JFR_HAVE_INTRINSICS
3469 case vmIntrinsics::_classID: 3470 #if defined(_LP64) || !defined(TRACE_ID_CLASS_SHIFT)
3470 case vmIntrinsics::_threadID: 3471 case vmIntrinsics::_getClassId:
3471 preserves_state = true; 3472 preserves_state = false;
3473 cantrap = false;
3474 break;
3475 #endif
3476
3477 case vmIntrinsics::_getEventWriter:
3478 preserves_state = false;
3472 cantrap = true; 3479 cantrap = true;
3473 break; 3480 break;
3474 3481
3475 case vmIntrinsics::_counterTime: 3482 case vmIntrinsics::_counterTime:
3476 preserves_state = true; 3483 preserves_state = true;
4399 push(result_type, result); 4406 push(result_type, result);
4400 compilation()->set_has_unsafe_access(true); 4407 compilation()->set_has_unsafe_access(true);
4401 } 4408 }
4402 4409
4403 4410
4411 static void post_inlining_event(EventCompilerInlining* event,
4412 int compile_id,
4413 const char* msg,
4414 bool success,
4415 int bci,
4416 ciMethod* caller,
4417 ciMethod* callee) {
4418 assert(caller != NULL, "invariant");
4419 assert(callee != NULL, "invariant");
4420 assert(event != NULL, "invariant");
4421 assert(event->should_commit(), "invariant");
4422 JfrStructCalleeMethod callee_struct;
4423 callee_struct.set_type(callee->holder()->name()->as_utf8());
4424 callee_struct.set_name(callee->name()->as_utf8());
4425 callee_struct.set_descriptor(callee->signature()->as_symbol()->as_utf8());
4426 event->set_compileId(compile_id);
4427 event->set_message(msg);
4428 event->set_succeeded(success);
4429 event->set_bci(bci);
4430 event->set_caller(caller->get_Method());
4431 event->set_callee(callee_struct);
4432 event->commit();
4433 }
4434
4404 void GraphBuilder::print_inlining(ciMethod* callee, const char* msg, bool success) { 4435 void GraphBuilder::print_inlining(ciMethod* callee, const char* msg, bool success) {
4405 CompileLog* log = compilation()->log(); 4436 CompileLog* log = compilation()->log();
4406 if (log != NULL) { 4437 if (log != NULL) {
4407 if (success) { 4438 if (success) {
4408 if (msg != NULL) 4439 if (msg != NULL)
4415 else 4446 else
4416 log->inline_fail("reason unknown"); 4447 log->inline_fail("reason unknown");
4417 } 4448 }
4418 } 4449 }
4419 4450
4451 EventCompilerInlining event;
4452 if (event.should_commit()) {
4453 post_inlining_event(&event, compilation()->env()->task()->compile_id(), msg, success, bci(), method(), callee);
4454 }
4455
4420 if (!PrintInlining && !compilation()->method()->has_option("PrintInlining")) { 4456 if (!PrintInlining && !compilation()->method()->has_option("PrintInlining")) {
4421 return; 4457 return;
4422 } 4458 }
4423 CompileTask::print_inlining(callee, scope()->level(), bci(), msg); 4459 CompileTask::print_inlining(callee, scope()->level(), bci(), msg);
4424 if (success && CIPrintMethodCodes) { 4460 if (success && CIPrintMethodCodes) {

mercurial