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

Unified Diff: src/compiler.cc

Issue 2278543002: [compiler] Make Compiler::EnsureBytecode not switch tiers. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments. Created 4 years, 4 months 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 | test/mjsunit/regress/regress-crbug-635923.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index 9a5afe99dae54bb6a9afc2373bad51b165161acc..b9d38681c65b5b1aa57e39343228131c8068c563 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -1392,8 +1392,15 @@ MaybeHandle<JSArray> Compiler::CompileForLiveEdit(Handle<Script> script) {
bool Compiler::EnsureBytecode(CompilationInfo* info) {
DCHECK(ShouldUseIgnition(info));
if (!info->shared_info()->HasBytecodeArray()) {
- DCHECK(!info->shared_info()->is_compiled());
+ Handle<Code> original_code(info->shared_info()->code());
if (GetUnoptimizedCode(info).is_null()) return false;
+ DCHECK(info->shared_info()->is_compiled());
+ if (original_code->kind() == Code::FUNCTION) {
+ // Generating bytecode will install the {InterpreterEntryTrampoline} as
+ // shared code on the function. To avoid an implicit tier down we restore
+ // original baseline code in case it existed beforehand.
+ info->shared_info()->ReplaceCode(*original_code);
+ }
}
DCHECK(info->shared_info()->HasBytecodeArray());
return true;
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-635923.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698