Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Unified Diff: src/heap/mark-compact.cc

Issue 2526243002: [GC] Fix code flushing to use bytecode if it exists. (Closed)
Patch Set: Fix cctests Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()) {
+ 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 =
« no previous file with comments | « no previous file | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698