Commit 8daa7215 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[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}
parent 54fb5c0d
......@@ -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.
......
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment