src/share/vm/opto/bytecodeInfo.cpp

Print this page
rev 13113 : 8182651: Add TRACE_ONLY conditional macro to support more fine-grained INCLUDE_TRACE programming
Reviewed-by:

*** 1,7 **** /* ! * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 32,41 **** --- 32,46 ---- #include "oops/objArrayKlass.hpp" #include "opto/callGenerator.hpp" #include "opto/parse.hpp" #include "runtime/handles.inline.hpp" #include "utilities/events.hpp" + #include "utilities/macros.hpp" + #if INCLUDE_TRACE + #include "trace/tracing.hpp" + #include "tracefiles/traceEventClasses.hpp" + #endif //============================================================================= //------------------------------InlineTree------------------------------------- InlineTree::InlineTree(Compile* c, const InlineTree *caller_tree, ciMethod* callee,
*** 482,491 **** --- 487,523 ---- if (!callee->has_balanced_monitors()) return "not compilable (unbalanced monitors)"; if ( callee->get_flow_analysis()->failing()) return "not compilable (flow analysis failed)"; return NULL; } + #if INCLUDE_TRACE + static void post_inlining_event(int compile_id, + const char* msg, + bool success, + int bci, + ciMethod* caller, + ciMethod* callee) { + assert(caller != NULL, "invariant"); + assert(callee != NULL, "invariant"); + + EventCompilerInlining event; + if (event.should_commit()) { + TraceStructCalleeMethod callee_struct; + callee_struct.set_type(callee->holder()->name()->as_utf8()); + callee_struct.set_name(callee->name()->as_utf8()); + callee_struct.set_descriptor(callee->signature()->as_symbol()->as_utf8()); + event.set_compileId(compile_id); + event.set_message(msg); + event.set_succeeded(success); + event.set_bci(bci); + event.set_caller(caller->get_Method()); + event.set_callee(callee_struct); + event.commit(); + } + } + #endif // INCLUDE_TRACE + //------------------------------print_inlining--------------------------------- void InlineTree::print_inlining(ciMethod* callee_method, int caller_bci, ciMethod* caller_method, bool success) const { const char* inline_msg = msg(); assert(inline_msg != NULL, "just checking");
*** 505,526 **** const InlineTree *top = this; while( top->caller_tree() != NULL ) { top = top->caller_tree(); } //tty->print(" bcs: %d+%d invoked: %d", top->count_inline_bcs(), callee_method->code_size(), callee_method->interpreter_invocation_count()); } } ! #if INCLUDE_TRACE ! EventCompilerInlining event; ! if (event.should_commit()) { ! event.set_compileId(C->compile_id()); ! event.set_message(inline_msg); ! event.set_succeeded(success); ! event.set_bci(caller_bci); ! event.set_caller(caller_method->get_Method()); ! event.set_callee(callee_method->to_trace_struct()); ! event.commit(); ! } ! #endif // INCLUDE_TRACE } //------------------------------ok_to_inline----------------------------------- WarmCallInfo* InlineTree::ok_to_inline(ciMethod* callee_method, JVMState* jvms, ciCallProfile& profile, WarmCallInfo* initial_wci, bool& should_delay) { assert(callee_method != NULL, "caller checks for optimized virtual!"); --- 537,552 ---- const InlineTree *top = this; while( top->caller_tree() != NULL ) { top = top->caller_tree(); } //tty->print(" bcs: %d+%d invoked: %d", top->count_inline_bcs(), callee_method->code_size(), callee_method->interpreter_invocation_count()); } } ! TRACE_ONLY(post_inlining_event(C->compile_id(), ! inline_msg, ! success, ! caller_bci, ! caller_method, ! callee_method);) } //------------------------------ok_to_inline----------------------------------- WarmCallInfo* InlineTree::ok_to_inline(ciMethod* callee_method, JVMState* jvms, ciCallProfile& profile, WarmCallInfo* initial_wci, bool& should_delay) { assert(callee_method != NULL, "caller checks for optimized virtual!");