Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1045)

Unified Diff: src/vm-state.h

Issue 2852047: Fix concurrent access to VMState::current_state_. (Closed)
Patch Set: Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/vm-state.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/vm-state.h
diff --git a/src/vm-state.h b/src/vm-state.h
index 241df4c9d48cbb36ce5f84378f7594ab831cbc5c..080eb8ded6a2b3fc4325528ccf8dfb59fff5c70e 100644
--- a/src/vm-state.h
+++ b/src/vm-state.h
@@ -44,15 +44,17 @@ class VMState BASE_EMBEDDED {
// Used for debug asserts.
static bool is_outermost_external() {
- return current_state_ == NULL;
+ return current_state_ == 0;
}
static StateTag current_state() {
- return current_state_ ? current_state_->state() : EXTERNAL;
+ VMState* state = reinterpret_cast<VMState*>(current_state_);
+ return state ? state->state() : EXTERNAL;
}
static Address external_callback() {
- return current_state_ ? current_state_->external_callback_ : NULL;
+ VMState* state = reinterpret_cast<VMState*>(current_state_);
+ return state ? state->external_callback_ : NULL;
}
private:
@@ -62,7 +64,7 @@ class VMState BASE_EMBEDDED {
Address external_callback_;
// A stack of VM states.
- static VMState* current_state_;
+ static AtomicWord current_state_;
#else
public:
explicit VMState(StateTag state) {}
« no previous file with comments | « no previous file | src/vm-state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698