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

Unified Diff: src/execution.cc

Issue 284483002: Revert "Revert interrupt handling code changed in r21208." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 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 ee359e722f68f45490778a6800e7e377c98328f7..ee6cb970cb8bd6d852f3e34a681e82d9f3efb686 100644
--- a/src/execution.cc
+++ b/src/execution.cc
@@ -388,6 +388,18 @@ void StackGuard::ClearInterrupt(int flagbit) {
}
+bool StackGuard::CheckAndClearInterrupt(InterruptFlag flag,
+ const ExecutionAccess& lock) {
+ int flagbit = 1 << flag;
+ bool result = (thread_local_.interrupt_flags_ & flagbit);
+ thread_local_.interrupt_flags_ &= ~flagbit;
+ if (!should_postpone_interrupts(lock) && !has_pending_interrupts(lock)) {
+ reset_limits(lock);
+ }
+ return result;
+}
+
+
char* StackGuard::ArchiveStackGuard(char* to) {
ExecutionAccess access(isolate_);
OS::MemCopy(to, reinterpret_cast<char*>(&thread_local_), sizeof(ThreadLocal));
@@ -720,44 +732,37 @@ void Execution::ProcessDebugMessages(Isolate* isolate,
Object* StackGuard::HandleInterrupts() {
- { ExecutionAccess access(isolate_);
- if (should_postpone_interrupts(access)) {
- return isolate_->heap()->undefined_value();
- }
+ ExecutionAccess access(isolate_);
+ if (should_postpone_interrupts(access)) {
+ return isolate_->heap()->undefined_value();
}
- if (CheckApiInterrupt()) {
- ClearApiInterrupt();
+ if (CheckAndClearInterrupt(API_INTERRUPT, access)) {
isolate_->InvokeApiInterruptCallback();
}
- if (CheckGC()) {
+ if (CheckAndClearInterrupt(GC_REQUEST, access)) {
isolate_->heap()->CollectAllGarbage(Heap::kNoGCFlags, "GC interrupt");
- ClearGC();
}
if (CheckDebugBreak() || CheckDebugCommand()) {
Execution::DebugBreakHelper(isolate_);
}
- if (CheckTerminateExecution()) {
- ClearTerminateExecution();
+ if (CheckAndClearInterrupt(TERMINATE_EXECUTION, access)) {
return isolate_->TerminateExecution();
}
- if (CheckFullDeopt()) {
- ClearFullDeopt();
+ if (CheckAndClearInterrupt(FULL_DEOPT, access)) {
Deoptimizer::DeoptimizeAll(isolate_);
}
- if (CheckDeoptMarkedAllocationSites()) {
- ClearDeoptMarkedAllocationSites();
+ if (CheckAndClearInterrupt(DEOPT_MARKED_ALLOCATION_SITES, access)) {
isolate_->heap()->DeoptMarkedAllocationSites();
}
- if (CheckInstallCode()) {
+ if (CheckAndClearInterrupt(INSTALL_CODE, access)) {
ASSERT(isolate_->concurrent_recompilation_enabled());
- ClearInstallCode();
isolate_->optimizing_compiler_thread()->InstallOptimizedFunctions();
}
« 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