Index: vm/em/src/NValueProfileCollector.cpp =================================================================== --- vm/em/src/NValueProfileCollector.cpp (revision 611159) +++ vm/em/src/NValueProfileCollector.cpp (working copy) @@ -208,7 +208,6 @@ void ValueMethodProfile::addNewValue(uint32 instructionKey, POINTER_SIZE_INT valueToAdd) { POINTER_SIZE_INT curr_value = valueToAdd; - lockProfile(); VPDataMap::const_iterator it = ValueMap.find(instructionKey); assert(it != ValueMap.end()); VPInstructionProfileData* _temp_vp = it->second; @@ -228,12 +227,13 @@ (*num_times_profiled)++; } else { + lockProfile(); flushInstProfile(_temp_vp); *num_times_profiled = 1; getVPC()->insert_into_tnv_table (TNV_steady_part, TNV_clear_part, valueToAdd, *num_times_profiled); *last_value = curr_value; + unlockProfile(); } - unlockProfile(); }