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

Unified Diff: src/execution.cc

Issue 6542047: Basic implementation of incremental marking. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Created 9 years, 10 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
Index: src/execution.cc
diff --git a/src/execution.cc b/src/execution.cc
index f484d8d9b819af699e25786c8b66b8167441afe1..d1ada882c68a138e9197fc28d5089da3c86841d8 100644
--- a/src/execution.cc
+++ b/src/execution.cc
@@ -260,7 +260,7 @@ void StackGuard::DisableInterrupts() {
bool StackGuard::IsInterrupted() {
ExecutionAccess access;
- return thread_local_.interrupt_flags_ & INTERRUPT;
+ return (thread_local_.interrupt_flags_ & INTERRUPT) != 0;
}
@@ -286,7 +286,7 @@ void StackGuard::Preempt() {
bool StackGuard::IsTerminateExecution() {
ExecutionAccess access;
- return thread_local_.interrupt_flags_ & TERMINATE;
+ return (thread_local_.interrupt_flags_ & TERMINATE) != 0;
}
@@ -299,7 +299,7 @@ void StackGuard::TerminateExecution() {
bool StackGuard::IsRuntimeProfilerTick() {
ExecutionAccess access;
- return thread_local_.interrupt_flags_ & RUNTIME_PROFILER_TICK;
+ return (thread_local_.interrupt_flags_ & RUNTIME_PROFILER_TICK) != 0;
}
@@ -316,6 +316,22 @@ void StackGuard::RequestRuntimeProfilerTick() {
}
+bool StackGuard::IsGCRequest() {
+ ExecutionAccess access;
+ return (thread_local_.interrupt_flags_ & GC_REQUEST) != 0;
+}
+
+
+void StackGuard::RequestGC() {
+ ExecutionAccess access;
+ thread_local_.interrupt_flags_ |= GC_REQUEST;
+ if (thread_local_.postpone_interrupts_nesting_ == 0) {
+ thread_local_.jslimit_ = thread_local_.climit_ = kInterruptLimit;
+ Heap::SetStackLimits();
+ }
+}
+
+
#ifdef ENABLE_DEBUGGER_SUPPORT
bool StackGuard::IsDebugBreak() {
ExecutionAccess access;
@@ -704,6 +720,11 @@ void Execution::ProcessDebugMesssages(bool debug_command_only) {
#endif
MaybeObject* Execution::HandleStackGuardInterrupt() {
+ if (StackGuard::IsGCRequest()) {
+ Heap::CollectAllGarbage(false);
+ StackGuard::Continue(GC_REQUEST);
+ }
+
Counters::stack_interrupts.Increment();
if (StackGuard::IsRuntimeProfilerTick()) {
Counters::runtime_profiler_ticks.Increment();

Powered by Google App Engine
This is Rietveld 408576698