1.1 --- a/src/share/vm/opto/callnode.hpp Sat Jan 07 10:39:23 2012 -0800 1.2 +++ b/src/share/vm/opto/callnode.hpp Sat Jan 07 13:26:43 2012 -0800 1.3 @@ -840,8 +840,12 @@ 1.4 //------------------------------AbstractLockNode----------------------------------- 1.5 class AbstractLockNode: public CallNode { 1.6 private: 1.7 - bool _eliminate; // indicates this lock can be safely eliminated 1.8 - bool _coarsened; // indicates this lock was coarsened 1.9 + enum { 1.10 + Regular = 0, // Normal lock 1.11 + NonEscObj, // Lock is used for non escaping object 1.12 + Coarsened, // Lock was coarsened 1.13 + Nested // Nested lock 1.14 + } _kind; 1.15 #ifndef PRODUCT 1.16 NamedCounter* _counter; 1.17 #endif 1.18 @@ -858,12 +862,13 @@ 1.19 GrowableArray<AbstractLockNode*> &lock_ops); 1.20 LockNode *find_matching_lock(UnlockNode* unlock); 1.21 1.22 + // Update the counter to indicate that this lock was eliminated. 1.23 + void set_eliminated_lock_counter() PRODUCT_RETURN; 1.24 1.25 public: 1.26 AbstractLockNode(const TypeFunc *tf) 1.27 : CallNode(tf, NULL, TypeRawPtr::BOTTOM), 1.28 - _coarsened(false), 1.29 - _eliminate(false) 1.30 + _kind(Regular) 1.31 { 1.32 #ifndef PRODUCT 1.33 _counter = NULL; 1.34 @@ -873,20 +878,23 @@ 1.35 Node * obj_node() const {return in(TypeFunc::Parms + 0); } 1.36 Node * box_node() const {return in(TypeFunc::Parms + 1); } 1.37 Node * fastlock_node() const {return in(TypeFunc::Parms + 2); } 1.38 + void set_box_node(Node* box) { set_req(TypeFunc::Parms + 1, box); } 1.39 + 1.40 const Type *sub(const Type *t1, const Type *t2) const { return TypeInt::CC;} 1.41 1.42 virtual uint size_of() const { return sizeof(*this); } 1.43 1.44 - bool is_eliminated() {return _eliminate; } 1.45 - // mark node as eliminated and update the counter if there is one 1.46 - void set_eliminated(); 1.47 + bool is_eliminated() const { return (_kind != Regular); } 1.48 + bool is_non_esc_obj() const { return (_kind == NonEscObj); } 1.49 + bool is_coarsened() const { return (_kind == Coarsened); } 1.50 + bool is_nested() const { return (_kind == Nested); } 1.51 1.52 - bool is_coarsened() { return _coarsened; } 1.53 - void set_coarsened() { _coarsened = true; } 1.54 - void clear_coarsened() { _coarsened = false; } 1.55 + void set_non_esc_obj() { _kind = NonEscObj; set_eliminated_lock_counter(); } 1.56 + void set_coarsened() { _kind = Coarsened; set_eliminated_lock_counter(); } 1.57 + void set_nested() { _kind = Nested; set_eliminated_lock_counter(); } 1.58 1.59 // locking does not modify its arguments 1.60 - virtual bool may_modify(const TypePtr *addr_t, PhaseTransform *phase){ return false;} 1.61 + virtual bool may_modify(const TypePtr *addr_t, PhaseTransform *phase){ return false;} 1.62 1.63 #ifndef PRODUCT 1.64 void create_lock_counter(JVMState* s); 1.65 @@ -936,6 +944,8 @@ 1.66 virtual void clone_jvms() { 1.67 set_jvms(jvms()->clone_deep(Compile::current())); 1.68 } 1.69 + 1.70 + bool is_nested_lock_region(); // Is this Lock nested? 1.71 }; 1.72 1.73 //------------------------------Unlock---------------------------------------