Index: src/mark-compact.cc |
diff --git a/src/mark-compact.cc b/src/mark-compact.cc |
index 0501ccf5805a0c752a01c4876895ba2b7863bf53..18d974943b81ab3a7d0a2e34b1c491c3e1cb36e9 100644 |
--- a/src/mark-compact.cc |
+++ b/src/mark-compact.cc |
@@ -2199,6 +2199,32 @@ void MarkCompactCollector::ProcessEphemeralMarking(ObjectVisitor* visitor) { |
} |
+static StackFrame* TopOptimizedFrame(Isolate* isolate) { |
+ for (StackFrameIterator it(isolate, isolate->thread_local_top()); |
+ !it.done(); it.Advance()) { |
+ if (it.frame()->type() == StackFrame::JAVA_SCRIPT) { |
+ return NULL; |
+ } |
+ if (it.frame()->type() == StackFrame::OPTIMIZED) { |
+ return it.frame(); |
+ } |
+ } |
+ return NULL; |
+} |
+ |
+ |
+void MarkCompactCollector::ProcessTopOptimizedFrame(ObjectVisitor* visitor) { |
+ StackFrame* frame = TopOptimizedFrame(isolate()); |
+ if (frame != NULL) { |
+ Code* code = frame->LookupCode(); |
+ if (!code->CanDeoptAt(frame->pc())) { |
+ code->CodeIterateBody(visitor); |
+ } |
+ ProcessMarkingDeque(); |
+ } |
+} |
+ |
+ |
void MarkCompactCollector::MarkLiveObjects() { |
GCTracer::Scope gc_scope(tracer_, GCTracer::Scope::MC_MARK); |
// The recursive GC marker detects when it is nearing stack overflow, |
@@ -2285,6 +2311,8 @@ void MarkCompactCollector::MarkLiveObjects() { |
RootMarkingVisitor root_visitor(heap()); |
MarkRoots(&root_visitor); |
+ ProcessTopOptimizedFrame(&root_visitor); |
+ |
// The objects reachable from the roots are marked, yet unreachable |
// objects are unmarked. Mark objects reachable due to host |
// application specific logic or through Harmony weak maps. |