machnode.hpp revision 1203
4609N/A * Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved. 647N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 647N/A * This code is free software; you can redistribute it and/or modify it 647N/A * under the terms of the GNU General Public License version 2 only, as 647N/A * published by the Free Software Foundation. 647N/A * This code is distributed in the hope that it will be useful, but WITHOUT 647N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 647N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 647N/A * version 2 for more details (a copy is included in the LICENSE file that 647N/A * accompanied this code). 647N/A * You should have received a copy of the GNU General Public License version 647N/A * 2 along with this work; if not, write to the Free Software Foundation, 647N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 2362N/A * CA 95054 USA or visit www.sun.com if you need additional information or 647N/A//---------------------------MachOper------------------------------------------ 647N/A // Allocate right next to the MachNodes in the same arena 647N/A // Number of input edges. 4854N/A // Methods to output the encoding of the operand 1945N/A // Negate conditional branches. Error for non-branch Nodes 647N/A // Return the value requested 4854N/A // result register lookup, corresponding to int_format 647N/A // input register lookup, corresponding to ext_format 647N/A // helpers for MacroAssembler generation from ADLC 647N/A // A zero, default, indicates this value is not needed. 647N/A // May need to lookup the base register, as done in int_ and ext_format 4854N/A // Parameters needed to support MEMORY_INTERFACE access to stackSlot 4854N/A // Check for PC-Relative displacement 4854N/A // Access the TypeKlassPtr of operands with a base==RegI and disp==RegP 1945N/A // Only returns non-null value for i486.ad's indOffset32X 647N/A // Return the method's address 5270N/A // Hash and compare over operands are currently identical 647N/A // Virtual clone, since I do not know how big the MachOper is. 4854N/A // Return ideal Type from simple operands. Fail for complex operands. 647N/A // Set an integer offset if we have one, or error otherwise 5270N/A virtual const char *
Name()
const {
return "???";}
5270N/A // Methods to output the text version of the operand 4854N/A//------------------------------MachNode--------------------------------------- 4854N/A// Base type for all machine specific nodes. All node classes generated by the 4854N/A// ADLC inherit from this class. 647N/A virtual int Opcode()
const;
// Always equal to MachNode 4854N/A // Number of inputs which come before the first operand. 647N/A // Generally at least 1, to skip the Control input 1945N/A // Copy inputs and operands to new node of instruction. 1945N/A // Called from cisc_version() and short_branch_version(). 1945N/A // !!!! The method's body is defined in ad_<arch>.cpp file. 1945N/A // Return an equivalent instruction using memory for cisc_operand position 1945N/A // Modify this instruction's register mask to use stack version for cisc_operand 5270N/A // Support for short branches 5270N/A // First index in _in[] corresponding to operand, or -1 if there is none 5270N/A // Register class input is expected in 5270N/A // cisc-spillable instructions redefine for use by in_RegMask 5270N/A // If this instruction is a 2-address instruction, then return the 5272N/A // index of the input which must match the output. Not nessecary 5272N/A // for instructions which bind the input and output register to the 5270N/A // same singleton regiser (e.g., Intel IDIV which binds AX to be 5270N/A // both an input and an output). It is nessecary when the input and 5270N/A // output have choices - but they must use the same choice. 5270N/A // Array of complex operand pointers. Each corresponds to zero or 5272N/A // more leafs. Must be set by MachNode constructor to point to an 5270N/A // internal array of MachOpers. The MachOper array is sized by 5270N/A // specific MachNodes described in the ADL. 1945N/A // Size of instruction in bytes 3986N/A // Helper function that computes size by emitting code 3986N/A // Return the alignment required (in units of relocInfo::addr_unit()) 3986N/A // for this instruction (must be a power of 2) 1945N/A // Return the padding (in bytes) to be emitted before this 1945N/A // instruction to properly align it. 1945N/A // Return number of relocatable values contained in this instruction 1945N/A // Return number of words used for double constants in this instruction 3986N/A // Hash and compare over operands. Used to do GVN on machine Nodes. 3986N/A // Expand method for MachNode, replaces nodes representing pseudo 3986N/A // instructions with a set of nodes which represent real machine 3986N/A // instructions and compute the same value. 3986N/A // Bottom_type call; value comes from operand0 3986N/A // If this is a memory op, return the base pointer and fixed offset. 3986N/A // If there are no such, return NULL. If there are multiple addresses 3986N/A // or the address is indeterminate (rare cases) then return (Node*)-1, 3986N/A // which serves as node bottom. 3986N/A // If the offset is not statically determined, set it to Type::OffsetBot. 3986N/A // This method is free to ignore stack slots if that helps. 1945N/A // Passing TYPE_PTR_SENTINAL as adr_type asks for computation of the adr_type if possible 1945N/A // Helper for get_base_and_disp: find the base and index input nodes. 647N/A // Returns the MachOper as determined by memory_operand(), for use, if 647N/A // needed by the caller. If (MachOper *)-1 is returned, base and index 647N/A // are set to NodeSentinel. If (MachOper *) NULL is returned, base and 653N/A // index are set to NULL. 647N/A // Helper for memory_inputs: Which operand carries the necessary info? 647N/A // By default, returns NULL, which means there is no such operand. 647N/A // If it returns (MachOper*)-1, this means there are multiple memories. 647N/A // Call "get_base_and_disp" to decide which category of memory is used here. 4854N/A // Negate conditional branches. Error for non-branch Nodes 4854N/A // Apply peephole rule(s) to this instruction 4854N/A // Check for PC-Relative addressing 4854N/A // Top-level ideal Opcode matched 653N/A // Set the branch inside jump MachNodes. Error for non-branch Nodes. 647N/A // Adds the label for the case 647N/A // Set the absolute address for methods 4343N/A // Should we clone rather than spill this instruction? 647N/A virtual const char *
Name()
const = 0;
// Machine-specific name 647N/A//------------------------------MachIdealNode---------------------------- 647N/A// Machine specific versions of nodes that must be defined by user. 653N/A// These are not converted by matcher from ideal nodes to machine nodes 647N/A// but are inserted into the code by the compiler. 647N/A // Define the following defaults for non-matched machine nodes 4343N/A//------------------------------MachTypeNode---------------------------- 647N/A// Machine Nodes that need to retain a known Type. 3986N/A//------------------------------MachBreakpointNode---------------------------- 3986N/A// Machine breakpoint or interrupt Node 4854N/A virtual const char *
Name()
const {
return "Breakpoint"; }
3986N/A//------------------------------MachUEPNode----------------------------------- 3986N/A// Machine Unvalidated Entry Point Node 3986N/A virtual const char *
Name()
const {
return "Unvalidated-Entry-Point"; }
3986N/A//------------------------------MachPrologNode-------------------------------- 3986N/A// Machine function Prolog Node 3986N/A virtual const char *
Name()
const {
return "Prolog"; }
4954N/A//------------------------------MachEpilogNode-------------------------------- 1945N/A// Machine function Epilog Node 647N/A // Offset of safepoint from the beginning of the node 4954N/A virtual const char *
Name()
const {
return "Epilog"; }
647N/A//------------------------------MachNopNode----------------------------------- 647N/A// Machine function Nop Node 647N/A virtual const char *
Name()
const {
return "Nop"; }
4609N/A//------------------------------MachSpillCopyNode------------------------------ 4609N/A// Machine SpillCopy Node. Copies 1 or 2 words from any location to any 4609N/A// location (stack or register). 647N/A virtual const char *
Name()
const {
return "MachSpillCopy"; }
5270N/A//------------------------------MachNullChkNode-------------------------------- 647N/A// Machine-dependent null-pointer-check Node. Points a real MachNode that is 647N/A// also some kind of memory op. Turns the indicated MachNode into a 3986N/A// conditional branch with good latency on the ptr-not-null path and awful 3986N/A// latency on the pointer-is-null path. 647N/A virtual const char *
Name()
const {
return "NullCheck"; }
647N/A//------------------------------MachProjNode---------------------------------- 647N/A// Machine-dependent Ideal projections (how is that for an oxymoron). Really 647N/A// just MachNodes made by the Ideal world that replicate simple projections 647N/A// but with machine-dependent input & output register masks. Generally 647N/A// produced as part of calling conventions. Normally I make MachNodes as part 647N/A// of the Matcher process, but the Matcher is ill suited to issues involving 647N/A// frame handling, so frame handling is all done in the Ideal world with 5270N/A// occasional callbacks to the machine model for important info. 5270N/A // Need size_of() for virtual ProjNode::clone() 1945N/A//------------------------------MachIfNode------------------------------------- 5270N/A// Machine-specific versions of IfNodes 647N/A//------------------------------MachFastLockNode------------------------------------- 647N/A// Machine-specific versions of FastLockNodes 1945N/A//------------------------------MachReturnNode-------------------------------- 1945N/A// Machine-specific versions of subroutine returns //------------------------------MachSafePointNode----------------------------- // Machine-specific versions of safepoints uint _jvmadj;
// Extra delta to jvms indexes (mach. args) // Functionality from old debug nodes //------------------------------MachCallNode---------------------------------- // Machine-specific versions of subroutine calls float _cnt;
// Estimate of number of times called const float cnt()
const {
return _cnt; }
virtual bool pinned()
const {
return false; }
//------------------------------MachCallJavaNode------------------------------ // "Base" class for machine-specific versions of subroutine calls int _bci;
// Byte Code index of call byte code //------------------------------MachCallStaticJavaNode------------------------ // Machine-specific versions of monomorphic subroutine calls const char *
_name;
// Runtime wrapper name // If this is an uncommon trap, return the request code, else zero. //------------------------------MachCallDynamicJavaNode------------------------ // Machine-specific versions of possibly megamorphic subroutine calls //------------------------------MachCallRuntimeNode---------------------------- // Machine-specific versions of subroutine calls const char *
_name;
// Printable name, if _method is NULL //------------------------------MachHaltNode----------------------------------- // Machine-specific versions of halt nodes //------------------------------MachTempNode----------------------------------- // Node used by the adlc to construct inputs to represent temporary registers virtual uint rule()
const {
return 9999999; }
virtual const char *
Name()
const {
return "MachTemp";}
//------------------------------labelOper-------------------------------------- // Machine-independent version of label operand // Supported for fixed size branches virtual const char *
Name()
const {
return "Label";}
//------------------------------methodOper-------------------------------------- // Machine-independent version of method operand virtual const char *
Name()
const {
return "Method";}