Chromium Code Reviews| Index: src/heap/mark-compact.cc |
| diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc |
| index bad3495bbe4befe1c583ff680b66bc8a845ff213..7177f88cc6c78b04e33add6ea9e36e58808e0f79 100644 |
| --- a/src/heap/mark-compact.cc |
| +++ b/src/heap/mark-compact.cc |
| @@ -904,6 +904,8 @@ void MarkCompactCollector::Finish() { |
| void CodeFlusher::ProcessJSFunctionCandidates() { |
| Code* lazy_compile = isolate_->builtins()->builtin(Builtins::kCompileLazy); |
| + Code* interpreter_entry_trampoline = |
| + isolate_->builtins()->builtin(Builtins::kInterpreterEntryTrampoline); |
| Object* undefined = isolate_->heap()->undefined_value(); |
| JSFunction* candidate = jsfunction_candidates_head_; |
| @@ -926,8 +928,13 @@ void CodeFlusher::ProcessJSFunctionCandidates() { |
| if (!shared->OptimizedCodeMapIsCleared()) { |
| shared->ClearOptimizedCodeMap(); |
| } |
| - shared->set_code(lazy_compile); |
| - candidate->set_code(lazy_compile); |
| + if (shared->HasBytecodeArray()) { |
|
Michael Starzinger
2016/11/24 12:14:45
I have the feeling we will have the same problem i
|
| + shared->set_code(interpreter_entry_trampoline); |
| + candidate->set_code(interpreter_entry_trampoline); |
| + } else { |
| + shared->set_code(lazy_compile); |
| + candidate->set_code(lazy_compile); |
| + } |
| } else { |
| DCHECK(Marking::IsBlack(code_mark)); |
| candidate->set_code(code); |
| @@ -954,7 +961,8 @@ void CodeFlusher::ProcessJSFunctionCandidates() { |
| void CodeFlusher::ProcessSharedFunctionInfoCandidates() { |
| Code* lazy_compile = isolate_->builtins()->builtin(Builtins::kCompileLazy); |
| - |
| + Code* interpreter_entry_trampoline = |
| + isolate_->builtins()->builtin(Builtins::kInterpreterEntryTrampoline); |
| SharedFunctionInfo* candidate = shared_function_info_candidates_head_; |
| SharedFunctionInfo* next_candidate; |
| while (candidate != NULL) { |
| @@ -973,7 +981,11 @@ void CodeFlusher::ProcessSharedFunctionInfoCandidates() { |
| if (!candidate->OptimizedCodeMapIsCleared()) { |
| candidate->ClearOptimizedCodeMap(); |
| } |
| - candidate->set_code(lazy_compile); |
| + if (candidate->HasBytecodeArray()) { |
| + candidate->set_code(interpreter_entry_trampoline); |
| + } else { |
| + candidate->set_code(lazy_compile); |
| + } |
| } |
| Object** code_slot = |