30 #if V8_TARGET_ARCH_IA32
39 #ifdef ENABLE_DEBUGGER_SUPPORT
41 bool BreakLocationIterator::IsDebugBreakAtReturn() {
42 return Debug::IsDebugBreakAtReturn(rinfo());
49 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(RelocInfo* rinfo) {
68 ASSERT(RelocInfo::IsJSReturn(rinfo->rmode()));
69 return rinfo->IsPatchedReturnSequence();
73 bool BreakLocationIterator::IsDebugBreakAtSlot() {
74 ASSERT(IsDebugBreakSlot());
76 return rinfo()->IsPatchedDebugBreakSlotSequence();
80 void BreakLocationIterator::SetDebugBreakAtSlot() {
81 ASSERT(IsDebugBreakSlot());
82 Isolate* isolate = debug_info_->GetIsolate();
83 rinfo()->PatchCodeWithCall(
84 isolate->debug()->debug_break_slot()->entry(),
89 void BreakLocationIterator::ClearDebugBreakAtSlot() {
90 ASSERT(IsDebugBreakSlot());
96 const bool Debug::FramePaddingLayout::kIsSupported =
true;
99 #define __ ACCESS_MASM(masm)
101 static void Generate_DebugBreakCallHelper(MacroAssembler* masm,
104 bool convert_call_to_jmp) {
110 for (
int i = 0; i < Debug::FramePaddingLayout::kInitialSize; i++) {
112 Debug::FramePaddingLayout::kPaddingValue)));
114 __ push(Immediate(
Smi::FromInt(Debug::FramePaddingLayout::kInitialSize)));
121 ASSERT((object_regs & non_object_regs) == 0);
124 Register reg = { r };
125 if ((object_regs & (1 << r)) != 0) {
128 if ((non_object_regs & (1 << r)) != 0) {
129 if (FLAG_debug_code) {
130 __ test(reg, Immediate(0xc0000000));
131 __ Assert(
zero, kUnableToEncodeValueAsSmi);
139 __ RecordComment(
"// Calling from debug break to runtime - come in - over");
141 __ Move(
eax, Immediate(0));
142 __ mov(
ebx, Immediate(ExternalReference::debug_break(masm->isolate())));
149 Register unused_reg = { -1 };
153 for (
int i = kNumJSCallerSaved; --i >= 0;) {
155 Register reg = { r };
156 if (FLAG_debug_code) {
159 bool taken = reg.code() ==
esi.
code();
160 if ((object_regs & (1 << r)) != 0) {
164 if ((non_object_regs & (1 << r)) != 0) {
174 ASSERT(unused_reg.code() != -1);
187 if (convert_call_to_jmp) {
194 ExternalReference after_break_target =
195 ExternalReference(Debug_Address::AfterBreakTarget(), masm->isolate());
196 __ jmp(Operand::StaticVariable(after_break_target));
200 void Debug::GenerateLoadICDebugBreak(MacroAssembler* masm) {
206 Generate_DebugBreakCallHelper(masm,
ecx.
bit() |
edx.
bit(), 0,
false);
210 void Debug::GenerateStoreICDebugBreak(MacroAssembler* masm) {
217 Generate_DebugBreakCallHelper(
222 void Debug::GenerateKeyedLoadICDebugBreak(MacroAssembler* masm) {
228 Generate_DebugBreakCallHelper(masm,
ecx.
bit() |
edx.
bit(), 0,
false);
232 void Debug::GenerateKeyedStoreICDebugBreak(MacroAssembler* masm) {
239 Generate_DebugBreakCallHelper(
244 void Debug::GenerateCompareNilICDebugBreak(MacroAssembler* masm) {
249 Generate_DebugBreakCallHelper(masm,
eax.
bit(), 0,
false);
253 void Debug::GenerateCallICDebugBreak(MacroAssembler* masm) {
258 Generate_DebugBreakCallHelper(masm,
ecx.
bit(), 0,
false);
262 void Debug::GenerateReturnDebugBreak(MacroAssembler* masm) {
267 Generate_DebugBreakCallHelper(masm,
eax.
bit(), 0,
true);
271 void Debug::GenerateCallFunctionStubDebugBreak(MacroAssembler* masm) {
276 Generate_DebugBreakCallHelper(masm,
edi.
bit(), 0,
false);
280 void Debug::GenerateCallFunctionStubRecordDebugBreak(MacroAssembler* masm) {
292 void Debug::GenerateCallConstructStubDebugBreak(MacroAssembler* masm) {
301 Generate_DebugBreakCallHelper(masm,
edi.
bit(),
eax.
bit(),
false);
305 void Debug::GenerateCallConstructStubRecordDebugBreak(MacroAssembler* masm) {
321 void Debug::GenerateSlot(MacroAssembler* masm) {
323 Label check_codesize;
324 __ bind(&check_codesize);
325 __ RecordDebugBreakSlot();
328 masm->SizeOfCodeGeneratedSince(&check_codesize));
332 void Debug::GenerateSlotDebugBreak(MacroAssembler* masm) {
335 Generate_DebugBreakCallHelper(masm, 0, 0,
true);
339 void Debug::GeneratePlainReturnLiveEdit(MacroAssembler* masm) {
344 void Debug::GenerateFrameDropperLiveEdit(MacroAssembler* masm) {
345 ExternalReference restarter_frame_function_slot =
346 ExternalReference(Debug_Address::RestarterFrameFunctionPointer(),
348 __ mov(Operand::StaticVariable(restarter_frame_function_slot), Immediate(0));
368 const bool Debug::kFrameDropperSupported =
true;
372 #endif // ENABLE_DEBUGGER_SUPPORT
376 #endif // V8_TARGET_ARCH_IA32
static const int kCodeOffset
static Smi * FromInt(int value)
#define ASSERT(condition)
const RegList kJSCallerSaved
static const int kContextOffset
int JSCallerSavedCode(int n)
STATIC_ASSERT(sizeof(CPURegister)==sizeof(Register))
static const int kJSReturnSequenceLength
Operand FieldOperand(Register object, int offset)
const int kNumJSCallerSaved
static const int kDebugBreakSlotLength
static const int kCallInstructionLength
static const int kHeaderSize
#define ASSERT_EQ(v1, v2)
const uint32_t kDebugZapValue
static const int kSharedFunctionInfoOffset