parse.hpp revision 435
196N/A * Copyright 1997-2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 0N/A * CA 95054 USA or visit www.sun.com if you need additional information or 0N/A * have any questions. 0N/A//------------------------------InlineTree------------------------------------- 0N/A // Call-site count / interpreter invocation count, scaled recursively. 0N/A // Always between 0.0 and 1.0. Represents the percentage of the method's 0N/A // total execution time used at this call site. 0N/A // For temporary (stack-allocated, stateless) ilts: 0N/A // See if it is OK to inline. 0N/A // The reciever is the inline tree for the caller. 0N/A // The result is a temperature indication. If it is hot or cold, 0N/A // inlining is immediate or undesirable. Otherwise, the info block 0N/A // returned is newly allocated and may be enqueued. 0N/A // If the method is inlinable, a new inline subtree is created on the fly, 0N/A // and may be accessed by find_subtree_from_root. 0N/A // The call_method is the dest_method for a special or static invocation. 0N/A // The call_method is an optimized virtual method candidate otherwise. 0N/A // Information about inlined method 0N/A // Debug information collected during parse 0N/A//----------------------------------------------------------------------------- 0N/A//------------------------------Parse------------------------------------------ 0N/A// Parse bytecodes, build a Graph 0N/A // Per-block information needed by the parser: 0N/A uint _count;
// how many times executed? Currently only set by _goto's 0N/A // Block() : _live_locals((uintptr_t*)NULL,0) { ShouldNotReachHere(); } 0N/A // Set up the block data structure itself. 0N/A // Set up the block's relations to other blocks. 0N/A // True after any predecessor flows control into this block 0N/A // True when all non-exception predecessors have been parsed. 0N/A // Call this just before parsing a block. 0N/A // Return the phi/region input index for the "current" pred, 0N/A // and bump the pred number. For historical reasons these index 0N/A // numbers are handed out in descending order. The last index is 0N/A // always PhiNode::Input (i.e., 1). The value returned is known 0N/A // as a "path number" because it distinguishes by which path we are 0N/A // entering the block. 0N/A // Add a previously unaccounted predecessor to this block. 0N/A // This operates by increasing the size of the block's region 0N/A // and all its phi nodes (if any). The value returned is a 0N/A // path number ("pnum"). 0N/A // Initialize me by recording the parser's map. My own map must be NULL. 0N/A // BytecodeParseHistogram collects number of bytecodes parsed, nodes constructed, and transformations. 0N/A // Return info being collected, select with global flag 'BytecodeParseInfo' 0N/A // Record info when starting to parse one bytecode 0N/A // Record results of parsing one bytecode 0N/A // Record work done during parsing 0N/A // Variables which characterize this compilation as a whole: 0N/A int _depth;
// Inline tree depth, for debug printouts 0N/A // Variables which track Java semantics during bytecode parsing: 0N/A // entry_bci() -- see osr_bci, etc. 367N/A // blocks() -- see rpo_at, start_block, etc. 0N/A // Derived accessors: 0N/A // Must this parse be aborted? 0N/A // Can return NULL if the flow pass did not complete a block. 0N/A // Create a JVMS & map for the initial state of this method. 0N/A // Functions for managing basic blocks: 0N/A // Parse all the basic blocks. 0N/A // Parse the current basic block 0N/A // Raise an error if we get a bad ciTypeFlow CFG. 0N/A // first actions (before BCI 0) 0N/A // Eagerly create phie throughout the state, to cope with back edges. 0N/A // Merge the current mapping into the basic block starting at bci 0N/A // Same as plain merge, except that it allocates a new path number. 0N/A // Merge the current mapping into an exception handler. 0N/A // Helper: Merge the current mapping into the given basic block 0N/A // Helper functions for merging individual cells. 0N/A // Helper to merge the current memory state into the given basic block 0N/A // Parse this bytecode, and alter the Parsers JVM->Node mapping 0N/A // helper function to generate array store check 0N/A // Helper function to generate array load 0N/A // Helper function to generate array store 0N/A // Helper function to compute array addressing 0N/A // Pass current map to exits 0N/A // Register finalizers on return from Object.<init> 0N/A // Insert a compiler safepoint into the graph 0N/A // Insert a compiler safepoint into the graph, if there is a back-branch. 0N/A // Helper function to setup Ideal Call nodes 0N/A // Helper function to uncommon-trap or bailout for non-compilable call-sites 0N/A // Helper function to identify inlining potential at call-site 0N/A // Helper function to setup for type-profile based inlining 0N/A // Helper functions for type checking bytecodes: 0N/A // Helper functions for shifting & arithmetic 0N/A // implementation of _get* and _put* bytecodes 0N/A // common code for making initial checks and forming addresses 0N/A // common code for actually performing the load or store 0N/A // loading from a constant field or the constant pool 0N/A // returns false if push failed (non-perm field constants only, not ldcs) 0N/A // implementation of object creation bytecodes 0N/A // helper functions for methodData style profiling 0N/A // helper function for call statistics 0N/A // Helper functions for handling normal and abnormal exits. 0N/A // Fix up all exceptional control flow exiting a single bytecode. 0N/A // Fix up all exiting control flow at the end of the parse. 0N/A // The call is either a Java call or the VM's rethrow stub 0N/A // Handle all exceptions thrown by the inlined method. 0N/A // Also handles exceptions for individual bytecodes. 0N/A // Bytecode classifier, helps decide to use uncommon_trap vs. rethrow_C. 0N/A // Merge the given map into correct exceptional exit state. 0N/A // Assumes that there is no applicable local handler. 0N/A // Handle PrintOpto, etc.