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

Unified Diff: src/isolate.h

Issue 359963004: Reland "Add mechanism to postpone interrupts selectively." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 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.cc ('k') | src/isolate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.h
diff --git a/src/isolate.h b/src/isolate.h
index ed2ed33ac74a432d44e9c7d5b3e20f2fc5b325bb..e2ab3fafa5a03dbd184ccebb1ffec7439be7ad31 100644
--- a/src/isolate.h
+++ b/src/isolate.h
@@ -1420,22 +1420,29 @@ class StackLimitCheck BASE_EMBEDDED {
// account.
class PostponeInterruptsScope BASE_EMBEDDED {
public:
- explicit PostponeInterruptsScope(Isolate* isolate)
- : stack_guard_(isolate->stack_guard()), isolate_(isolate) {
- ExecutionAccess access(isolate_);
- stack_guard_->thread_local_.postpone_interrupts_nesting_++;
- stack_guard_->DisableInterrupts();
+ PostponeInterruptsScope(Isolate* isolate,
+ int intercept_mask = StackGuard::ALL_INTERRUPTS)
+ : stack_guard_(isolate->stack_guard()),
+ intercept_mask_(intercept_mask),
+ intercepted_flags_(0) {
+ stack_guard_->PushPostponeInterruptsScope(this);
}
~PostponeInterruptsScope() {
- ExecutionAccess access(isolate_);
- if (--stack_guard_->thread_local_.postpone_interrupts_nesting_ == 0) {
- stack_guard_->EnableInterrupts();
- }
+ stack_guard_->PopPostponeInterruptsScope();
}
+
+ // Find the bottom-most scope that intercepts this interrupt.
+ // Return whether the interrupt has been intercepted.
+ bool Intercept(StackGuard::InterruptFlag flag);
+
private:
StackGuard* stack_guard_;
- Isolate* isolate_;
+ int intercept_mask_;
+ int intercepted_flags_;
+ PostponeInterruptsScope* prev_;
+
+ friend class StackGuard;
};
« no previous file with comments | « src/execution.cc ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698