| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 Handle<Code> target_code(Code::GetCodeFromTargetAddress(target)); | 403 Handle<Code> target_code(Code::GetCodeFromTargetAddress(target)); |
| 404 if (target_code->is_call_stub() || target_code->is_keyed_call_stub()) { | 404 if (target_code->is_call_stub() || target_code->is_keyed_call_stub()) { |
| 405 // Step in through IC call is handled by the runtime system. Therefore make | 405 // Step in through IC call is handled by the runtime system. Therefore make |
| 406 // sure that the any current IC is cleared and the runtime system is | 406 // sure that the any current IC is cleared and the runtime system is |
| 407 // called. If the executing code has a debug break at the location change | 407 // called. If the executing code has a debug break at the location change |
| 408 // the call in the original code as it is the code there that will be | 408 // the call in the original code as it is the code there that will be |
| 409 // executed in place of the debug break call. | 409 // executed in place of the debug break call. |
| 410 Handle<Code> stub = ComputeCallDebugPrepareStepIn( | 410 Handle<Code> stub = ComputeCallDebugPrepareStepIn( |
| 411 target_code->arguments_count(), target_code->kind()); | 411 target_code->arguments_count(), target_code->kind()); |
| 412 if (IsDebugBreak()) { | 412 if (IsDebugBreak()) { |
| 413 original_rinfo()->set_target_address(stub->entry(), code()); | 413 original_rinfo()->set_target_address(stub->entry()); |
| 414 } else { | 414 } else { |
| 415 rinfo()->set_target_address(stub->entry(), code()); | 415 rinfo()->set_target_address(stub->entry()); |
| 416 } | 416 } |
| 417 } else { | 417 } else { |
| 418 #ifdef DEBUG | 418 #ifdef DEBUG |
| 419 // All the following stuff is needed only for assertion checks so the code | 419 // All the following stuff is needed only for assertion checks so the code |
| 420 // is wrapped in ifdef. | 420 // is wrapped in ifdef. |
| 421 Handle<Code> maybe_call_function_stub = target_code; | 421 Handle<Code> maybe_call_function_stub = target_code; |
| 422 if (IsDebugBreak()) { | 422 if (IsDebugBreak()) { |
| 423 Address original_target = original_rinfo()->target_address(); | 423 Address original_target = original_rinfo()->target_address(); |
| 424 maybe_call_function_stub = | 424 maybe_call_function_stub = |
| 425 Handle<Code>(Code::GetCodeFromTargetAddress(original_target)); | 425 Handle<Code>(Code::GetCodeFromTargetAddress(original_target)); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 return IsDebugBreakAtSlot(); | 462 return IsDebugBreakAtSlot(); |
| 463 } else { | 463 } else { |
| 464 return Debug::IsDebugBreak(rinfo()->target_address()); | 464 return Debug::IsDebugBreak(rinfo()->target_address()); |
| 465 } | 465 } |
| 466 } | 466 } |
| 467 | 467 |
| 468 | 468 |
| 469 void BreakLocationIterator::SetDebugBreakAtIC() { | 469 void BreakLocationIterator::SetDebugBreakAtIC() { |
| 470 // Patch the original code with the current address as the current address | 470 // Patch the original code with the current address as the current address |
| 471 // might have changed by the inline caching since the code was copied. | 471 // might have changed by the inline caching since the code was copied. |
| 472 original_rinfo()->set_target_address(rinfo()->target_address(), code()); | 472 original_rinfo()->set_target_address(rinfo()->target_address()); |
| 473 | 473 |
| 474 RelocInfo::Mode mode = rmode(); | 474 RelocInfo::Mode mode = rmode(); |
| 475 if (RelocInfo::IsCodeTarget(mode)) { | 475 if (RelocInfo::IsCodeTarget(mode)) { |
| 476 Address target = rinfo()->target_address(); | 476 Address target = rinfo()->target_address(); |
| 477 Handle<Code> target_code(Code::GetCodeFromTargetAddress(target)); | 477 Handle<Code> target_code(Code::GetCodeFromTargetAddress(target)); |
| 478 | 478 |
| 479 // Patch the code to invoke the builtin debug break function matching the | 479 // Patch the code to invoke the builtin debug break function matching the |
| 480 // calling convention used by the call site. | 480 // calling convention used by the call site. |
| 481 Handle<Code> dbgbrk_code(Debug::FindDebugBreak(target_code, mode)); | 481 Handle<Code> dbgbrk_code(Debug::FindDebugBreak(target_code, mode)); |
| 482 rinfo()->set_target_address(dbgbrk_code->entry(), code()); | 482 rinfo()->set_target_address(dbgbrk_code->entry()); |
| 483 } | 483 } |
| 484 } | 484 } |
| 485 | 485 |
| 486 | 486 |
| 487 void BreakLocationIterator::ClearDebugBreakAtIC() { | 487 void BreakLocationIterator::ClearDebugBreakAtIC() { |
| 488 // Patch the code to the original invoke. | 488 // Patch the code to the original invoke. |
| 489 rinfo()->set_target_address(original_rinfo()->target_address(), code()); | 489 rinfo()->set_target_address(original_rinfo()->target_address()); |
| 490 } | 490 } |
| 491 | 491 |
| 492 | 492 |
| 493 bool BreakLocationIterator::IsDebuggerStatement() { | 493 bool BreakLocationIterator::IsDebuggerStatement() { |
| 494 return RelocInfo::DEBUG_BREAK == rmode(); | 494 return RelocInfo::DEBUG_BREAK == rmode(); |
| 495 } | 495 } |
| 496 | 496 |
| 497 | 497 |
| 498 bool BreakLocationIterator::IsDebugBreakSlot() { | 498 bool BreakLocationIterator::IsDebugBreakSlot() { |
| 499 return RelocInfo::DEBUG_BREAK_SLOT == rmode(); | 499 return RelocInfo::DEBUG_BREAK_SLOT == rmode(); |
| (...skipping 2630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3130 { | 3130 { |
| 3131 Locker locker; | 3131 Locker locker; |
| 3132 Isolate::Current()->debugger()->CallMessageDispatchHandler(); | 3132 Isolate::Current()->debugger()->CallMessageDispatchHandler(); |
| 3133 } | 3133 } |
| 3134 } | 3134 } |
| 3135 } | 3135 } |
| 3136 | 3136 |
| 3137 #endif // ENABLE_DEBUGGER_SUPPORT | 3137 #endif // ENABLE_DEBUGGER_SUPPORT |
| 3138 | 3138 |
| 3139 } } // namespace v8::internal | 3139 } } // namespace v8::internal |
| OLD | NEW |