callnode.hpp revision 4312
2976N/A * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 2976N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 2976N/A * This code is free software; you can redistribute it and/or modify it 2976N/A * under the terms of the GNU General Public License version 2 only, as 2976N/A * published by the Free Software Foundation. 2976N/A * This code is distributed in the hope that it will be useful, but WITHOUT 2976N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 2976N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 2976N/A * version 2 for more details (a copy is included in the LICENSE file that 2976N/A * You should have received a copy of the GNU General Public License version 2976N/A * 2 along with this work; if not, write to the Free Software Foundation, 2976N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2976N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 3824N/A// Portions of code courtesy of Clifford Click 3824N/A// Optimization - Graph Style 2976N/A//------------------------------StartNode-------------------------------------- 3262N/A//------------------------------StartOSRNode----------------------------------- 2976N/A// The method start node for on stack replacement code 2976N/A//------------------------------ParmNode--------------------------------------- //------------------------------ReturnNode------------------------------------- // Return from subroutine node virtual bool is_CFG()
const {
return true; }
//------------------------------RethrowNode------------------------------------ // Rethrow of exception at call site. Ends a procedure before rethrowing; // ends the current basic block like a ReturnNode. Restores registers and // unwinds stack. Rethrow happens in the caller's method. virtual bool is_CFG()
const {
return true; }
//------------------------------TailCallNode----------------------------------- // Pop stack frame and jump indirect //------------------------------TailJumpNode----------------------------------- // Pop stack frame and jump indirect //-------------------------------JVMState------------------------------------- // A linked list of JVMState nodes captures the whole interpreter state, // plus GC roots, for all active calls at some call site in this compilation // unit. (If there is no inlining, then the list has exactly one link.) // This provides a way to map the optimized program back into the interpreter, // or to let the GC mark the stack. uint _depth;
// One more than caller depth, or one. uint _locoff;
// Offset to locals in input edge mapping uint _monoff;
// Offset to monitors in input edge mapping uint _scloff;
// Offset to fields of scalar objs in input edge mapping uint _sp;
// Jave Expression Stack Pointer for this state int _bci;
// Byte Code Index of this JVM point // Because JVMState objects live over the entire lifetime of the // Compile object, they are allocated into the comp_arena, which // does not get resource marked or reset during the compile process void operator delete(
void * ) { }
// fast deallocation // Create a new JVMState, ready for abstract interpretation. // Access functions for the JVM // ... --|--- loc ---|--- stk ---|--- arg ---|--- mon ---|--- scl ---| // \ locoff \ stkoff \ argoff \ monoff \ scloff \ endoff uint debug_depth()
const;
// returns sum of debug_size values at all depths // Returns the JVM state at the desired depth (1 == root). // Tells if two JVM states have the same call chain (depth, methods, & bcis). // Monitors (monitors are stored as (boxNode, objNode) pairs // Initialization functions for the JVM // _reexecute is initialized to "undefined" for a new bci // Miscellaneous utility functions //------------------------------SafePointNode---------------------------------- // A SafePointNode is a subclass of a MultiNode for convenience (and // potential code sharing) only - conceptually it is independent of // A plain safepoint advertises no memory effects (NULL): // Many calls take *all* of memory as input, // but some produce a limited subset of that memory as output. // The adr_type reports the call's behavior as a store, not a load. *(
JVMState**)&
_jvms = s;
// override const attribute in the accessor // Functionality from old debug nodes which has changed // Access functions for the JVM // The parser marks useless maps as dead when it's done with them: // Exception states bubbling out of subgraphs such as inlined calls // are recorded here. (There might be more than one, hence the "next".) // This feature is used only for safepoints which serve as "maps" // for JVM states during parsing, intrinsic expansion, etc. virtual bool pinned()
const {
return true; }
//------------------------------SafePointScalarObjectNode---------------------- // A SafePointScalarObjectNode represents the state of a scalarized object // states of the scalarized object fields are collected. uint _n_fields;
// Number of non-static fields of the scalarized object. virtual uint hash()
const ;
// { return NO_HASH; } // Assumes that "this" is an argument to a safepoint node "s", and that // "new_call" is being created to correspond to "s". But the difference // between the start index of the jvmstates of "new_call" and "s" is // "jvms_adj". Produce and return a SafePointScalarObjectNode that // corresponds appropriately to "this" in "new_call". Assumes that // "sosn_map" is a map, specific to the translation of "s" to "new_call", // mapping old SafePointScalarObjectNodes to new, to avoid multiple copies. // Simple container for the outgoing projections of a call. Useful // for serious surgery on calls. //------------------------------CallNode--------------------------------------- // Call nodes now subsume the function of debug nodes at callsites, so they // contain the functionality of a full scope chain of debug nodes. float _cnt;
// Estimate of number of times called const float cnt()
const {
return _cnt; }
// Are we guaranteed that this node is a safepoint? Not true for leaf calls and // for some macro nodes whose expansion does not have a safepoint on the fast path. // For macro nodes, the JVMState gets modified during expansion, so when cloning // the node the JVMState must be cloned. virtual void clone_jvms() { }
// default is not to clone // Returns true if the call may modify n // Does this node have a use of n other than in debug information? // Returns the unique CheckCastPP of a call // or result projection is there are several CheckCastPP // or returns NULL if there is no one. // Does this node returns pointer? // Collect all the interesting edges from a call for use in // replacing the call by something else. Used by macro expansion // and the late inlining support. //------------------------------CallJavaNode----------------------------------- // Make a static or dynamic subroutine call node using Java calling // convention. (The "Java" calling convention is the compiler's calling // convention, as opposed to the interpreter's or that of native C.) const int _bci;
// Byte Code Index of call byte code //------------------------------CallStaticJavaNode----------------------------- // Make a direct subroutine call using Java calling convention (for static // calls and optimized virtual calls, plus calls to wrappers for run-time // routines); generates static stub. // This node calls a runtime stub, which often has narrow memory effects. const char *
_name;
// Runtime wrapper name // If this is an uncommon trap, return the request code, else zero. //------------------------------CallDynamicJavaNode---------------------------- // Make a dispatched call using Java calling convention. //------------------------------CallRuntimeNode-------------------------------- // Make a direct subroutine call node into compiled C++ code. const char *
_name;
// Printable name, if _method is NULL //------------------------------CallLeafNode----------------------------------- // Make a direct subroutine call node into compiled C++ code, without //------------------------------CallLeafNoFPNode------------------------------- // CallLeafNode, not using floating point or using it in the same manner as //------------------------------Allocate--------------------------------------- // High-level memory allocation // AllocateNode and AllocateArrayNode are subclasses of CallNode because they will // get expanded into a code sequence containing a call. Unlike other CallNodes, // they have 2 memory projections and 2 i_o projections (which are distinguished by // the _is_io_use flag in the projection.) This is needed when expanding the node in // order to differentiate the uses of the projection on the normal control path from // those on the exception return path. KlassNode,
// type (maybe dynamic) of the obj. ALength,
// array length (or TOP if none) // create result type (range) // Expansion modifies the JVMState, so we need to clone it // allocations do not modify their arguments // Pattern-match a possible usage of AllocateNode. // Return null if no allocation is recognized. // The operand is the pointer produced by the (possible) allocation. // It must be a projection of the Allocate or its subsequent CastPP. // (Note: This function is defined in file graphKit.cpp, near // The 'ptr' may not have an offset unless the 'offset' argument is given. // Fancy version which uses AddPNode::Ideal_base_and_offset to strip // an offset, which is reported back to the caller. // (Note: AllocateNode::Ideal_allocation is defined in graphKit.cpp.) // Dig the klass operand out of a (possible) allocation site. // Conservatively small estimate of offset of first non-header byte. // Return the corresponding initialization barrier (or null if none). // Walks out edges to find it... // (Note: Both InitializeNode::allocation and AllocateNode::initialization // are defined in graphKit.cpp, which sets up the bidirectional relation.) // Return the corresponding storestore barrier (or null if none). // Walks out edges to find it... // Convenience for initialization->maybe_set_complete(phase) //------------------------------AllocateArray--------------------------------- // High-level array allocation // Dig the length operand out of a array allocation site. // Dig the length operand out of a array allocation site and narrow the // type with a CastII, if necesssary // Pattern-match a possible usage of AllocateArrayNode. // Return null if no allocation is recognized. //------------------------------AbstractLockNode----------------------------------- NonEscObj,
// Lock is used for non escaping object // helper functions for lock elimination // Update the counter to indicate that this lock was eliminated. virtual int Opcode()
const = 0;
// locking does not modify its arguments //------------------------------Lock--------------------------------------- // High-level lock operation // This is a subclass of CallNode because it is a macro node which gets expanded // into a code sequence containing a call. This node takes 3 "parameters": // create input type (domain) // create result type (range) // Expansion modifies the JVMState, so we need to clone it //------------------------------Unlock--------------------------------------- // High-level unlock operation // unlock is never a safepoint #
endif // SHARE_VM_OPTO_CALLNODE_HPP