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

Unified Diff: src/debug.cc

Issue 18198003: Abort optimization when debugger is turned on. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 | « src/compiler.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug.cc
diff --git a/src/debug.cc b/src/debug.cc
index e3ef2468cea6b94dbaf7b506760eccc992861627..efb95a06c7b880630bddeee97cd987a93ff9012a 100644
--- a/src/debug.cc
+++ b/src/debug.cc
@@ -2060,13 +2060,30 @@ void Debug::PrepareForBreakPoints() {
if (obj->IsJSFunction()) {
JSFunction* function = JSFunction::cast(obj);
SharedFunctionInfo* shared = function->shared();
- if (shared->allows_lazy_compilation() &&
- shared->script()->IsScript() &&
- function->code()->kind() == Code::FUNCTION &&
- !function->code()->has_debug_break_slots() &&
- shared->code()->gc_metadata() != active_code_marker) {
+
+ if (!shared->allows_lazy_compilation()) continue;
+ if (!shared->script()->IsScript()) continue;
+ if (shared->code()->gc_metadata() == active_code_marker) continue;
+
+ Code::Kind kind = function->code()->kind();
+ if (kind == Code::FUNCTION &&
+ !function->code()->has_debug_break_slots()) {
function->set_code(*lazy_compile);
function->shared()->set_code(*lazy_compile);
+ } else if (kind == Code::BUILTIN &&
+ (function->IsMarkedForInstallingRecompiledCode() ||
+ function->IsInRecompileQueue() ||
+ function->IsMarkedForLazyRecompilation() ||
+ function->IsMarkedForParallelRecompilation())) {
+ // Abort in-flight compilation.
+ Code* shared_code = function->shared()->code();
+ if (shared_code->kind() == Code::FUNCTION &&
+ shared_code->has_debug_break_slots()) {
+ function->set_code(shared_code);
+ } else {
+ function->set_code(*lazy_compile);
+ function->shared()->set_code(*lazy_compile);
+ }
}
}
}
« no previous file with comments | « src/compiler.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698