OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
6 | 6 |
7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
9 #include "src/ia32/frames-ia32.h" | 9 #include "src/ia32/frames-ia32.h" |
10 | 10 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 | 98 |
99 // Now that the break point has been handled, resume normal execution by | 99 // Now that the break point has been handled, resume normal execution by |
100 // jumping to the target address intended by the caller and that was | 100 // jumping to the target address intended by the caller and that was |
101 // overwritten by the address of DebugBreakXXX. | 101 // overwritten by the address of DebugBreakXXX. |
102 ExternalReference after_break_target = | 102 ExternalReference after_break_target = |
103 ExternalReference::debug_after_break_target_address(masm->isolate()); | 103 ExternalReference::debug_after_break_target_address(masm->isolate()); |
104 __ jmp(Operand::StaticVariable(after_break_target)); | 104 __ jmp(Operand::StaticVariable(after_break_target)); |
105 } | 105 } |
106 | 106 |
107 | 107 |
| 108 void DebugCodegen::GeneratePlainReturnLiveEdit(MacroAssembler* masm) { |
| 109 masm->ret(0); |
| 110 } |
| 111 |
| 112 |
108 void DebugCodegen::GenerateFrameDropperLiveEdit(MacroAssembler* masm) { | 113 void DebugCodegen::GenerateFrameDropperLiveEdit(MacroAssembler* masm) { |
| 114 ExternalReference restarter_frame_function_slot = |
| 115 ExternalReference::debug_restarter_frame_function_pointer_address( |
| 116 masm->isolate()); |
| 117 __ mov(Operand::StaticVariable(restarter_frame_function_slot), Immediate(0)); |
| 118 |
109 // We do not know our frame height, but set esp based on ebp. | 119 // We do not know our frame height, but set esp based on ebp. |
110 __ lea(esp, Operand(ebp, -1 * kPointerSize)); | 120 __ lea(esp, Operand(ebp, -1 * kPointerSize)); |
111 | 121 |
112 __ pop(edi); // Function. | 122 __ pop(edi); // Function. |
113 __ pop(ebp); | 123 __ pop(ebp); |
114 | 124 |
115 ParameterCount dummy(0); | |
116 __ FloodFunctionIfStepping(edi, no_reg, dummy, dummy); | |
117 | |
118 // Load context from the function. | 125 // Load context from the function. |
119 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); | 126 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); |
120 | 127 |
121 // Clear new.target register as a safety measure. | 128 // Clear new.target register as a safety measure. |
122 __ mov(edx, masm->isolate()->factory()->undefined_value()); | 129 __ mov(edx, masm->isolate()->factory()->undefined_value()); |
123 | 130 |
124 // Get function code. | 131 // Get function code. |
125 __ mov(ebx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); | 132 __ mov(ebx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); |
126 __ mov(ebx, FieldOperand(ebx, SharedFunctionInfo::kCodeOffset)); | 133 __ mov(ebx, FieldOperand(ebx, SharedFunctionInfo::kCodeOffset)); |
127 __ lea(ebx, FieldOperand(ebx, Code::kHeaderSize)); | 134 __ lea(ebx, FieldOperand(ebx, Code::kHeaderSize)); |
128 | 135 |
129 // Re-run JSFunction, edi is function, esi is context. | 136 // Re-run JSFunction, edi is function, esi is context. |
130 __ jmp(ebx); | 137 __ jmp(ebx); |
131 } | 138 } |
132 | 139 |
133 | 140 |
134 const bool LiveEdit::kFrameDropperSupported = true; | 141 const bool LiveEdit::kFrameDropperSupported = true; |
135 | 142 |
136 #undef __ | 143 #undef __ |
137 | 144 |
138 } // namespace internal | 145 } // namespace internal |
139 } // namespace v8 | 146 } // namespace v8 |
140 | 147 |
141 #endif // V8_TARGET_ARCH_IA32 | 148 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |