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

Unified Diff: src/debug.cc

Issue 8728031: Fix handling of recompiling code for optimized and inlined functions (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed review comments Created 9 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 | test/mjsunit/debug-break-inline.js » ('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 6e5a51f7df1d2a22c4b188fad0f4f5e7ea815c1c..c654dfbd2f012e24ccebff826c123cb6ad801837 100644
--- a/src/debug.cc
+++ b/src/debug.cc
@@ -1780,17 +1780,29 @@ void Debug::PrepareForBreakPoints() {
// values and performing a heap iteration.
AssertNoAllocation no_allocation;
- // Find all non-optimized code functions with activation frames on
- // the stack.
+ // Find all non-optimized code functions with activation frames
+ // on the stack. This includes functions which have optimized
+ // activations (including inlined functions) on the stack as the
+ // non-optimized code is needed for the lazy deoptimization.
for (JavaScriptFrameIterator it(isolate_); !it.done(); it.Advance()) {
JavaScriptFrame* frame = it.frame();
- if (frame->function()->IsJSFunction()) {
+ if (frame->is_optimized()) {
+ List<JSFunction*> functions(Compiler::kMaxInliningLevels + 1);
+ frame->GetFunctions(&functions);
+ for (int i = 0; i < functions.length(); i++) {
+ if (!functions[i]->shared()->code()->has_debug_break_slots()) {
+ active_functions.Add(Handle<JSFunction>(functions[i]));
+ }
+ }
+ } else if (frame->function()->IsJSFunction()) {
JSFunction* function = JSFunction::cast(frame->function());
if (function->code()->kind() == Code::FUNCTION &&
- !function->code()->has_debug_break_slots())
+ !function->code()->has_debug_break_slots()) {
active_functions.Add(Handle<JSFunction>(function));
+ }
}
}
+
// Sort the functions on the object pointer value to prepare for
// the binary search below.
active_functions.Sort(HandleObjectPointerCompare<JSFunction>);
@@ -1838,6 +1850,9 @@ void Debug::PrepareForBreakPoints() {
// Make sure that the shared full code is compiled with debug
// break slots.
+ if (function->code() == *lazy_compile) {
+ function->set_code(shared->code());
+ }
Handle<Code> current_code(function->code());
if (shared->code()->has_debug_break_slots()) {
// if the code is already recompiled to have break slots skip
@@ -1862,7 +1877,7 @@ void Debug::PrepareForBreakPoints() {
}
Handle<Code> new_code(shared->code());
- // Find the function and patch return address.
+ // Find the function and patch the return address.
for (JavaScriptFrameIterator it(isolate_); !it.done(); it.Advance()) {
JavaScriptFrame* frame = it.frame();
// If the current frame is for this function in its
« no previous file with comments | « no previous file | test/mjsunit/debug-break-inline.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698