1.1 --- a/src/share/vm/c1/c1_GraphBuilder.cpp Thu Aug 01 03:44:03 2019 +0100 1.2 +++ b/src/share/vm/c1/c1_GraphBuilder.cpp Mon Aug 12 18:30:40 2019 +0300 1.3 @@ -34,6 +34,7 @@ 1.4 #include "ci/ciMemberName.hpp" 1.5 #include "compiler/compileBroker.hpp" 1.6 #include "interpreter/bytecode.hpp" 1.7 +#include "jfr/jfrEvents.hpp" 1.8 #include "runtime/sharedRuntime.hpp" 1.9 #include "runtime/compilationPolicy.hpp" 1.10 #include "utilities/bitMap.inline.hpp" 1.11 @@ -3460,10 +3461,16 @@ 1.12 if (!InlineArrayCopy) return false; 1.13 break; 1.14 1.15 -#ifdef TRACE_HAVE_INTRINSICS 1.16 - case vmIntrinsics::_classID: 1.17 - case vmIntrinsics::_threadID: 1.18 - preserves_state = true; 1.19 +#ifdef JFR_HAVE_INTRINSICS 1.20 +#if defined(_LP64) || !defined(TRACE_ID_CLASS_SHIFT) 1.21 + case vmIntrinsics::_getClassId: 1.22 + preserves_state = false; 1.23 + cantrap = false; 1.24 + break; 1.25 +#endif 1.26 + 1.27 + case vmIntrinsics::_getEventWriter: 1.28 + preserves_state = false; 1.29 cantrap = true; 1.30 break; 1.31 1.32 @@ -4396,6 +4403,30 @@ 1.33 } 1.34 1.35 1.36 +static void post_inlining_event(EventCompilerInlining* event, 1.37 + int compile_id, 1.38 + const char* msg, 1.39 + bool success, 1.40 + int bci, 1.41 + ciMethod* caller, 1.42 + ciMethod* callee) { 1.43 + assert(caller != NULL, "invariant"); 1.44 + assert(callee != NULL, "invariant"); 1.45 + assert(event != NULL, "invariant"); 1.46 + assert(event->should_commit(), "invariant"); 1.47 + JfrStructCalleeMethod callee_struct; 1.48 + callee_struct.set_type(callee->holder()->name()->as_utf8()); 1.49 + callee_struct.set_name(callee->name()->as_utf8()); 1.50 + callee_struct.set_descriptor(callee->signature()->as_symbol()->as_utf8()); 1.51 + event->set_compileId(compile_id); 1.52 + event->set_message(msg); 1.53 + event->set_succeeded(success); 1.54 + event->set_bci(bci); 1.55 + event->set_caller(caller->get_Method()); 1.56 + event->set_callee(callee_struct); 1.57 + event->commit(); 1.58 +} 1.59 + 1.60 void GraphBuilder::print_inlining(ciMethod* callee, const char* msg, bool success) { 1.61 CompileLog* log = compilation()->log(); 1.62 if (log != NULL) { 1.63 @@ -4412,6 +4443,11 @@ 1.64 } 1.65 } 1.66 1.67 + EventCompilerInlining event; 1.68 + if (event.should_commit()) { 1.69 + post_inlining_event(&event, compilation()->env()->task()->compile_id(), msg, success, bci(), method(), callee); 1.70 + } 1.71 + 1.72 if (!PrintInlining && !compilation()->method()->has_option("PrintInlining")) { 1.73 return; 1.74 }