30 #if V8_TARGET_ARCH_X64
40 #ifdef ENABLE_DEBUGGER_SUPPORT
42 bool BreakLocationIterator::IsDebugBreakAtReturn() {
43 return Debug::IsDebugBreakAtReturn(rinfo());
50 void BreakLocationIterator::SetDebugBreakAtReturn() {
52 rinfo()->PatchCodeWithCall(
53 debug_info_->GetIsolate()->debug()->debug_break_return()->entry(),
59 void BreakLocationIterator::ClearDebugBreakAtReturn() {
60 rinfo()->PatchCode(original_rinfo()->
pc(),
67 bool Debug::IsDebugBreakAtReturn(v8::internal::RelocInfo* rinfo) {
68 ASSERT(RelocInfo::IsJSReturn(rinfo->rmode()));
69 return rinfo->IsPatchedReturnSequence();
73 bool BreakLocationIterator::IsDebugBreakAtSlot() {
74 ASSERT(IsDebugBreakSlot());
80 void BreakLocationIterator::SetDebugBreakAtSlot() {
81 ASSERT(IsDebugBreakSlot());
82 rinfo()->PatchCodeWithCall(
83 debug_info_->GetIsolate()->debug()->debug_break_slot()->entry(),
88 void BreakLocationIterator::ClearDebugBreakAtSlot() {
89 ASSERT(IsDebugBreakSlot());
93 const bool Debug::FramePaddingLayout::kIsSupported =
true;
96 #define __ ACCESS_MASM(masm)
99 static void Generate_DebugBreakCallHelper(MacroAssembler* masm,
102 bool convert_call_to_jmp) {
108 for (
int i = 0; i < Debug::FramePaddingLayout::kInitialSize; i++) {
118 ASSERT((object_regs & non_object_regs) == 0);
121 Register reg = { r };
123 if ((object_regs & (1 << r)) != 0) {
126 if ((non_object_regs & (1 << r)) != 0) {
127 __ PushInt64AsTwoSmis(reg);
132 __ RecordComment(
"// Calling from debug break to runtime - come in - over");
135 __ Move(
rbx, ExternalReference::debug_break(masm->isolate()));
141 for (
int i = kNumJSCallerSaved - 1; i >= 0; i--) {
143 Register reg = { r };
144 if (FLAG_debug_code) {
147 if ((object_regs & (1 << r)) != 0) {
151 if ((non_object_regs & (1 << r)) != 0) {
152 __ PopInt64AsTwoSmis(reg);
166 if (convert_call_to_jmp) {
173 ExternalReference after_break_target =
174 ExternalReference(Debug_Address::AfterBreakTarget(), masm->isolate());
180 void Debug::GenerateLoadICDebugBreak(MacroAssembler* masm) {
186 Generate_DebugBreakCallHelper(masm,
rax.
bit() |
rcx.
bit(), 0,
false);
190 void Debug::GenerateStoreICDebugBreak(MacroAssembler* masm) {
197 Generate_DebugBreakCallHelper(
202 void Debug::GenerateKeyedLoadICDebugBreak(MacroAssembler* masm) {
208 Generate_DebugBreakCallHelper(masm,
rax.
bit() |
rdx.
bit(), 0,
false);
212 void Debug::GenerateKeyedStoreICDebugBreak(MacroAssembler* masm) {
219 Generate_DebugBreakCallHelper(
224 void Debug::GenerateCompareNilICDebugBreak(MacroAssembler* masm) {
229 Generate_DebugBreakCallHelper(masm,
rax.
bit(), 0,
false);
233 void Debug::GenerateCallICDebugBreak(MacroAssembler* masm) {
238 Generate_DebugBreakCallHelper(masm,
rcx.
bit(), 0,
false);
242 void Debug::GenerateReturnDebugBreak(MacroAssembler* masm) {
247 Generate_DebugBreakCallHelper(masm,
rax.
bit(), 0,
true);
251 void Debug::GenerateCallFunctionStubDebugBreak(MacroAssembler* masm) {
256 Generate_DebugBreakCallHelper(masm,
rdi.
bit(), 0,
false);
260 void Debug::GenerateCallFunctionStubRecordDebugBreak(MacroAssembler* masm) {
272 void Debug::GenerateCallConstructStubDebugBreak(MacroAssembler* masm) {
280 Generate_DebugBreakCallHelper(masm,
rdi.
bit(),
rax.
bit(),
false);
284 void Debug::GenerateCallConstructStubRecordDebugBreak(MacroAssembler* masm) {
299 void Debug::GenerateSlot(MacroAssembler* masm) {
301 Label check_codesize;
302 __ bind(&check_codesize);
303 __ RecordDebugBreakSlot();
306 masm->SizeOfCodeGeneratedSince(&check_codesize));
310 void Debug::GenerateSlotDebugBreak(MacroAssembler* masm) {
313 Generate_DebugBreakCallHelper(masm, 0, 0,
true);
317 void Debug::GeneratePlainReturnLiveEdit(MacroAssembler* masm) {
322 void Debug::GenerateFrameDropperLiveEdit(MacroAssembler* masm) {
323 ExternalReference restarter_frame_function_slot =
324 ExternalReference(Debug_Address::RestarterFrameFunctionPointer(),
326 __ Move(
rax, restarter_frame_function_slot);
327 __ movp(Operand(
rax, 0), Immediate(0));
347 const bool Debug::kFrameDropperSupported =
true;
351 #endif // ENABLE_DEBUGGER_SUPPORT
355 #endif // V8_TARGET_ARCH_X64
static const int kCodeOffset
static Smi * FromInt(int value)
#define ASSERT(condition)
const RegList kJSCallerSaved
static const int kContextOffset
int JSCallerSavedCode(int n)
static const int kJSReturnSequenceLength
Operand FieldOperand(Register object, int offset)
const int kNumJSCallerSaved
static const int kDebugBreakSlotLength
static bool IsNop(Instr instr, int type=NON_MARKING_NOP)
static const int kCallSequenceLength
const Register kScratchRegister
static const int kHeaderSize
#define ASSERT_EQ(v1, v2)
const uint32_t kDebugZapValue
static const int kSharedFunctionInfoOffset