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

Side by Side Diff: src/debug.cc

Issue 948313002: Fix bogus assertion in Debug::PrepareStep. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/arguments.h" 8 #include "src/arguments.h"
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after
1348 { 1348 {
1349 // Find the break location where execution has stopped. 1349 // Find the break location where execution has stopped.
1350 DisallowHeapAllocation no_gc; 1350 DisallowHeapAllocation no_gc;
1351 BreakLocationIterator it(debug_info, ALL_BREAK_LOCATIONS); 1351 BreakLocationIterator it(debug_info, ALL_BREAK_LOCATIONS);
1352 1352
1353 // pc points to the instruction after the current one, possibly a break 1353 // pc points to the instruction after the current one, possibly a break
1354 // location as well. So the "- 1" to exclude it from the search. 1354 // location as well. So the "- 1" to exclude it from the search.
1355 it.FindBreakLocationFromAddress(frame->pc() - 1); 1355 it.FindBreakLocationFromAddress(frame->pc() - 1);
1356 1356
1357 is_exit = it.IsExit(); 1357 is_exit = it.IsExit();
1358 is_construct_call = RelocInfo::IsConstructCall(it.rmode());
1358 1359
1359 if (thread_local_.restarter_frame_function_pointer_ == NULL) { 1360 if (thread_local_.restarter_frame_function_pointer_ == NULL) {
1360 if (RelocInfo::IsCodeTarget(it.rinfo()->rmode())) { 1361 if (RelocInfo::IsCodeTarget(it.rinfo()->rmode())) {
1361 bool is_call_target = false; 1362 bool is_call_target = false;
1362 Address target = it.rinfo()->target_address(); 1363 Address target = it.rinfo()->target_address();
1363 Code* code = Code::GetCodeFromTargetAddress(target); 1364 Code* code = Code::GetCodeFromTargetAddress(target);
1364 1365
1365 is_call_target = code->is_call_stub(); 1366 is_call_target = code->is_call_stub();
1366 is_construct_call = RelocInfo::IsConstructCall(it.rmode());
1367 is_inline_cache_stub = code->is_inline_cache_stub(); 1367 is_inline_cache_stub = code->is_inline_cache_stub();
1368 is_load_or_store = is_inline_cache_stub && !is_call_target; 1368 is_load_or_store = is_inline_cache_stub && !is_call_target;
1369 1369
1370 // Check if target code is CallFunction stub. 1370 // Check if target code is CallFunction stub.
1371 Code* maybe_call_function_stub = code; 1371 Code* maybe_call_function_stub = code;
1372 // If there is a breakpoint at this line look at the original code to 1372 // If there is a breakpoint at this line look at the original code to
1373 // check if it is a CallFunction stub. 1373 // check if it is a CallFunction stub.
1374 if (it.IsDebugBreak()) { 1374 if (it.IsDebugBreak()) {
1375 Address original_target = it.original_rinfo()->target_address(); 1375 Address original_target = it.original_rinfo()->target_address();
1376 maybe_call_function_stub = 1376 maybe_call_function_stub =
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
1505 1505
1506 // Step in or Step in min 1506 // Step in or Step in min
1507 // Step in through construct call requires no changes to the running code. 1507 // Step in through construct call requires no changes to the running code.
1508 // Step in through getters/setters should already be prepared as well 1508 // Step in through getters/setters should already be prepared as well
1509 // because caller of this function (Debug::PrepareStep) is expected to 1509 // because caller of this function (Debug::PrepareStep) is expected to
1510 // flood the top frame's function with one shot breakpoints. 1510 // flood the top frame's function with one shot breakpoints.
1511 // Step in through CallFunction stub should also be prepared by caller of 1511 // Step in through CallFunction stub should also be prepared by caller of
1512 // this function (Debug::PrepareStep) which should flood target function 1512 // this function (Debug::PrepareStep) which should flood target function
1513 // with breakpoints. 1513 // with breakpoints.
1514 DCHECK(is_construct_call || is_inline_cache_stub || 1514 DCHECK(is_construct_call || is_inline_cache_stub ||
1515 !call_function_stub.is_null()); 1515 !call_function_stub.is_null() || is_at_restarted_function);
1516 ActivateStepIn(frame); 1516 ActivateStepIn(frame);
1517 } 1517 }
1518 } 1518 }
1519 1519
1520 1520
1521 // Check whether the current debug break should be reported to the debugger. It 1521 // Check whether the current debug break should be reported to the debugger. It
1522 // is used to have step next and step in only report break back to the debugger 1522 // is used to have step next and step in only report break back to the debugger
1523 // if on a different frame or in a different statement. In some situations 1523 // if on a different frame or in a different statement. In some situations
1524 // there will be several break points in the same statement when the code is 1524 // there will be several break points in the same statement when the code is
1525 // flooded with one-shot break points. This function helps to perform several 1525 // flooded with one-shot break points. This function helps to perform several
(...skipping 1946 matching lines...) Expand 10 before | Expand all | Expand 10 after
3472 logger_->DebugEvent("Put", message.text()); 3472 logger_->DebugEvent("Put", message.text());
3473 } 3473 }
3474 3474
3475 3475
3476 void LockingCommandMessageQueue::Clear() { 3476 void LockingCommandMessageQueue::Clear() {
3477 base::LockGuard<base::Mutex> lock_guard(&mutex_); 3477 base::LockGuard<base::Mutex> lock_guard(&mutex_);
3478 queue_.Clear(); 3478 queue_.Clear();
3479 } 3479 }
3480 3480
3481 } } // namespace v8::internal 3481 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698