Index: src/debug/debug.cc |
diff --git a/src/debug/debug.cc b/src/debug/debug.cc |
index 4bd5fa0cf0cd64b761d4bacb59195ac52b2ab28d..e57cc5a88ce69a4c7907e8d816db96eebf13a943 100644 |
--- a/src/debug/debug.cc |
+++ b/src/debug/debug.cc |
@@ -1157,13 +1157,15 @@ |
List<Handle<JSFunction> > functions; |
List<Handle<JSGeneratorObject> > suspended_generators; |
- // Flush all optimized code. Note that the below heap iteration does not |
+ // 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()) { |
- shared->ClearCodeFromOptimizedCodeMap(); |
+ if (!shared->OptimizedCodeMapIsCleared()) { |
+ shared->ClearOptimizedCodeMap(); |
+ } |
} |
} |
@@ -1205,7 +1207,6 @@ |
for (Handle<JSFunction> const function : functions) { |
function->ReplaceCode(shared->code()); |
- JSFunction::EnsureLiterals(function); |
} |
for (Handle<JSGeneratorObject> const generator_obj : suspended_generators) { |