callnode.hpp revision 113
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews/*
7d32c065c7bb56f281651ae3dd2888f32ce4f1d9Bob Halley * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
2f072c2982861ec2e86e97f8a3ed199fe45c1f70Michael Graff * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews *
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews * This code is free software; you can redistribute it and/or modify it
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews * under the terms of the GNU General Public License version 2 only, as
2f072c2982861ec2e86e97f8a3ed199fe45c1f70Michael Graff * published by the Free Software Foundation.
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews *
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews * This code is distributed in the hope that it will be useful, but WITHOUT
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews * version 2 for more details (a copy is included in the LICENSE file that
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews * accompanied this code).
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews *
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews * You should have received a copy of the GNU General Public License version
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews * 2 along with this work; if not, write to the Free Software Foundation,
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
7d32c065c7bb56f281651ae3dd2888f32ce4f1d9Bob Halley *
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews * CA 95054 USA or visit www.sun.com if you need additional information or
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews * have any questions.
854d0238dbc2908490197984b3b9d558008a53dfMark Andrews *
854d0238dbc2908490197984b3b9d558008a53dfMark Andrews */
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews
3ddd814a97de1d152ba0913c592d6e6dc83d38a6Michael Graff// Portions of code courtesy of Clifford Click
d981ca645597116d227a48bf37cc5edc061c854dBob Halley
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews// Optimization - Graph Style
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrewsclass Chaitin;
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrewsclass NamedCounter;
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrewsclass MultiNode;
54c26ab21c61c6d6b1e484bb88dc3ac263845d17Mark Andrewsclass SafePointNode;
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrewsclass CallNode;
54c26ab21c61c6d6b1e484bb88dc3ac263845d17Mark Andrewsclass CallJavaNode;
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrewsclass CallStaticJavaNode;
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrewsclass CallDynamicJavaNode;
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrewsclass CallRuntimeNode;
3ddd92da6651bc72aa79a04195ad389d86fd1a66Andreas Gustafssonclass CallLeafNode;
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrewsclass CallLeafNoFPNode;
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrewsclass AllocateNode;
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrewsclass AllocateArrayNode;
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrewsclass LockNode;
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrewsclass UnlockNode;
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrewsclass JVMState;
3ddd92da6651bc72aa79a04195ad389d86fd1a66Andreas Gustafssonclass OopMap;
54c26ab21c61c6d6b1e484bb88dc3ac263845d17Mark Andrewsclass State;
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrewsclass StartNode;
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrewsclass MachCallNode;
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrewsclass FastLockNode;
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews//------------------------------StartNode--------------------------------------
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews// The method start node
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrewsclass StartNode : public MultiNode {
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews virtual uint cmp( const Node &n ) const;
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews virtual uint size_of() const; // Size is bigger
3ddd92da6651bc72aa79a04195ad389d86fd1a66Andreas Gustafssonpublic:
54c26ab21c61c6d6b1e484bb88dc3ac263845d17Mark Andrews const TypeTuple *_domain;
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews StartNode( Node *root, const TypeTuple *domain ) : MultiNode(2), _domain(domain) {
822f6cdabb1edd44472c7a758b5cae71376fa9beBrian Wellington init_class_id(Class_Start);
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews init_flags(Flag_is_block_start);
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews init_req(0,this);
3ddd814a97de1d152ba0913c592d6e6dc83d38a6Michael Graff init_req(1,root);
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson }
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson virtual int Opcode() const;
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson virtual bool pinned() const { return true; };
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews virtual const Type *bottom_type() const;
0e8cf9a887c70f96ac448b06c069d90b830215ccMark Andrews virtual const TypePtr *adr_type() const { return TypePtr::BOTTOM; }
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews virtual const Type *Value( PhaseTransform *phase ) const;
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews virtual void calling_convention( BasicType* sig_bt, VMRegPair *parm_reg, uint length ) const;
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews virtual const RegMask &in_RegMask(uint) const;
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson virtual Node *match( const ProjNode *proj, const Matcher *m );
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews virtual uint ideal_reg() const { return 0; }
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews#ifndef PRODUCT
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews virtual void dump_spec(outputStream *st) const;
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews#endif
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews};
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews
722cc17289e2bacad75cf16a7170485853f66274David Lawrence//------------------------------StartOSRNode-----------------------------------
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews// The method start node for on stack replacement code
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrewsclass StartOSRNode : public StartNode {
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrewspublic:
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews StartOSRNode( Node *root, const TypeTuple *domain ) : StartNode(root, domain) {}
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews virtual int Opcode() const;
0e8cf9a887c70f96ac448b06c069d90b830215ccMark Andrews static const TypeTuple *osr_domain();
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews};
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews
54c26ab21c61c6d6b1e484bb88dc3ac263845d17Mark Andrews//------------------------------ParmNode---------------------------------------
54c26ab21c61c6d6b1e484bb88dc3ac263845d17Mark Andrews// Incoming parameters
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrewsclass ParmNode : public ProjNode {
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews static const char * const names[TypeFunc::Parms+1];
fad44a20eede1bbc66716241dede225500c91caaAndreas Gustafssonpublic:
fad44a20eede1bbc66716241dede225500c91caaAndreas Gustafsson ParmNode( StartNode *src, uint con ) : ProjNode(src,con) {
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson init_class_id(Class_Parm);
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson }
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson virtual int Opcode() const;
fad44a20eede1bbc66716241dede225500c91caaAndreas Gustafsson virtual bool is_CFG() const { return (_con == TypeFunc::Control); }
fad44a20eede1bbc66716241dede225500c91caaAndreas Gustafsson virtual uint ideal_reg() const;
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson#ifndef PRODUCT
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews virtual void dump_spec(outputStream *st) const;
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews#endif
3ddd814a97de1d152ba0913c592d6e6dc83d38a6Michael Graff};
d981ca645597116d227a48bf37cc5edc061c854dBob Halley
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews//------------------------------ReturnNode-------------------------------------
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews// Return from subroutine node
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrewsclass ReturnNode : public Node {
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrewspublic:
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews ReturnNode( uint edges, Node *cntrl, Node *i_o, Node *memory, Node *retadr, Node *frameptr );
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews virtual int Opcode() const;
d981ca645597116d227a48bf37cc5edc061c854dBob Halley virtual bool is_CFG() const { return true; }
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews virtual uint hash() const { return NO_HASH; } // CFG nodes do not hash
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews virtual bool depends_only_on_test() const { return false; }
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews virtual const Type *Value( PhaseTransform *phase ) const;
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews virtual uint ideal_reg() const { return NotAMachineReg; }
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews virtual uint match_edge(uint idx) const;
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews#ifndef PRODUCT
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews virtual void dump_req() const;
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews#endif
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews};
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews
3ddd814a97de1d152ba0913c592d6e6dc83d38a6Michael Graff
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews//------------------------------RethrowNode------------------------------------
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews// Rethrow of exception at call site. Ends a procedure before rethrowing;
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews// ends the current basic block like a ReturnNode. Restores registers and
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews// unwinds stack. Rethrow happens in the caller's method.
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrewsclass RethrowNode : public Node {
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews public:
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews RethrowNode( Node *cntrl, Node *i_o, Node *memory, Node *frameptr, Node *ret_adr, Node *exception );
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews virtual int Opcode() const;
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews virtual bool is_CFG() const { return true; }
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews virtual uint hash() const { return NO_HASH; } // CFG nodes do not hash
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews virtual bool depends_only_on_test() const { return false; }
4529cdaedaf1a0a5f8ff89aeca510b7a4475446cBob Halley virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews virtual const Type *Value( PhaseTransform *phase ) const;
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews virtual uint match_edge(uint idx) const;
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews virtual uint ideal_reg() const { return NotAMachineReg; }
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews#ifndef PRODUCT
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews virtual void dump_req() const;
d981ca645597116d227a48bf37cc5edc061c854dBob Halley#endif
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews};
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews//------------------------------TailCallNode-----------------------------------
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews// Pop stack frame and jump indirect
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrewsclass TailCallNode : public ReturnNode {
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrewspublic:
3ddd814a97de1d152ba0913c592d6e6dc83d38a6Michael Graff TailCallNode( Node *cntrl, Node *i_o, Node *memory, Node *frameptr, Node *retadr, Node *target, Node *moop )
d981ca645597116d227a48bf37cc5edc061c854dBob Halley : ReturnNode( TypeFunc::Parms+2, cntrl, i_o, memory, frameptr, retadr ) {
0e8cf9a887c70f96ac448b06c069d90b830215ccMark Andrews init_req(TypeFunc::Parms, target);
0e8cf9a887c70f96ac448b06c069d90b830215ccMark Andrews init_req(TypeFunc::Parms+1, moop);
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews }
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews virtual int Opcode() const;
d981ca645597116d227a48bf37cc5edc061c854dBob Halley virtual uint match_edge(uint idx) const;
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews};
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews//------------------------------TailJumpNode-----------------------------------
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews// Pop stack frame and jump indirect
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrewsclass TailJumpNode : public ReturnNode {
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrewspublic:
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews TailJumpNode( Node *cntrl, Node *i_o, Node *memory, Node *frameptr, Node *target, Node *ex_oop)
3ddd814a97de1d152ba0913c592d6e6dc83d38a6Michael Graff : ReturnNode(TypeFunc::Parms+2, cntrl, i_o, memory, frameptr, Compile::current()->top()) {
94a3bcd132e515b4baa0884ba9dd0f361d2e17bcMark Andrews init_req(TypeFunc::Parms, target);
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews init_req(TypeFunc::Parms+1, ex_oop);
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews }
94a3bcd132e515b4baa0884ba9dd0f361d2e17bcMark Andrews
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews virtual int Opcode() const;
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews virtual uint match_edge(uint idx) const;
94a3bcd132e515b4baa0884ba9dd0f361d2e17bcMark Andrews};
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews//-------------------------------JVMState-------------------------------------
12a12d8ab469ba71e8593a71c28d91d4b25d5863Mark Andrews// A linked list of JVMState nodes captures the whole interpreter state,
94a3bcd132e515b4baa0884ba9dd0f361d2e17bcMark Andrews// plus GC roots, for all active calls at some call site in this compilation
4529cdaedaf1a0a5f8ff89aeca510b7a4475446cBob Halley// unit. (If there is no inlining, then the list has exactly one link.)
94a3bcd132e515b4baa0884ba9dd0f361d2e17bcMark Andrews// This provides a way to map the optimized program back into the interpreter,
94a3bcd132e515b4baa0884ba9dd0f361d2e17bcMark Andrews// or to let the GC mark the stack.
94a3bcd132e515b4baa0884ba9dd0f361d2e17bcMark Andrewsclass JVMState : public ResourceObj {
94a3bcd132e515b4baa0884ba9dd0f361d2e17bcMark Andrewsprivate:
d981ca645597116d227a48bf37cc5edc061c854dBob Halley JVMState* _caller; // List pointer for forming scope chains
3ddd814a97de1d152ba0913c592d6e6dc83d38a6Michael Graff uint _depth; // One mroe than caller depth, or one.
d981ca645597116d227a48bf37cc5edc061c854dBob Halley uint _locoff; // Offset to locals in input edge mapping
d981ca645597116d227a48bf37cc5edc061c854dBob Halley uint _stkoff; // Offset to stack in input edge mapping
d981ca645597116d227a48bf37cc5edc061c854dBob Halley uint _monoff; // Offset to monitors in input edge mapping
d981ca645597116d227a48bf37cc5edc061c854dBob Halley uint _scloff; // Offset to fields of scalar objs in input edge mapping
d981ca645597116d227a48bf37cc5edc061c854dBob Halley uint _endoff; // Offset to end of input edge mapping
d981ca645597116d227a48bf37cc5edc061c854dBob Halley uint _sp; // Jave Expression Stack Pointer for this state
d981ca645597116d227a48bf37cc5edc061c854dBob Halley int _bci; // Byte Code Index of this JVM point
d981ca645597116d227a48bf37cc5edc061c854dBob Halley ciMethod* _method; // Method Pointer
d981ca645597116d227a48bf37cc5edc061c854dBob Halley SafePointNode* _map; // Map node associated with this scope
d981ca645597116d227a48bf37cc5edc061c854dBob Halleypublic:
d981ca645597116d227a48bf37cc5edc061c854dBob Halley friend class Compile;
3ddd814a97de1d152ba0913c592d6e6dc83d38a6Michael Graff
e27a69f8bd9538e08f775265167ba6cc5f47c587Bob Halley // Because JVMState objects live over the entire lifetime of the
e27a69f8bd9538e08f775265167ba6cc5f47c587Bob Halley // Compile object, they are allocated into the comp_arena, which
e27a69f8bd9538e08f775265167ba6cc5f47c587Bob Halley // does not get resource marked or reset during the compile process
e27a69f8bd9538e08f775265167ba6cc5f47c587Bob Halley void *operator new( size_t x, Compile* C ) { return C->comp_arena()->Amalloc(x); }
e27a69f8bd9538e08f775265167ba6cc5f47c587Bob Halley void operator delete( void * ) { } // fast deallocation
e27a69f8bd9538e08f775265167ba6cc5f47c587Bob Halley
e27a69f8bd9538e08f775265167ba6cc5f47c587Bob Halley // Create a new JVMState, ready for abstract interpretation.
e27a69f8bd9538e08f775265167ba6cc5f47c587Bob Halley JVMState(ciMethod* method, JVMState* caller);
e27a69f8bd9538e08f775265167ba6cc5f47c587Bob Halley JVMState(int stack_size); // root state; has a null method
e27a69f8bd9538e08f775265167ba6cc5f47c587Bob Halley
854d0238dbc2908490197984b3b9d558008a53dfMark Andrews // Access functions for the JVM
uint locoff() const { return _locoff; }
uint stkoff() const { return _stkoff; }
uint argoff() const { return _stkoff + _sp; }
uint monoff() const { return _monoff; }
uint scloff() const { return _scloff; }
uint endoff() const { return _endoff; }
uint oopoff() const { return debug_end(); }
int loc_size() const { return _stkoff - _locoff; }
int stk_size() const { return _monoff - _stkoff; }
int mon_size() const { return _scloff - _monoff; }
int scl_size() const { return _endoff - _scloff; }
bool is_loc(uint i) const { return i >= _locoff && i < _stkoff; }
bool is_stk(uint i) const { return i >= _stkoff && i < _monoff; }
bool is_mon(uint i) const { return i >= _monoff && i < _scloff; }
bool is_scl(uint i) const { return i >= _scloff && i < _endoff; }
uint sp() const { return _sp; }
int bci() const { return _bci; }
bool has_method() const { return _method != NULL; }
ciMethod* method() const { assert(has_method(), ""); return _method; }
JVMState* caller() const { return _caller; }
SafePointNode* map() const { return _map; }
uint depth() const { return _depth; }
uint debug_start() const; // returns locoff of root caller
uint debug_end() const; // returns endoff of self
uint debug_size() const {
return loc_size() + sp() + mon_size() + scl_size();
}
uint debug_depth() const; // returns sum of debug_size values at all depths
// Returns the JVM state at the desired depth (1 == root).
JVMState* of_depth(int d) const;
// Tells if two JVM states have the same call chain (depth, methods, & bcis).
bool same_calls_as(const JVMState* that) const;
// Monitors (monitors are stored as (boxNode, objNode) pairs
enum { logMonitorEdges = 1 };
int nof_monitors() const { return mon_size() >> logMonitorEdges; }
int monitor_depth() const { return nof_monitors() + (caller() ? caller()->monitor_depth() : 0); }
int monitor_box_offset(int idx) const { return monoff() + (idx << logMonitorEdges) + 0; }
int monitor_obj_offset(int idx) const { return monoff() + (idx << logMonitorEdges) + 1; }
bool is_monitor_box(uint off) const {
assert(is_mon(off), "should be called only for monitor edge");
return (0 == bitfield(off - monoff(), 0, logMonitorEdges));
}
bool is_monitor_use(uint off) const { return (is_mon(off)
&& is_monitor_box(off))
|| (caller() && caller()->is_monitor_use(off)); }
// Initialization functions for the JVM
void set_locoff(uint off) { _locoff = off; }
void set_stkoff(uint off) { _stkoff = off; }
void set_monoff(uint off) { _monoff = off; }
void set_scloff(uint off) { _scloff = off; }
void set_endoff(uint off) { _endoff = off; }
void set_offsets(uint off) {
_locoff = _stkoff = _monoff = _scloff = _endoff = off;
}
void set_map(SafePointNode *map) { _map = map; }
void set_sp(uint sp) { _sp = sp; }
void set_bci(int bci) { _bci = bci; }
// Miscellaneous utility functions
JVMState* clone_deep(Compile* C) const; // recursively clones caller chain
JVMState* clone_shallow(Compile* C) const; // retains uncloned caller
#ifndef PRODUCT
void format(PhaseRegAlloc *regalloc, const Node *n, outputStream* st) const;
void dump_spec(outputStream *st) const;
void dump_on(outputStream* st) const;
void dump() const {
dump_on(tty);
}
#endif
};
//------------------------------SafePointNode----------------------------------
// A SafePointNode is a subclass of a MultiNode for convenience (and
// potential code sharing) only - conceptually it is independent of
// the Node semantics.
class SafePointNode : public MultiNode {
virtual uint cmp( const Node &n ) const;
virtual uint size_of() const; // Size is bigger
public:
SafePointNode(uint edges, JVMState* jvms,
// A plain safepoint advertises no memory effects (NULL):
const TypePtr* adr_type = NULL)
: MultiNode( edges ),
_jvms(jvms),
_oop_map(NULL),
_adr_type(adr_type)
{
init_class_id(Class_SafePoint);
}
OopMap* _oop_map; // Array of OopMap info (8-bit char) for GC
JVMState* const _jvms; // Pointer to list of JVM State objects
const TypePtr* _adr_type; // What type of memory does this node produce?
// 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.
virtual JVMState* jvms() const { return _jvms; }
void set_jvms(JVMState* s) {
*(JVMState**)&_jvms = s; // override const attribute in the accessor
}
OopMap *oop_map() const { return _oop_map; }
void set_oop_map(OopMap *om) { _oop_map = om; }
// Functionality from old debug nodes which has changed
Node *local(JVMState* jvms, uint idx) const {
assert(verify_jvms(jvms), "jvms must match");
return in(jvms->locoff() + idx);
}
Node *stack(JVMState* jvms, uint idx) const {
assert(verify_jvms(jvms), "jvms must match");
return in(jvms->stkoff() + idx);
}
Node *argument(JVMState* jvms, uint idx) const {
assert(verify_jvms(jvms), "jvms must match");
return in(jvms->argoff() + idx);
}
Node *monitor_box(JVMState* jvms, uint idx) const {
assert(verify_jvms(jvms), "jvms must match");
return in(jvms->monitor_box_offset(idx));
}
Node *monitor_obj(JVMState* jvms, uint idx) const {
assert(verify_jvms(jvms), "jvms must match");
return in(jvms->monitor_obj_offset(idx));
}
void set_local(JVMState* jvms, uint idx, Node *c);
void set_stack(JVMState* jvms, uint idx, Node *c) {
assert(verify_jvms(jvms), "jvms must match");
set_req(jvms->stkoff() + idx, c);
}
void set_argument(JVMState* jvms, uint idx, Node *c) {
assert(verify_jvms(jvms), "jvms must match");
set_req(jvms->argoff() + idx, c);
}
void ensure_stack(JVMState* jvms, uint stk_size) {
assert(verify_jvms(jvms), "jvms must match");
int grow_by = (int)stk_size - (int)jvms->stk_size();
if (grow_by > 0) grow_stack(jvms, grow_by);
}
void grow_stack(JVMState* jvms, uint grow_by);
// Handle monitor stack
void push_monitor( const FastLockNode *lock );
void pop_monitor ();
Node *peek_monitor_box() const;
Node *peek_monitor_obj() const;
// Access functions for the JVM
Node *control () const { return in(TypeFunc::Control ); }
Node *i_o () const { return in(TypeFunc::I_O ); }
Node *memory () const { return in(TypeFunc::Memory ); }
Node *returnadr() const { return in(TypeFunc::ReturnAdr); }
Node *frameptr () const { return in(TypeFunc::FramePtr ); }
void set_control ( Node *c ) { set_req(TypeFunc::Control,c); }
void set_i_o ( Node *c ) { set_req(TypeFunc::I_O ,c); }
void set_memory ( Node *c ) { set_req(TypeFunc::Memory ,c); }
MergeMemNode* merged_memory() const {
return in(TypeFunc::Memory)->as_MergeMem();
}
// The parser marks useless maps as dead when it's done with them:
bool is_killed() { return in(TypeFunc::Control) == NULL; }
// 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.
SafePointNode* next_exception() const;
void set_next_exception(SafePointNode* n);
bool has_exceptions() const { return next_exception() != NULL; }
// Does this node have a use of n other than in debug information?
virtual bool has_non_debug_use(Node *n) {return false; }
// Standard Node stuff
virtual int Opcode() const;
virtual bool pinned() const { return true; }
virtual const Type *Value( PhaseTransform *phase ) const;
virtual const Type *bottom_type() const { return Type::CONTROL; }
virtual const TypePtr *adr_type() const { return _adr_type; }
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
virtual Node *Identity( PhaseTransform *phase );
virtual uint ideal_reg() const { return 0; }
virtual const RegMask &in_RegMask(uint) const;
virtual const RegMask &out_RegMask() const;
virtual uint match_edge(uint idx) const;
static bool needs_polling_address_input();
#ifndef PRODUCT
virtual void dump_spec(outputStream *st) const;
#endif
};
//------------------------------SafePointScalarObjectNode----------------------
// A SafePointScalarObjectNode represents the state of a scalarized object
// at a safepoint.
class SafePointScalarObjectNode: public TypeNode {
uint _first_index; // First input edge index of a SafePoint node where
// states of the scalarized object fields are collected.
uint _n_fields; // Number of non-static fields of the scalarized object.
DEBUG_ONLY(AllocateNode* _alloc;)
public:
SafePointScalarObjectNode(const TypeOopPtr* tp,
#ifdef ASSERT
AllocateNode* alloc,
#endif
uint first_index, uint n_fields);
virtual int Opcode() const;
virtual uint ideal_reg() const;
virtual const RegMask &in_RegMask(uint) const;
virtual const RegMask &out_RegMask() const;
virtual uint match_edge(uint idx) const;
uint first_index() const { return _first_index; }
uint n_fields() const { return _n_fields; }
DEBUG_ONLY(AllocateNode* alloc() const { return _alloc; })
virtual uint size_of() const { return sizeof(*this); }
// 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.
SafePointScalarObjectNode* clone(int jvms_adj, Dict* sosn_map) const;
#ifndef PRODUCT
virtual void dump_spec(outputStream *st) const;
#endif
};
//------------------------------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.
class CallNode : public SafePointNode {
public:
const TypeFunc *_tf; // Function type
address _entry_point; // Address of method being called
float _cnt; // Estimate of number of times called
CallNode(const TypeFunc* tf, address addr, const TypePtr* adr_type)
: SafePointNode(tf->domain()->cnt(), NULL, adr_type),
_tf(tf),
_entry_point(addr),
_cnt(COUNT_UNKNOWN)
{
init_class_id(Class_Call);
init_flags(Flag_is_Call);
}
const TypeFunc* tf() const { return _tf; }
const address entry_point() const { return _entry_point; }
const float cnt() const { return _cnt; }
void set_tf(const TypeFunc* tf) { _tf = tf; }
void set_entry_point(address p) { _entry_point = p; }
void set_cnt(float c) { _cnt = c; }
virtual const Type *bottom_type() const;
virtual const Type *Value( PhaseTransform *phase ) const;
virtual Node *Identity( PhaseTransform *phase ) { return this; }
virtual uint cmp( const Node &n ) const;
virtual uint size_of() const = 0;
virtual void calling_convention( BasicType* sig_bt, VMRegPair *parm_regs, uint argcnt ) const;
virtual Node *match( const ProjNode *proj, const Matcher *m );
virtual uint ideal_reg() const { return NotAMachineReg; }
// 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.
virtual bool guaranteed_safepoint() { return true; }
// 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
virtual bool may_modify(const TypePtr *addr_t, PhaseTransform *phase);
// Does this node have a use of n other than in debug information?
virtual bool has_non_debug_use(Node *n);
// Returns the unique CheckCastPP of a call
// or result projection is there are several CheckCastPP
// or returns NULL if there is no one.
Node *result_cast();
virtual uint match_edge(uint idx) const;
#ifndef PRODUCT
virtual void dump_req() const;
virtual void dump_spec(outputStream *st) const;
#endif
};
//------------------------------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.)
class CallJavaNode : public CallNode {
protected:
virtual uint cmp( const Node &n ) const;
virtual uint size_of() const; // Size is bigger
bool _optimized_virtual;
ciMethod* _method; // Method being direct called
public:
const int _bci; // Byte Code Index of call byte code
CallJavaNode(const TypeFunc* tf , address addr, ciMethod* method, int bci)
: CallNode(tf, addr, TypePtr::BOTTOM),
_method(method), _bci(bci), _optimized_virtual(false)
{
init_class_id(Class_CallJava);
}
virtual int Opcode() const;
ciMethod* method() const { return _method; }
void set_method(ciMethod *m) { _method = m; }
void set_optimized_virtual(bool f) { _optimized_virtual = f; }
bool is_optimized_virtual() const { return _optimized_virtual; }
#ifndef PRODUCT
virtual void dump_spec(outputStream *st) const;
#endif
};
//------------------------------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.
class CallStaticJavaNode : public CallJavaNode {
virtual uint cmp( const Node &n ) const;
virtual uint size_of() const; // Size is bigger
public:
CallStaticJavaNode(const TypeFunc* tf, address addr, ciMethod* method, int bci)
: CallJavaNode(tf, addr, method, bci), _name(NULL) {
init_class_id(Class_CallStaticJava);
}
CallStaticJavaNode(const TypeFunc* tf, address addr, const char* name, int bci,
const TypePtr* adr_type)
: CallJavaNode(tf, addr, NULL, bci), _name(name) {
init_class_id(Class_CallStaticJava);
// This node calls a runtime stub, which often has narrow memory effects.
_adr_type = adr_type;
}
const char *_name; // Runtime wrapper name
// If this is an uncommon trap, return the request code, else zero.
int uncommon_trap_request() const;
static int extract_uncommon_trap_request(const Node* call);
virtual int Opcode() const;
#ifndef PRODUCT
virtual void dump_spec(outputStream *st) const;
#endif
};
//------------------------------CallDynamicJavaNode----------------------------
// Make a dispatched call using Java calling convention.
class CallDynamicJavaNode : public CallJavaNode {
virtual uint cmp( const Node &n ) const;
virtual uint size_of() const; // Size is bigger
public:
CallDynamicJavaNode( const TypeFunc *tf , address addr, ciMethod* method, int vtable_index, int bci ) : CallJavaNode(tf,addr,method,bci), _vtable_index(vtable_index) {
init_class_id(Class_CallDynamicJava);
}
int _vtable_index;
virtual int Opcode() const;
#ifndef PRODUCT
virtual void dump_spec(outputStream *st) const;
#endif
};
//------------------------------CallRuntimeNode--------------------------------
// Make a direct subroutine call node into compiled C++ code.
class CallRuntimeNode : public CallNode {
virtual uint cmp( const Node &n ) const;
virtual uint size_of() const; // Size is bigger
public:
CallRuntimeNode(const TypeFunc* tf, address addr, const char* name,
const TypePtr* adr_type)
: CallNode(tf, addr, adr_type),
_name(name)
{
init_class_id(Class_CallRuntime);
}
const char *_name; // Printable name, if _method is NULL
virtual int Opcode() const;
virtual void calling_convention( BasicType* sig_bt, VMRegPair *parm_regs, uint argcnt ) const;
#ifndef PRODUCT
virtual void dump_spec(outputStream *st) const;
#endif
};
//------------------------------CallLeafNode-----------------------------------
// Make a direct subroutine call node into compiled C++ code, without
// safepoints
class CallLeafNode : public CallRuntimeNode {
public:
CallLeafNode(const TypeFunc* tf, address addr, const char* name,
const TypePtr* adr_type)
: CallRuntimeNode(tf, addr, name, adr_type)
{
init_class_id(Class_CallLeaf);
}
virtual int Opcode() const;
virtual bool guaranteed_safepoint() { return false; }
#ifndef PRODUCT
virtual void dump_spec(outputStream *st) const;
#endif
};
//------------------------------CallLeafNoFPNode-------------------------------
// CallLeafNode, not using floating point or using it in the same manner as
// the generated code
class CallLeafNoFPNode : public CallLeafNode {
public:
CallLeafNoFPNode(const TypeFunc* tf, address addr, const char* name,
const TypePtr* adr_type)
: CallLeafNode(tf, addr, name, adr_type)
{
}
virtual int Opcode() const;
};
//------------------------------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.
//
class AllocateNode : public CallNode {
public:
enum {
// Output:
RawAddress = TypeFunc::Parms, // the newly-allocated raw address
// Inputs:
AllocSize = TypeFunc::Parms, // size (in bytes) of the new object
KlassNode, // type (maybe dynamic) of the obj.
InitialTest, // slow-path test (may be constant)
ALength, // array length (or TOP if none)
ParmLimit
};
static const TypeFunc* alloc_type() {
const Type** fields = TypeTuple::fields(ParmLimit - TypeFunc::Parms);
fields[AllocSize] = TypeInt::POS;
fields[KlassNode] = TypeInstPtr::NOTNULL;
fields[InitialTest] = TypeInt::BOOL;
fields[ALength] = TypeInt::INT; // length (can be a bad length)
const TypeTuple *domain = TypeTuple::make(ParmLimit, fields);
// create result type (range)
fields = TypeTuple::fields(1);
fields[TypeFunc::Parms+0] = TypeRawPtr::NOTNULL; // Returned oop
const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+1, fields);
return TypeFunc::make(domain, range);
}
bool _is_scalar_replaceable; // Result of Escape Analysis
virtual uint size_of() const; // Size is bigger
AllocateNode(Compile* C, const TypeFunc *atype, Node *ctrl, Node *mem, Node *abio,
Node *size, Node *klass_node, Node *initial_test);
// Expansion modifies the JVMState, so we need to clone it
virtual void clone_jvms() {
set_jvms(jvms()->clone_deep(Compile::current()));
}
virtual int Opcode() const;
virtual uint ideal_reg() const { return Op_RegP; }
virtual bool guaranteed_safepoint() { return false; }
// allocations do not modify their arguments
virtual bool may_modify(const TypePtr *addr_t, PhaseTransform *phase) { return false;}
// 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
// GraphKit::new_instance/new_array, whose output it recognizes.)
// The 'ptr' may not have an offset unless the 'offset' argument is given.
static AllocateNode* Ideal_allocation(Node* ptr, PhaseTransform* phase);
// 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.)
static AllocateNode* Ideal_allocation(Node* ptr, PhaseTransform* phase,
intptr_t& offset);
// Dig the klass operand out of a (possible) allocation site.
static Node* Ideal_klass(Node* ptr, PhaseTransform* phase) {
AllocateNode* allo = Ideal_allocation(ptr, phase);
return (allo == NULL) ? NULL : allo->in(KlassNode);
}
// Conservatively small estimate of offset of first non-header byte.
int minimum_header_size() {
return is_AllocateArray() ? arrayOopDesc::base_offset_in_bytes(T_BYTE) :
instanceOopDesc::base_offset_in_bytes();
}
// 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.)
InitializeNode* initialization();
// Convenience for initialization->maybe_set_complete(phase)
bool maybe_set_complete(PhaseGVN* phase);
};
//------------------------------AllocateArray---------------------------------
//
// High-level array allocation
//
class AllocateArrayNode : public AllocateNode {
public:
AllocateArrayNode(Compile* C, const TypeFunc *atype, Node *ctrl, Node *mem, Node *abio,
Node* size, Node* klass_node, Node* initial_test,
Node* count_val
)
: AllocateNode(C, atype, ctrl, mem, abio, size, klass_node,
initial_test)
{
init_class_id(Class_AllocateArray);
set_req(AllocateNode::ALength, count_val);
}
virtual int Opcode() const;
virtual uint size_of() const; // Size is bigger
// Pattern-match a possible usage of AllocateArrayNode.
// Return null if no allocation is recognized.
static AllocateArrayNode* Ideal_array_allocation(Node* ptr, PhaseTransform* phase) {
AllocateNode* allo = Ideal_allocation(ptr, phase);
return (allo == NULL || !allo->is_AllocateArray())
? NULL : allo->as_AllocateArray();
}
// Dig the length operand out of a (possible) array allocation site.
static Node* Ideal_length(Node* ptr, PhaseTransform* phase) {
AllocateArrayNode* allo = Ideal_array_allocation(ptr, phase);
return (allo == NULL) ? NULL : allo->in(AllocateNode::ALength);
}
};
//------------------------------AbstractLockNode-----------------------------------
class AbstractLockNode: public CallNode {
private:
bool _eliminate; // indicates this lock can be safely eliminated
#ifndef PRODUCT
NamedCounter* _counter;
#endif
protected:
// helper functions for lock elimination
//
bool find_matching_unlock(const Node* ctrl, LockNode* lock,
GrowableArray<AbstractLockNode*> &lock_ops);
bool find_lock_and_unlock_through_if(Node* node, LockNode* lock,
GrowableArray<AbstractLockNode*> &lock_ops);
bool find_unlocks_for_region(const RegionNode* region, LockNode* lock,
GrowableArray<AbstractLockNode*> &lock_ops);
LockNode *find_matching_lock(UnlockNode* unlock);
public:
AbstractLockNode(const TypeFunc *tf)
: CallNode(tf, NULL, TypeRawPtr::BOTTOM),
_eliminate(false)
{
#ifndef PRODUCT
_counter = NULL;
#endif
}
virtual int Opcode() const = 0;
Node * obj_node() const {return in(TypeFunc::Parms + 0); }
Node * box_node() const {return in(TypeFunc::Parms + 1); }
Node * fastlock_node() const {return in(TypeFunc::Parms + 2); }
const Type *sub(const Type *t1, const Type *t2) const { return TypeInt::CC;}
virtual uint size_of() const { return sizeof(*this); }
bool is_eliminated() {return _eliminate; }
// mark node as eliminated and update the counter if there is one
void set_eliminated();
// locking does not modify its arguments
virtual bool may_modify(const TypePtr *addr_t, PhaseTransform *phase){ return false;}
#ifndef PRODUCT
void create_lock_counter(JVMState* s);
NamedCounter* counter() const { return _counter; }
#endif
};
//------------------------------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":
// 0 - object to lock
// 1 - a BoxLockNode
// 2 - a FastLockNode
//
class LockNode : public AbstractLockNode {
public:
static const TypeFunc *lock_type() {
// create input type (domain)
const Type **fields = TypeTuple::fields(3);
fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL; // Object to be Locked
fields[TypeFunc::Parms+1] = TypeRawPtr::BOTTOM; // Address of stack location for lock
fields[TypeFunc::Parms+2] = TypeInt::BOOL; // FastLock
const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+3,fields);
// create result type (range)
fields = TypeTuple::fields(0);
const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+0,fields);
return TypeFunc::make(domain,range);
}
virtual int Opcode() const;
virtual uint size_of() const; // Size is bigger
LockNode(Compile* C, const TypeFunc *tf) : AbstractLockNode( tf ) {
init_class_id(Class_Lock);
init_flags(Flag_is_macro);
C->add_macro_node(this);
}
virtual bool guaranteed_safepoint() { return false; }
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
// Expansion modifies the JVMState, so we need to clone it
virtual void clone_jvms() {
set_jvms(jvms()->clone_deep(Compile::current()));
}
};
//------------------------------Unlock---------------------------------------
// High-level unlock operation
class UnlockNode : public AbstractLockNode {
public:
virtual int Opcode() const;
virtual uint size_of() const; // Size is bigger
UnlockNode(Compile* C, const TypeFunc *tf) : AbstractLockNode( tf ) {
init_class_id(Class_Unlock);
init_flags(Flag_is_macro);
C->add_macro_node(this);
}
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
// unlock is never a safepoint
virtual bool guaranteed_safepoint() { return false; }
};