From 9bd3128736dea26a20a71b15d1ba9b14d24658bd Mon Sep 17 00:00:00 2001 From: "mstarzinger@chromium.org" Date: Wed, 3 Jul 2013 09:47:22 +0000 Subject: [PATCH] Don't return frame by reference in ProcessTopOptimizedFrame. R=ulan@chromium.org Review URL: https://codereview.chromium.org/18592006 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15461 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/mark-compact.cc | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/src/mark-compact.cc b/src/mark-compact.cc index 449e6556e4..7eab22a8ce 100644 --- a/src/mark-compact.cc +++ b/src/mark-compact.cc @@ -2181,29 +2181,21 @@ void MarkCompactCollector::ProcessEphemeralMarking(ObjectVisitor* visitor) { } -static StackFrame* TopOptimizedFrame(Isolate* isolate) { - for (StackFrameIterator it(isolate, isolate->thread_local_top()); +void MarkCompactCollector::ProcessTopOptimizedFrame(ObjectVisitor* visitor) { + for (StackFrameIterator it(isolate(), isolate()->thread_local_top()); !it.done(); it.Advance()) { if (it.frame()->type() == StackFrame::JAVA_SCRIPT) { - return NULL; + return; } if (it.frame()->type() == StackFrame::OPTIMIZED) { - return it.frame(); + Code* code = it.frame()->LookupCode(); + if (!code->CanDeoptAt(it.frame()->pc())) { + code->CodeIterateBody(visitor); + } + ProcessMarkingDeque(); + return; } } - 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(); - } }