src/share/vm/opto/graphKit.cpp

changeset 1964
4311f23817fd
parent 1949
b9bc732be7c0
child 2101
4b29a725c43c
equal deleted inserted replaced
1963:2389669474a6 1964:4311f23817fd
1787 increment_counter(adr1); 1787 increment_counter(adr1);
1788 } 1788 }
1789 1789
1790 void GraphKit::increment_counter(Node* counter_addr) { 1790 void GraphKit::increment_counter(Node* counter_addr) {
1791 int adr_type = Compile::AliasIdxRaw; 1791 int adr_type = Compile::AliasIdxRaw;
1792 Node* cnt = make_load(NULL, counter_addr, TypeInt::INT, T_INT, adr_type); 1792 Node* ctrl = control();
1793 Node* cnt = make_load(ctrl, counter_addr, TypeInt::INT, T_INT, adr_type);
1793 Node* incr = _gvn.transform(new (C, 3) AddINode(cnt, _gvn.intcon(1))); 1794 Node* incr = _gvn.transform(new (C, 3) AddINode(cnt, _gvn.intcon(1)));
1794 store_to_memory( NULL, counter_addr, incr, T_INT, adr_type ); 1795 store_to_memory( ctrl, counter_addr, incr, T_INT, adr_type );
1795 } 1796 }
1796 1797
1797 1798
1798 //------------------------------uncommon_trap---------------------------------- 1799 //------------------------------uncommon_trap----------------------------------
1799 // Bail out to the interpreter in mid-method. Implemented by calling the 1800 // Bail out to the interpreter in mid-method. Implemented by calling the
2769 #ifndef PRODUCT 2770 #ifndef PRODUCT
2770 if (PrintLockStatistics) { 2771 if (PrintLockStatistics) {
2771 // Update the counter for this lock. Don't bother using an atomic 2772 // Update the counter for this lock. Don't bother using an atomic
2772 // operation since we don't require absolute accuracy. 2773 // operation since we don't require absolute accuracy.
2773 lock->create_lock_counter(map()->jvms()); 2774 lock->create_lock_counter(map()->jvms());
2774 int adr_type = Compile::AliasIdxRaw; 2775 increment_counter(lock->counter()->addr());
2775 Node* counter_addr = makecon(TypeRawPtr::make(lock->counter()->addr()));
2776 Node* cnt = make_load(NULL, counter_addr, TypeInt::INT, T_INT, adr_type);
2777 Node* incr = _gvn.transform(new (C, 3) AddINode(cnt, _gvn.intcon(1)));
2778 store_to_memory(control(), counter_addr, incr, T_INT, adr_type);
2779 } 2776 }
2780 #endif 2777 #endif
2781 2778
2782 return flock; 2779 return flock;
2783 } 2780 }

mercurial