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

Unified Diff: src/execution.cc

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 | « src/execution.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/execution.cc
diff --git a/src/execution.cc b/src/execution.cc
index e281bac5fa25e778bc0e9ddecd60565af3d2d796..0a45ee77c57d79ac222f573dc1ae754acbe85cb2 100644
--- a/src/execution.cc
+++ b/src/execution.cc
@@ -20,16 +20,16 @@ StackGuard::StackGuard()
void StackGuard::set_interrupt_limits(const ExecutionAccess& lock) {
DCHECK(isolate_ != NULL);
- thread_local_.jslimit_ = kInterruptLimit;
- thread_local_.climit_ = kInterruptLimit;
+ thread_local_.set_jslimit(kInterruptLimit);
+ thread_local_.set_climit(kInterruptLimit);
isolate_->heap()->SetStackLimits();
}
void StackGuard::reset_limits(const ExecutionAccess& lock) {
DCHECK(isolate_ != NULL);
- thread_local_.jslimit_ = thread_local_.real_jslimit_;
- thread_local_.climit_ = thread_local_.real_climit_;
+ thread_local_.set_jslimit(thread_local_.real_jslimit_);
+ thread_local_.set_climit(thread_local_.real_climit_);
isolate_->heap()->SetStackLimits();
}
@@ -354,11 +354,11 @@ void StackGuard::SetStackLimit(uintptr_t limit) {
// If the current limits are special (e.g. due to a pending interrupt) then
// leave them alone.
uintptr_t jslimit = SimulatorStack::JsLimitFromCLimit(isolate_, limit);
- if (thread_local_.jslimit_ == thread_local_.real_jslimit_) {
- thread_local_.jslimit_ = jslimit;
+ if (thread_local_.jslimit() == thread_local_.real_jslimit_) {
+ thread_local_.set_jslimit(jslimit);
}
- if (thread_local_.climit_ == thread_local_.real_climit_) {
- thread_local_.climit_ = limit;
+ if (thread_local_.climit() == thread_local_.real_climit_) {
+ thread_local_.set_climit(limit);
}
thread_local_.real_climit_ = limit;
thread_local_.real_jslimit_ = jslimit;
@@ -474,9 +474,9 @@ void StackGuard::FreeThreadResources() {
void StackGuard::ThreadLocal::Clear() {
real_jslimit_ = kIllegalLimit;
- jslimit_ = kIllegalLimit;
+ set_jslimit(kIllegalLimit);
real_climit_ = kIllegalLimit;
- climit_ = kIllegalLimit;
+ set_climit(kIllegalLimit);
postpone_interrupts_ = NULL;
interrupt_flags_ = 0;
}
@@ -489,9 +489,9 @@ bool StackGuard::ThreadLocal::Initialize(Isolate* isolate) {
DCHECK(GetCurrentStackPosition() > kLimitSize);
uintptr_t limit = GetCurrentStackPosition() - kLimitSize;
real_jslimit_ = SimulatorStack::JsLimitFromCLimit(isolate, limit);
- jslimit_ = SimulatorStack::JsLimitFromCLimit(isolate, limit);
+ set_jslimit(SimulatorStack::JsLimitFromCLimit(isolate, limit));
real_climit_ = limit;
- climit_ = limit;
+ set_climit(limit);
should_set_stack_limits = true;
}
postpone_interrupts_ = NULL;
« no previous file with comments | « src/execution.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698