callnode.hpp revision 196
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// Portions of code courtesy of Clifford Click 0N/A// Optimization - Graph Style 0N/A//------------------------------StartNode-------------------------------------- 0N/A// The method start node 0N/A virtual bool pinned()
const {
return true; };
0N/A//------------------------------StartOSRNode----------------------------------- 0N/A// The method start node for on stack replacement code 0N/A//------------------------------ParmNode--------------------------------------- 0N/A// Incoming parameters 0N/A//------------------------------ReturnNode------------------------------------- 0N/A// Return from subroutine node 0N/A//------------------------------RethrowNode------------------------------------ 0N/A// Rethrow of exception at call site. Ends a procedure before rethrowing; 0N/A// ends the current basic block like a ReturnNode. Restores registers and 0N/A// unwinds stack. Rethrow happens in the caller's method. 0N/A//------------------------------TailCallNode----------------------------------- 0N/A// Pop stack frame and jump indirect 0N/A//------------------------------TailJumpNode----------------------------------- 0N/A// Pop stack frame and jump indirect 0N/A//-------------------------------JVMState------------------------------------- 0N/A// A linked list of JVMState nodes captures the whole interpreter state, 0N/A// plus GC roots, for all active calls at some call site in this compilation 0N/A// unit. (If there is no inlining, then the list has exactly one link.) 0N/A// This provides a way to map the optimized program back into the interpreter, 0N/A// or to let the GC mark the stack. 0N/A uint _sp;
// Jave Expression Stack Pointer for this state 0N/A int _bci;
// Byte Code Index of this JVM point 0N/A // Because JVMState objects live over the entire lifetime of the 0N/A // Compile object, they are allocated into the comp_arena, which 0N/A // does not get resource marked or reset during the compile process 0N/A void operator delete(
void * ) { }
// fast deallocation 0N/A // Create a new JVMState, ready for abstract interpretation. 0N/A // Access functions for the JVM 0N/A // Returns the JVM state at the desired depth (1 == root). 0N/A // Tells if two JVM states have the same call chain (depth, methods, & bcis). 0N/A // Monitors (monitors are stored as (boxNode, objNode) pairs 0N/A // Initialization functions for the JVM 0N/A // Miscellaneous utility functions 0N/A//------------------------------SafePointNode---------------------------------- 0N/A// A SafePointNode is a subclass of a MultiNode for convenience (and 0N/A// potential code sharing) only - conceptually it is independent of 0N/A// the Node semantics. 0N/A // A plain safepoint advertises no memory effects (NULL): 0N/A // Many calls take *all* of memory as input, 0N/A // but some produce a limited subset of that memory as output. 0N/A // The adr_type reports the call's behavior as a store, not a load. 0N/A // Functionality from old debug nodes which has changed 0N/A // Handle monitor stack 0N/A // Access functions for the JVM 0N/A // The parser marks useless maps as dead when it's done with them: 0N/A // Exception states bubbling out of subgraphs such as inlined calls 0N/A // are recorded here. (There might be more than one, hence the "next".) 0N/A // This feature is used only for safepoints which serve as "maps" 0N/A // for JVM states during parsing, intrinsic expansion, etc. 0N/A // Standard Node stuff 63N/A//------------------------------SafePointScalarObjectNode---------------------- 63N/A// A SafePointScalarObjectNode represents the state of a scalarized object 63N/A // states of the scalarized object fields are collected. 63N/A // Assumes that "this" is an argument to a safepoint node "s", and that 63N/A // "new_call" is being created to correspond to "s". But the difference 63N/A // between the start index of the jvmstates of "new_call" and "s" is 63N/A // "jvms_adj". Produce and return a SafePointScalarObjectNode that 63N/A // corresponds appropriately to "this" in "new_call". Assumes that 63N/A // "sosn_map" is a map, specific to the translation of "s" to "new_call", 63N/A // mapping old SafePointScalarObjectNodes to new, to avoid multiple copies. 0N/A//------------------------------CallNode--------------------------------------- 0N/A// Call nodes now subsume the function of debug nodes at callsites, so they 0N/A// contain the functionality of a full scope chain of debug nodes. 0N/A float _cnt;
// Estimate of number of times called 0N/A // Are we guaranteed that this node is a safepoint? Not true for leaf calls and 0N/A // for some macro nodes whose expansion does not have a safepoint on the fast path. 0N/A // For macro nodes, the JVMState gets modified during expansion, so when cloning 0N/A // the node the JVMState must be cloned. 65N/A // Returns true if the call may modify n 65N/A // Does this node have a use of n other than in debug information? 65N/A // Returns the unique CheckCastPP of a call 65N/A // or result projection is there are several CheckCastPP 65N/A // or returns NULL if there is no one. 0N/A//------------------------------CallJavaNode----------------------------------- 0N/A// Make a static or dynamic subroutine call node using Java calling 0N/A// convention. (The "Java" calling convention is the compiler's calling 0N/A// convention, as opposed to the interpreter's or that of native C.) 0N/A const int _bci;
// Byte Code Index of call byte code 0N/A//------------------------------CallStaticJavaNode----------------------------- 0N/A// Make a direct subroutine call using Java calling convention (for static 0N/A// calls and optimized virtual calls, plus calls to wrappers for run-time 0N/A// routines); generates static stub. 0N/A // This node calls a runtime stub, which often has narrow memory effects. 0N/A const char *
_name;
// Runtime wrapper name 0N/A // If this is an uncommon trap, return the request code, else zero. 0N/A//------------------------------CallDynamicJavaNode---------------------------- 0N/A// Make a dispatched call using Java calling convention. 0N/A//------------------------------CallRuntimeNode-------------------------------- 0N/A// Make a direct subroutine call node into compiled C++ code. 0N/A const char *
_name;
// Printable name, if _method is NULL 0N/A//------------------------------CallLeafNode----------------------------------- 0N/A// Make a direct subroutine call node into compiled C++ code, without 0N/A//------------------------------CallLeafNoFPNode------------------------------- 0N/A// CallLeafNode, not using floating point or using it in the same manner as 0N/A// the generated code 0N/A//------------------------------Allocate--------------------------------------- 0N/A// High-level memory allocation 0N/A// AllocateNode and AllocateArrayNode are subclasses of CallNode because they will 0N/A// get expanded into a code sequence containing a call. Unlike other CallNodes, 0N/A// they have 2 memory projections and 2 i_o projections (which are distinguished by 0N/A// the _is_io_use flag in the projection.) This is needed when expanding the node in 0N/A// order to differentiate the uses of the projection on the normal control path from 0N/A// those on the exception return path. 0N/A // create result type (range) 0N/A // Expansion modifies the JVMState, so we need to clone it 65N/A // allocations do not modify their arguments 0N/A // Pattern-match a possible usage of AllocateNode. 0N/A // Return null if no allocation is recognized. 0N/A // The operand is the pointer produced by the (possible) allocation. 0N/A // It must be a projection of the Allocate or its subsequent CastPP. 0N/A // The 'ptr' may not have an offset unless the 'offset' argument is given. 0N/A // Fancy version which uses AddPNode::Ideal_base_and_offset to strip 0N/A // an offset, which is reported back to the caller. 0N/A // Dig the klass operand out of a (possible) allocation site. 0N/A // Conservatively small estimate of offset of first non-header byte. 0N/A // Return the corresponding initialization barrier (or null if none). 0N/A // Walks out edges to find it... 0N/A // (Note: Both InitializeNode::allocation and AllocateNode::initialization 0N/A // Convenience for initialization->maybe_set_complete(phase) 0N/A//------------------------------AllocateArray--------------------------------- 0N/A// High-level array allocation 0N/A // Pattern-match a possible usage of AllocateArrayNode. 0N/A // Return null if no allocation is recognized. 0N/A // Dig the length operand out of a (possible) array allocation site. 0N/A//------------------------------AbstractLockNode----------------------------------- 0N/A // helper functions for lock elimination 0N/A // mark node as eliminated and update the counter if there is one 65N/A // locking does not modify its arguments 0N/A//------------------------------Lock--------------------------------------- 0N/A// High-level lock operation 0N/A// This is a subclass of CallNode because it is a macro node which gets expanded 0N/A// into a code sequence containing a call. This node takes 3 "parameters": 0N/A// 0 - object to lock 0N/A// 2 - a FastLockNode 0N/A // create input type (domain) 0N/A // create result type (range) 0N/A // Expansion modifies the JVMState, so we need to clone it 0N/A//------------------------------Unlock--------------------------------------- 0N/A// High-level unlock operation 0N/A // unlock is never a safepoint