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

Side by Side Diff: src/liveedit.cc

Issue 3029033: Fix 'step in' after live edit stack manipulation (Closed)
Patch Set: follow codereview Created 10 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 unified diff | Download patch
« no previous file with comments | « src/ia32/debug-ia32.cc ('k') | src/mips/debug-mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after
1181 } 1181 }
1182 1182
1183 1183
1184 // Removes specified range of frames from stack. There may be 1 or more 1184 // Removes specified range of frames from stack. There may be 1 or more
1185 // frames in range. Anyway the bottom frame is restarted rather than dropped, 1185 // frames in range. Anyway the bottom frame is restarted rather than dropped,
1186 // and therefore has to be a JavaScript frame. 1186 // and therefore has to be a JavaScript frame.
1187 // Returns error message or NULL. 1187 // Returns error message or NULL.
1188 static const char* DropFrames(Vector<StackFrame*> frames, 1188 static const char* DropFrames(Vector<StackFrame*> frames,
1189 int top_frame_index, 1189 int top_frame_index,
1190 int bottom_js_frame_index, 1190 int bottom_js_frame_index,
1191 Debug::FrameDropMode* mode) { 1191 Debug::FrameDropMode* mode,
1192 Object*** restarter_frame_function_pointer) {
1192 if (Debug::kFrameDropperFrameSize < 0) { 1193 if (Debug::kFrameDropperFrameSize < 0) {
1193 return "Stack manipulations are not supported in this architecture."; 1194 return "Stack manipulations are not supported in this architecture.";
1194 } 1195 }
1195 1196
1196 StackFrame* pre_top_frame = frames[top_frame_index - 1]; 1197 StackFrame* pre_top_frame = frames[top_frame_index - 1];
1197 StackFrame* top_frame = frames[top_frame_index]; 1198 StackFrame* top_frame = frames[top_frame_index];
1198 StackFrame* bottom_js_frame = frames[bottom_js_frame_index]; 1199 StackFrame* bottom_js_frame = frames[bottom_js_frame_index];
1199 1200
1200 ASSERT(bottom_js_frame->is_java_script()); 1201 ASSERT(bottom_js_frame->is_java_script());
1201 1202
(...skipping 29 matching lines...) Expand all
1231 // Committing now. After this point we should return only NULL value. 1232 // Committing now. After this point we should return only NULL value.
1232 1233
1233 FixTryCatchHandler(pre_top_frame, bottom_js_frame); 1234 FixTryCatchHandler(pre_top_frame, bottom_js_frame);
1234 // Make sure FixTryCatchHandler is idempotent. 1235 // Make sure FixTryCatchHandler is idempotent.
1235 ASSERT(!FixTryCatchHandler(pre_top_frame, bottom_js_frame)); 1236 ASSERT(!FixTryCatchHandler(pre_top_frame, bottom_js_frame));
1236 1237
1237 Handle<Code> code(Builtins::builtin(Builtins::FrameDropper_LiveEdit)); 1238 Handle<Code> code(Builtins::builtin(Builtins::FrameDropper_LiveEdit));
1238 top_frame->set_pc(code->entry()); 1239 top_frame->set_pc(code->entry());
1239 pre_top_frame->SetCallerFp(bottom_js_frame->fp()); 1240 pre_top_frame->SetCallerFp(bottom_js_frame->fp());
1240 1241
1241 Debug::SetUpFrameDropperFrame(bottom_js_frame, code); 1242 *restarter_frame_function_pointer =
1243 Debug::SetUpFrameDropperFrame(bottom_js_frame, code);
1244
1245 ASSERT((**restarter_frame_function_pointer)->IsJSFunction());
1242 1246
1243 for (Address a = unused_stack_top; 1247 for (Address a = unused_stack_top;
1244 a < unused_stack_bottom; 1248 a < unused_stack_bottom;
1245 a += kPointerSize) { 1249 a += kPointerSize) {
1246 Memory::Object_at(a) = Smi::FromInt(0); 1250 Memory::Object_at(a) = Smi::FromInt(0);
1247 } 1251 }
1248 1252
1249 return NULL; 1253 return NULL;
1250 } 1254 }
1251 1255
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
1321 // We are in check-only mode. 1325 // We are in check-only mode.
1322 return NULL; 1326 return NULL;
1323 } 1327 }
1324 1328
1325 if (!target_frame_found) { 1329 if (!target_frame_found) {
1326 // Nothing to drop. 1330 // Nothing to drop.
1327 return NULL; 1331 return NULL;
1328 } 1332 }
1329 1333
1330 Debug::FrameDropMode drop_mode = Debug::FRAMES_UNTOUCHED; 1334 Debug::FrameDropMode drop_mode = Debug::FRAMES_UNTOUCHED;
1335 Object** restarter_frame_function_pointer = NULL;
1331 const char* error_message = DropFrames(frames, top_frame_index, 1336 const char* error_message = DropFrames(frames, top_frame_index,
1332 bottom_js_frame_index, &drop_mode); 1337 bottom_js_frame_index, &drop_mode,
1338 &restarter_frame_function_pointer);
1333 1339
1334 if (error_message != NULL) { 1340 if (error_message != NULL) {
1335 return error_message; 1341 return error_message;
1336 } 1342 }
1337 1343
1338 // Adjust break_frame after some frames has been dropped. 1344 // Adjust break_frame after some frames has been dropped.
1339 StackFrame::Id new_id = StackFrame::NO_ID; 1345 StackFrame::Id new_id = StackFrame::NO_ID;
1340 for (int i = bottom_js_frame_index + 1; i < frames.length(); i++) { 1346 for (int i = bottom_js_frame_index + 1; i < frames.length(); i++) {
1341 if (frames[i]->type() == StackFrame::JAVA_SCRIPT) { 1347 if (frames[i]->type() == StackFrame::JAVA_SCRIPT) {
1342 new_id = frames[i]->id(); 1348 new_id = frames[i]->id();
1343 break; 1349 break;
1344 } 1350 }
1345 } 1351 }
1346 Debug::FramesHaveBeenDropped(new_id, drop_mode); 1352 Debug::FramesHaveBeenDropped(new_id, drop_mode,
1353 restarter_frame_function_pointer);
1347 1354
1348 // Replace "blocked on active" with "replaced on active" status. 1355 // Replace "blocked on active" with "replaced on active" status.
1349 for (int i = 0; i < array_len; i++) { 1356 for (int i = 0; i < array_len; i++) {
1350 if (result->GetElement(i) == 1357 if (result->GetElement(i) ==
1351 Smi::FromInt(LiveEdit::FUNCTION_BLOCKED_ON_ACTIVE_STACK)) { 1358 Smi::FromInt(LiveEdit::FUNCTION_BLOCKED_ON_ACTIVE_STACK)) {
1352 result->SetElement(i, Smi::FromInt( 1359 result->SetElement(i, Smi::FromInt(
1353 LiveEdit::FUNCTION_REPLACED_ON_ACTIVE_STACK)); 1360 LiveEdit::FUNCTION_REPLACED_ON_ACTIVE_STACK));
1354 } 1361 }
1355 } 1362 }
1356 return NULL; 1363 return NULL;
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1471 1478
1472 bool LiveEditFunctionTracker::IsActive() { 1479 bool LiveEditFunctionTracker::IsActive() {
1473 return false; 1480 return false;
1474 } 1481 }
1475 1482
1476 #endif // ENABLE_DEBUGGER_SUPPORT 1483 #endif // ENABLE_DEBUGGER_SUPPORT
1477 1484
1478 1485
1479 1486
1480 } } // namespace v8::internal 1487 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/debug-ia32.cc ('k') | src/mips/debug-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698