30 #if defined(V8_TARGET_ARCH_IA32)
39 #ifdef ENABLE_DEBUGGER_SUPPORT
41 bool BreakLocationIterator::IsDebugBreakAtReturn() {
42 return Debug::IsDebugBreakAtReturn(rinfo());
49 void BreakLocationIterator::SetDebugBreakAtReturn() {
52 Isolate* isolate = Isolate::Current();
53 rinfo()->PatchCodeWithCall(isolate->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 = Isolate::Current();
83 rinfo()->PatchCodeWithCall(
84 isolate->debug()->debug_break_slot()->entry(),
89 void BreakLocationIterator::ClearDebugBreakAtSlot() {
90 ASSERT(IsDebugBreakSlot());
95 const bool Debug::FramePaddingLayout::kIsSupported =
true;
98 #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++) {
111 Debug::FramePaddingLayout::kPaddingValue)));
113 __ push(Immediate(
Smi::FromInt(Debug::FramePaddingLayout::kInitialSize)));
120 ASSERT((object_regs & non_object_regs) == 0);
123 Register reg = { r };
124 if ((object_regs & (1 << r)) != 0) {
127 if ((non_object_regs & (1 << r)) != 0) {
128 if (FLAG_debug_code) {
129 __ test(reg, Immediate(0xc0000000));
130 __ Assert(
zero,
"Unable to encode value as smi");
138 __ RecordComment(
"// Calling from debug break to runtime - come in - over");
140 __ Set(
eax, Immediate(0));
141 __ mov(
ebx, Immediate(ExternalReference::debug_break(masm->isolate())));
148 Register unused_reg = { -1 };
152 for (
int i = kNumJSCallerSaved; --i >= 0;) {
154 Register reg = { r };
155 if (FLAG_debug_code) {
158 bool taken = reg.code() ==
esi.
code();
159 if ((object_regs & (1 << r)) != 0) {
163 if ((non_object_regs & (1 << r)) != 0) {
173 ASSERT(unused_reg.code() != -1);
186 if (convert_call_to_jmp) {
193 ExternalReference after_break_target =
194 ExternalReference(Debug_Address::AfterBreakTarget(), masm->isolate());
195 __ jmp(Operand::StaticVariable(after_break_target));
199 void Debug::GenerateLoadICDebugBreak(MacroAssembler* masm) {
205 Generate_DebugBreakCallHelper(masm,
ecx.
bit() |
edx.
bit(), 0,
false);
209 void Debug::GenerateStoreICDebugBreak(MacroAssembler* masm) {
216 Generate_DebugBreakCallHelper(
221 void Debug::GenerateKeyedLoadICDebugBreak(MacroAssembler* masm) {
227 Generate_DebugBreakCallHelper(masm,
ecx.
bit() |
edx.
bit(), 0,
false);
231 void Debug::GenerateKeyedStoreICDebugBreak(MacroAssembler* masm) {
238 Generate_DebugBreakCallHelper(
243 void Debug::GenerateCallICDebugBreak(MacroAssembler* masm) {
248 Generate_DebugBreakCallHelper(masm,
ecx.
bit(), 0,
false);
252 void Debug::GenerateReturnDebugBreak(MacroAssembler* masm) {
257 Generate_DebugBreakCallHelper(masm,
eax.
bit(), 0,
true);
261 void Debug::GenerateCallFunctionStubDebugBreak(MacroAssembler* masm) {
266 Generate_DebugBreakCallHelper(masm,
edi.
bit(), 0,
false);
270 void Debug::GenerateCallFunctionStubRecordDebugBreak(MacroAssembler* masm) {
276 Generate_DebugBreakCallHelper(masm,
ebx.
bit() |
edi.
bit(), 0,
false);
280 void Debug::GenerateCallConstructStubDebugBreak(MacroAssembler* masm) {
289 Generate_DebugBreakCallHelper(masm,
edi.
bit(),
eax.
bit(),
false);
293 void Debug::GenerateCallConstructStubRecordDebugBreak(MacroAssembler* masm) {
307 void Debug::GenerateSlot(MacroAssembler* masm) {
309 Label check_codesize;
310 __ bind(&check_codesize);
311 __ RecordDebugBreakSlot();
314 masm->SizeOfCodeGeneratedSince(&check_codesize));
318 void Debug::GenerateSlotDebugBreak(MacroAssembler* masm) {
321 Generate_DebugBreakCallHelper(masm, 0, 0,
true);
325 void Debug::GeneratePlainReturnLiveEdit(MacroAssembler* masm) {
330 void Debug::GenerateFrameDropperLiveEdit(MacroAssembler* masm) {
331 ExternalReference restarter_frame_function_slot =
332 ExternalReference(Debug_Address::RestarterFrameFunctionPointer(),
334 __ mov(Operand::StaticVariable(restarter_frame_function_slot), Immediate(0));
354 const bool Debug::kFrameDropperSupported =
true;
358 #endif // ENABLE_DEBUGGER_SUPPORT
362 #endif // V8_TARGET_ARCH_IA32
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_ASSERT((FixedDoubleArray::kHeaderSize &kDoubleAlignmentMask)==0)
static const int kJSReturnSequenceLength
Operand FieldOperand(Register object, int offset)
const int kNumJSCallerSaved
static const int kDebugBreakSlotLength
static const int kHeaderSize
#define ASSERT_EQ(v1, v2)
const uint32_t kDebugZapValue
static const int kSharedFunctionInfoOffset