Mercurial > hg > graal-jvmci-8
diff src/share/vm/opto/locknode.hpp @ 4777:e9a5e0a812c8
7125896: Eliminate nested locks
Summary: Nested locks elimination done before lock nodes expansion by looking for outer locks of the same object.
Reviewed-by: never, twisti
author | kvn |
---|---|
date | Sat, 07 Jan 2012 13:26:43 -0800 |
parents | 1d1603768966 |
children | b0ff910edfc9 |
line wrap: on
line diff
--- a/src/share/vm/opto/locknode.hpp Sat Jan 07 10:39:23 2012 -0800 +++ b/src/share/vm/opto/locknode.hpp Sat Jan 07 13:26:43 2012 -0800 @@ -49,11 +49,11 @@ //------------------------------BoxLockNode------------------------------------ class BoxLockNode : public Node { -public: const int _slot; RegMask _inmask; bool _is_eliminated; // indicates this lock was safely eliminated +public: BoxLockNode( int lock ); virtual int Opcode() const; virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const; @@ -66,11 +66,17 @@ virtual const class Type *bottom_type() const { return TypeRawPtr::BOTTOM; } virtual uint ideal_reg() const { return Op_RegP; } - static OptoReg::Name stack_slot(Node* box_node); + static OptoReg::Name reg(Node* box_node); + static BoxLockNode* box_node(Node* box_node); + static bool same_slot(Node* box1, Node* box2); + int stack_slot() const { return _slot; } - bool is_eliminated() { return _is_eliminated; } + bool is_eliminated() const { return _is_eliminated; } // mark lock as eliminated. - void set_eliminated() { _is_eliminated = true; } + void set_eliminated() { _is_eliminated = true; } + + // Is BoxLock node used for one simple lock region? + bool is_simple_lock_region(LockNode** unique_lock, Node* obj); #ifndef PRODUCT virtual void format( PhaseRegAlloc *, outputStream *st ) const; @@ -91,6 +97,7 @@ } Node* obj_node() const { return in(1); } Node* box_node() const { return in(2); } + void set_box_node(Node* box) { set_req(2, box); } // FastLock and FastUnlockNode do not hash, we need one for each correspoding // LockNode/UnLockNode to avoid creating Phi's.