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

Unified Diff: src/execution.h

Issue 1031223004: Make climit and jslimit stack limits atomic. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 5 years, 8 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/execution.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/execution.h
diff --git a/src/execution.h b/src/execution.h
index 870bb9118465fbad32460d42827158f1908ef1c5..446a459a806c6a50761c768ab17138a31ae7a474 100644
--- a/src/execution.h
+++ b/src/execution.h
@@ -171,18 +171,14 @@ class StackGuard FINAL {
#undef V
};
+ uintptr_t climit() { return thread_local_.climit(); }
+ uintptr_t jslimit() { return thread_local_.jslimit(); }
// This provides an asynchronous read of the stack limits for the current
// thread. There are no locks protecting this, but it is assumed that you
// have the global V8 lock if you are using multiple V8 threads.
- uintptr_t climit() {
- return thread_local_.climit_;
- }
uintptr_t real_climit() {
return thread_local_.real_climit_;
}
- uintptr_t jslimit() {
- return thread_local_.jslimit_;
- }
uintptr_t real_jslimit() {
return thread_local_.real_jslimit_;
}
@@ -256,9 +252,27 @@ class StackGuard FINAL {
// fail. Both the generated code and the runtime system check against the
// one without the real_ prefix.
uintptr_t real_jslimit_; // Actual JavaScript stack limit set for the VM.
- uintptr_t jslimit_;
uintptr_t real_climit_; // Actual C++ stack limit set for the VM.
- uintptr_t climit_;
+
+ // jslimit_ and climit_ can be read without any lock.
+ // Writing requires the ExecutionAccess lock.
+ base::AtomicWord jslimit_;
+ base::AtomicWord climit_;
+
+ uintptr_t jslimit() {
+ return bit_cast<uintptr_t>(base::NoBarrier_Load(&jslimit_));
+ }
+ void set_jslimit(uintptr_t limit) {
+ return base::NoBarrier_Store(&jslimit_,
+ static_cast<base::AtomicWord>(limit));
+ }
+ uintptr_t climit() {
+ return bit_cast<uintptr_t>(base::NoBarrier_Load(&climit_));
+ }
+ void set_climit(uintptr_t limit) {
+ return base::NoBarrier_Store(&climit_,
+ static_cast<base::AtomicWord>(limit));
+ }
PostponeInterruptsScope* postpone_interrupts_;
int interrupt_flags_;
« no previous file with comments | « no previous file | src/execution.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698