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 2245263006: [interpreter] Fix canonicalization when preserving bytecode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix comment. 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-638551.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 54ea359c6598631674cb232499c4defd9409ba21..f5be30ecf3c278ea8e865993fcedcbef9f25463e 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -1755,16 +1755,18 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfo(
maybe_existing = script->FindSharedFunctionInfo(literal);
}
- // We found an existing shared function info. If it's already compiled,
- // don't worry about compiling it, and simply return it. If it's not yet
- // compiled, continue to decide whether to eagerly compile.
- // Carry on if we are compiling eager to obtain code for debugging,
- // unless we already have code with debut break slots.
+ // We found an existing shared function info. If it has any sort of code
+ // attached, don't worry about compiling and simply return it. Otherwise,
+ // continue to decide whether to eagerly compile.
+ // Note that we also carry on if we are compiling eager to obtain code for
+ // debugging, unless we already have code with debug break slots.
Handle<SharedFunctionInfo> existing;
- if (maybe_existing.ToHandle(&existing) && existing->is_compiled()) {
+ if (maybe_existing.ToHandle(&existing)) {
DCHECK(!existing->is_toplevel());
- if (!outer_info->is_debug() || existing->HasDebugCode()) {
- return existing;
+ if (existing->HasBaselineCode() || existing->HasBytecodeArray()) {
+ if (!outer_info->is_debug() || existing->HasDebugCode()) {
rmcilroy 2016/08/18 10:26:06 Should this be HasDebugCode() || HasDebugBytecode(
rmcilroy 2016/08/18 10:29:02 Sorry ignore this, HasDebugCode does what I though
+ return existing;
+ }
}
}
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-638551.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698