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

Unified Diff: src/execution.cc

Issue 7945009: Merge experimental/gc branch to the bleeding_edge. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 3 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') | src/extensions/gc-extension.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/execution.cc
===================================================================
--- src/execution.cc (revision 9327)
+++ src/execution.cc (working copy)
@@ -377,7 +377,7 @@
bool StackGuard::IsInterrupted() {
ExecutionAccess access(isolate_);
- return thread_local_.interrupt_flags_ & INTERRUPT;
+ return (thread_local_.interrupt_flags_ & INTERRUPT) != 0;
}
@@ -403,7 +403,7 @@
bool StackGuard::IsTerminateExecution() {
ExecutionAccess access(isolate_);
- return thread_local_.interrupt_flags_ & TERMINATE;
+ return (thread_local_.interrupt_flags_ & TERMINATE) != 0;
}
@@ -416,7 +416,7 @@
bool StackGuard::IsRuntimeProfilerTick() {
ExecutionAccess access(isolate_);
- return thread_local_.interrupt_flags_ & RUNTIME_PROFILER_TICK;
+ return (thread_local_.interrupt_flags_ & RUNTIME_PROFILER_TICK) != 0;
}
@@ -433,6 +433,22 @@
}
+bool StackGuard::IsGCRequest() {
+ ExecutionAccess access(isolate_);
+ return (thread_local_.interrupt_flags_ & GC_REQUEST) != 0;
+}
+
+
+void StackGuard::RequestGC() {
+ ExecutionAccess access(isolate_);
+ thread_local_.interrupt_flags_ |= GC_REQUEST;
+ if (thread_local_.postpone_interrupts_nesting_ == 0) {
+ thread_local_.jslimit_ = thread_local_.climit_ = kInterruptLimit;
+ isolate_->heap()->SetStackLimits();
+ }
+}
+
+
#ifdef ENABLE_DEBUGGER_SUPPORT
bool StackGuard::IsDebugBreak() {
ExecutionAccess access(isolate_);
@@ -852,6 +868,12 @@
MaybeObject* Execution::HandleStackGuardInterrupt() {
Isolate* isolate = Isolate::Current();
StackGuard* stack_guard = isolate->stack_guard();
+
+ if (stack_guard->IsGCRequest()) {
+ isolate->heap()->CollectAllGarbage(false);
+ stack_guard->Continue(GC_REQUEST);
+ }
+
isolate->counters()->stack_interrupts()->Increment();
if (stack_guard->IsRuntimeProfilerTick()) {
isolate->counters()->runtime_profiler_ticks()->Increment();
« no previous file with comments | « src/execution.h ('k') | src/extensions/gc-extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698