30 #if defined(V8_TARGET_ARCH_X64)
40 #ifdef ENABLE_DEBUGGER_SUPPORT
42 bool BreakLocationIterator::IsDebugBreakAtReturn() {
43 return Debug::IsDebugBreakAtReturn(rinfo());
50 void BreakLocationIterator::SetDebugBreakAtReturn() {
53 rinfo()->PatchCodeWithCall(
54 Isolate::Current()->debug()->debug_break_return()->entry(),
60 void BreakLocationIterator::ClearDebugBreakAtReturn() {
61 rinfo()->PatchCode(original_rinfo()->
pc(),
68 bool Debug::IsDebugBreakAtReturn(v8::internal::RelocInfo* rinfo) {
69 ASSERT(RelocInfo::IsJSReturn(rinfo->rmode()));
70 return rinfo->IsPatchedReturnSequence();
74 bool BreakLocationIterator::IsDebugBreakAtSlot() {
75 ASSERT(IsDebugBreakSlot());
81 void BreakLocationIterator::SetDebugBreakAtSlot() {
82 ASSERT(IsDebugBreakSlot());
83 rinfo()->PatchCodeWithCall(
84 Isolate::Current()->debug()->debug_break_slot()->entry(),
89 void BreakLocationIterator::ClearDebugBreakAtSlot() {
90 ASSERT(IsDebugBreakSlot());
94 const bool Debug::FramePaddingLayout::kIsSupported =
true;
97 #define __ ACCESS_MASM(masm)
100 static void Generate_DebugBreakCallHelper(MacroAssembler* masm,
103 bool convert_call_to_jmp) {
109 for (
int i = 0; i < Debug::FramePaddingLayout::kInitialSize; i++) {
119 ASSERT((object_regs & non_object_regs) == 0);
122 Register reg = { r };
124 if ((object_regs & (1 << r)) != 0) {
128 if ((non_object_regs & (1 << r)) != 0) {
130 __ Integer32ToSmi(reg, reg);
139 __ RecordComment(
"// Calling from debug break to runtime - come in - over");
142 __ movq(
rbx, ExternalReference::debug_break(masm->isolate()));
148 for (
int i = kNumJSCallerSaved - 1; i >= 0; i--) {
150 Register reg = { r };
151 if (FLAG_debug_code) {
154 if ((object_regs & (1 << r)) != 0) {
158 if ((non_object_regs & (1 << r)) != 0) {
163 __ SmiToInteger32(reg, reg);
178 if (convert_call_to_jmp) {
185 ExternalReference after_break_target =
186 ExternalReference(Debug_Address::AfterBreakTarget(), masm->isolate());
192 void Debug::GenerateLoadICDebugBreak(MacroAssembler* masm) {
198 Generate_DebugBreakCallHelper(masm,
rax.
bit() |
rcx.
bit(), 0,
false);
202 void Debug::GenerateStoreICDebugBreak(MacroAssembler* masm) {
209 Generate_DebugBreakCallHelper(
214 void Debug::GenerateKeyedLoadICDebugBreak(MacroAssembler* masm) {
220 Generate_DebugBreakCallHelper(masm,
rax.
bit() |
rdx.
bit(), 0,
false);
224 void Debug::GenerateKeyedStoreICDebugBreak(MacroAssembler* masm) {
231 Generate_DebugBreakCallHelper(
236 void Debug::GenerateCallICDebugBreak(MacroAssembler* masm) {
241 Generate_DebugBreakCallHelper(masm,
rcx.
bit(), 0,
false);
245 void Debug::GenerateReturnDebugBreak(MacroAssembler* masm) {
250 Generate_DebugBreakCallHelper(masm,
rax.
bit(), 0,
true);
254 void Debug::GenerateCallFunctionStubDebugBreak(MacroAssembler* masm) {
259 Generate_DebugBreakCallHelper(masm,
rdi.
bit(), 0,
false);
263 void Debug::GenerateCallFunctionStubRecordDebugBreak(MacroAssembler* masm) {
269 Generate_DebugBreakCallHelper(masm,
rbx.
bit() |
rdi.
bit(), 0,
false);
273 void Debug::GenerateCallConstructStubDebugBreak(MacroAssembler* masm) {
281 Generate_DebugBreakCallHelper(masm,
rdi.
bit(),
rax.
bit(),
false);
285 void Debug::GenerateCallConstructStubRecordDebugBreak(MacroAssembler* masm) {
298 void Debug::GenerateSlot(MacroAssembler* masm) {
300 Label check_codesize;
301 __ bind(&check_codesize);
302 __ RecordDebugBreakSlot();
305 masm->SizeOfCodeGeneratedSince(&check_codesize));
309 void Debug::GenerateSlotDebugBreak(MacroAssembler* masm) {
312 Generate_DebugBreakCallHelper(masm, 0, 0,
true);
316 void Debug::GeneratePlainReturnLiveEdit(MacroAssembler* masm) {
321 void Debug::GenerateFrameDropperLiveEdit(MacroAssembler* masm) {
322 ExternalReference restarter_frame_function_slot =
323 ExternalReference(Debug_Address::RestarterFrameFunctionPointer(),
325 __ movq(
rax, restarter_frame_function_slot);
326 __ movq(Operand(
rax, 0), Immediate(0));
346 const bool Debug::kFrameDropperSupported =
true;
350 #endif // ENABLE_DEBUGGER_SUPPORT
354 #endif // V8_TARGET_ARCH_X64
static const int kCodeOffset
static Smi * FromInt(int value)
static const int kCallInstructionLength
#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)
const Register kScratchRegister
static const int kHeaderSize
#define ASSERT_EQ(v1, v2)
const uint32_t kDebugZapValue
static const int kSharedFunctionInfoOffset