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

Unified Diff: src/compiler.cc

Issue 2044063002: [compiler] Improve contract for Compiler::CompileDebugCode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Workaround for regenerated bytecode. Created 4 years, 6 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 | src/debug/liveedit.h » ('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 9ed86dd3823d45519de31501d6eaa99a782803fd..445c46e2e02ff63b1545757e9ecfa01cf25e9bcf 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -433,7 +433,15 @@ void EnsureFeedbackMetadata(CompilationInfo* info) {
}
bool UseIgnition(CompilationInfo* info) {
- if (info->is_debug()) return false;
+ DCHECK(info->has_shared_info());
+
+ // When requesting debug code as a replacement for existing code, we provide
+ // the same kind as the existing code (to prevent implicit tier-change).
+ if (info->is_debug() && info->shared_info()->is_compiled()) {
+ return info->shared_info()->HasBytecodeArray();
+ }
+
+ // For generator or async functions we might avoid Ignition wholesale.
if (info->shared_info()->is_resumable() && !FLAG_ignition_generators) {
return false;
}
@@ -509,6 +517,12 @@ void InstallSharedScopeInfo(CompilationInfo* info,
void InstallSharedCompilationResult(CompilationInfo* info,
Handle<SharedFunctionInfo> shared) {
+ // TODO(mstarzinger): Compiling for debug code might be used to reveal inner
+ // functions via {FindSharedFunctionInfoInScript}, in which case we end up
+ // regenerating existing bytecode. Fix this!
+ if (info->is_debug() && info->has_bytecode_array()) {
+ shared->ClearBytecodeArray();
+ }
// Assert that we are not overwriting (possibly patched) debug code.
DCHECK(!shared->HasDebugInfo());
DCHECK(!info->code().is_null());
« no previous file with comments | « no previous file | src/debug/liveedit.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698