diff --- vm/em/src/NValueProfileCollector.cpp | 2 +- vm/em/src/NValueProfileCollector.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vm/em/src/NValueProfileCollector.cpp b/vm/em/src/NValueProfileCollector.cpp index 77ac147..59966b2 100644 --- a/vm/em/src/NValueProfileCollector.cpp +++ b/vm/em/src/NValueProfileCollector.cpp @@ -170,7 +170,7 @@ void TNVTableFirstNManager::insert(Table void TNVTableFirstNManager::addNewValue(ValueMethodProfile* methProfile, VPData* instProfile, ValueT curr_value) { - uint8* updating_ptr = methProfile->getUpdatingStatePtr(); + volatile uint8* updating_ptr = methProfile->getUpdatingStatePtr(); if (updateStrategy == UPDATE_LOCKED) { methProfile->lockProfile(); } else if (updateStrategy == UPDATE_FLAGGED_ALL) { diff --git a/vm/em/src/NValueProfileCollector.h b/vm/em/src/NValueProfileCollector.h index 85e1bc0..090e8bf 100644 --- a/vm/em/src/NValueProfileCollector.h +++ b/vm/em/src/NValueProfileCollector.h @@ -203,7 +203,7 @@ public: // (updatingState == 1) when method profile is being updated to skip // concurrent modifications. // (updatingState == 0) when profile is open for modifications. - uint8* getUpdatingStatePtr() { return &updatingState; } + volatile uint8* getUpdatingStatePtr() { return &updatingState; } private: ValueProfileCollector* getVPC() const; @@ -213,7 +213,7 @@ private: // The lock and the atomically modified updatingState flag operate per // method to allow simultaneous updates for distinct methods. hymutex_t lock; - uint8 updatingState; + volatile uint8 updatingState; }; POINTER_SIZE_INT value_profiler_get_top_value (Method_Profile_Handle mph, uint32 instructionKey);