bytecodeInfo.cpp revision 1472
0N/A * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 0N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A#
include "incls/_precompiled.incl" 0N/A//============================================================================= 0N/A//------------------------------InlineTree------------------------------------- 0N/A // Keep a private copy of the caller_jvms: // Update hierarchical counts, count_inline_bcs() and count_inlines() // True when EA is ON and a java constructor is called or // a super constructor is called from an inlined java constructor. // positive filter: should send be inlined? returns NULL, if yes, or rejection msg // Allows targeted inlining // positive filter: should send be inlined? returns NULL (--> yes) // Check for too many throws (and not too huge) return NULL;
// size and frequency are represented in a new way // bump the max size if the call is frequent // Not hot. Check for medium-sized pre-existing nmethod at cold sites. return "already compiled into a medium method";
return "hot method too big";
// negative filter: should send NOT be inlined? returns NULL, ok to inline, or rejection msg // negative filter: should send NOT be inlined? returns NULL (--> inline) or rejection msg // note: we allow ik->is_abstract() // don't inline exception code unless the top method belongs to an // %%% adjust wci_result->size()? // Always inline MethodHandle methods. // First check all inlining restrictions which are required for correctness // note: we allow ik->is_abstract() // ignore heuristic controls on inlining // Now perform checks which are heuristic return "already compiled into a big method";
// don't inline exception code unless the top method belongs to an return "exception method";
// use frequency-based objections only for non-trivial methods // don't use counts with -Xcomp or CTW // Escape Analysis: inline all executed constructors return "executed < MinInliningThreshold times";
return "disallowed by CompilerOracle";
// Do not inline StringCache::profile() method used only at the beginning. return "profiling method";
//-----------------------------try_to_inline----------------------------------- // return NULL if ok, reason for not inlining otherwise // Relocated from "InliningClosure::try_to_inline" // Old algorithm had funny accumulating BC-size counters return "size > DesiredMethodLimit";
// accessor methods are not subject to any of the following limits. // suppress a few checks for accessors and trivial methods // don't inline into giant methods return "NodeCountInliningCutoff";
// Escape Analysis stress testing when running Xcomp or CTW: // inline constructors even if they are not reached. // don't inline unreached call sites return "call site not reached";
return "not an accessor";
return "inlining too deep";
return "recursively inlining too deep";
return "size > DesiredMethodLimit";
// ok, inline this method //------------------------------pass_initial_checks---------------------------- // Check if a callee_method was suggested // Check if klass of callee_method is loaded // Checks that constant pool's call site has been visited // stricter than callee_holder->is_initialized() // An invokedynamic instruction does not have a klass. // Try to do constant pool resolution if running Xcomp // We will attempt to see if a class/field/etc got properly loaded. If it // did not, it may attempt to throw an exception during our probing. Catch // and ignore such exceptions and do not attempt to compile the method. //------------------------------print_inlining--------------------------------- // Really, the failure_msg can be a success message also. else tty->
print(
" callee not monotonic or profiled");
//------------------------------ok_to_inline----------------------------------- // Make sure the incoming jvms has the same information content as me. // This means that we can eventually make this whole class AllStatic. // Check if inlining policy says no. tty->
print(
" OldInlining= %4s : %s\n WCI=",
// Do not inline the warm calls. // In -UseOldInlining, the failure_msg may also be a success message. //------------------------------compute_callee_frequency----------------------- // Call-site count / interpreter invocation count, scaled recursively. // Always between 0.0 and 1.0. Represents the percentage of the method's // total execution time used at this call site. //------------------------------build_inline_tree_for_callee------------------- C->
log()->
elem(
"inline_depth_discount caller='%d' callee='%d'",
id1,
id2);
//---------------------------------------callee_at----------------------------- //------------------------------build_inline_tree_root------------------------- //-------------------------find_subtree_from_root----------------------------- // Given a jvms, which determines a call chain from the root method, // find the corresponding inline tree. // Note: This method will be removed or replaced as InlineTree goes away. // Select the corresponding subtree for this bci.