[debugger] Move clearing of optimized code map out of GC.

This moves the clearing of all optimized code maps out of the GC and
into the debugger to where it is actually required. The main goal here
is to simplify the logic in the already complex visitor for our shared
function info objects.

R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/1423713018

Cr-Commit-Position: refs/heads/master@{#31888}
This commit is contained in:
mstarzinger 2015-11-09 06:39:38 -08:00 committed by Commit bot
parent 54fb5c0da5
commit 8daa7215d4
2 changed files with 10 additions and 9 deletions

View File

@ -1305,8 +1305,16 @@ bool Debug::PrepareFunctionForBreakPoints(Handle<SharedFunctionInfo> shared) {
List<Handle<JSFunction> > functions;
List<Handle<JSGeneratorObject> > suspended_generators;
if (!shared->optimized_code_map()->IsSmi()) {
shared->ClearOptimizedCodeMap();
// Flush all optimized code maps. Note that the below heap iteration does not
// cover this, because the given function might have been inlined into code
// for which no JSFunction exists.
{
SharedFunctionInfo::Iterator iterator(isolate_);
while (SharedFunctionInfo* shared = iterator.Next()) {
if (!shared->optimized_code_map()->IsSmi()) {
shared->ClearOptimizedCodeMap();
}
}
}
// Make sure we abort incremental marking.

View File

@ -478,13 +478,6 @@ void StaticMarkingVisitor<StaticVisitor>::VisitSharedFunctionInfo(
VisitSharedFunctionInfoWeakCode(heap, object);
return;
}
} else {
// TODO(mstarzinger): Drop this case, it shouldn't be done here!
if (!shared->optimized_code_map()->IsSmi()) {
// Flush optimized code map on major GCs without code flushing,
// needed because cached code doesn't contain breakpoints.
shared->ClearOptimizedCodeMap();
}
}
VisitSharedFunctionInfoStrongCode(heap, object);
}