src/share/vm/opto/locknode.hpp

Fri, 07 Mar 2008 11:09:13 -0800

author
kvn
date
Fri, 07 Mar 2008 11:09:13 -0800
changeset 476
874b2c4f43d1
parent 435
a61af66fc99e
child 501
6dbf1a175d6b
permissions
-rw-r--r--

6667605: (Escape Analysis) inline java constructors when EA is on
Summary: java constructors should be inlined to be able scalar replace a new object
Reviewed-by: rasbold

duke@435 1 /*
duke@435 2 * Copyright 1999-2006 Sun Microsystems, Inc. All Rights Reserved.
duke@435 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@435 4 *
duke@435 5 * This code is free software; you can redistribute it and/or modify it
duke@435 6 * under the terms of the GNU General Public License version 2 only, as
duke@435 7 * published by the Free Software Foundation.
duke@435 8 *
duke@435 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@435 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@435 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@435 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@435 13 * accompanied this code).
duke@435 14 *
duke@435 15 * You should have received a copy of the GNU General Public License version
duke@435 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@435 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@435 18 *
duke@435 19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
duke@435 20 * CA 95054 USA or visit www.sun.com if you need additional information or
duke@435 21 * have any questions.
duke@435 22 *
duke@435 23 */
duke@435 24
duke@435 25 //------------------------------BoxLockNode------------------------------------
duke@435 26 class BoxLockNode : public Node {
duke@435 27 public:
duke@435 28 const int _slot;
duke@435 29 RegMask _inmask;
duke@435 30
duke@435 31 BoxLockNode( int lock );
duke@435 32 virtual int Opcode() const;
duke@435 33 virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const;
duke@435 34 virtual uint size(PhaseRegAlloc *ra_) const;
duke@435 35 virtual const RegMask &in_RegMask(uint) const;
duke@435 36 virtual const RegMask &out_RegMask() const;
duke@435 37 virtual uint size_of() const;
duke@435 38 virtual uint hash() const { return Node::hash() + _slot; }
duke@435 39 virtual uint cmp( const Node &n ) const;
duke@435 40 virtual const class Type *bottom_type() const { return TypeRawPtr::BOTTOM; }
duke@435 41 virtual uint ideal_reg() const { return Op_RegP; }
duke@435 42
duke@435 43 static OptoReg::Name stack_slot(Node* box_node);
duke@435 44
duke@435 45 #ifndef PRODUCT
duke@435 46 virtual void format( PhaseRegAlloc *, outputStream *st ) const;
duke@435 47 virtual void dump_spec(outputStream *st) const { st->print(" Lock %d",_slot); }
duke@435 48 #endif
duke@435 49 };
duke@435 50
duke@435 51 //------------------------------FastLockNode-----------------------------------
duke@435 52 class FastLockNode: public CmpNode {
duke@435 53 private:
duke@435 54 BiasedLockingCounters* _counters;
duke@435 55
duke@435 56 public:
duke@435 57 FastLockNode(Node *ctrl, Node *oop, Node *box) : CmpNode(oop,box) {
duke@435 58 init_req(0,ctrl);
duke@435 59 init_class_id(Class_FastLock);
duke@435 60 _counters = NULL;
duke@435 61 }
duke@435 62 Node* obj_node() const { return in(1); }
duke@435 63 Node* box_node() const { return in(2); }
duke@435 64
duke@435 65 // FastLock and FastUnlockNode do not hash, we need one for each correspoding
duke@435 66 // LockNode/UnLockNode to avoid creating Phi's.
duke@435 67 virtual uint hash() const ; // { return NO_HASH; }
duke@435 68 virtual uint cmp( const Node &n ) const ; // Always fail, except on self
duke@435 69 virtual int Opcode() const;
duke@435 70 virtual const Type *Value( PhaseTransform *phase ) const { return TypeInt::CC; }
duke@435 71 const Type *sub(const Type *t1, const Type *t2) const { return TypeInt::CC;}
duke@435 72
duke@435 73 void create_lock_counter(JVMState* s);
duke@435 74 BiasedLockingCounters* counters() const { return _counters; }
duke@435 75 };
duke@435 76
duke@435 77
duke@435 78 //------------------------------FastUnlockNode---------------------------------
duke@435 79 class FastUnlockNode: public CmpNode {
duke@435 80 public:
duke@435 81 FastUnlockNode(Node *ctrl, Node *oop, Node *box) : CmpNode(oop,box) {
duke@435 82 init_req(0,ctrl);
duke@435 83 init_class_id(Class_FastUnlock);
duke@435 84 }
duke@435 85 Node* obj_node() const { return in(1); }
duke@435 86 Node* box_node() const { return in(2); }
duke@435 87
duke@435 88
duke@435 89 // FastLock and FastUnlockNode do not hash, we need one for each correspoding
duke@435 90 // LockNode/UnLockNode to avoid creating Phi's.
duke@435 91 virtual uint hash() const ; // { return NO_HASH; }
duke@435 92 virtual uint cmp( const Node &n ) const ; // Always fail, except on self
duke@435 93 virtual int Opcode() const;
duke@435 94 virtual const Type *Value( PhaseTransform *phase ) const { return TypeInt::CC; }
duke@435 95 const Type *sub(const Type *t1, const Type *t2) const { return TypeInt::CC;}
duke@435 96
duke@435 97 };

mercurial