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_X87 | 5 #if V8_TARGET_ARCH_X87 |
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/x87/frames-x87.h" | 9 #include "src/x87/frames-x87.h" |
10 | 10 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 // jumping to the target address intended by the caller and that was | 103 // jumping to the target address intended by the caller and that was |
104 // overwritten by the address of DebugBreakXXX. | 104 // overwritten by the address of DebugBreakXXX. |
105 ExternalReference after_break_target = | 105 ExternalReference after_break_target = |
106 ExternalReference::debug_after_break_target_address(masm->isolate()); | 106 ExternalReference::debug_after_break_target_address(masm->isolate()); |
107 __ jmp(Operand::StaticVariable(after_break_target)); | 107 __ jmp(Operand::StaticVariable(after_break_target)); |
108 } | 108 } |
109 | 109 |
110 | 110 |
111 void DebugCodegen::GenerateFrameDropperLiveEdit(MacroAssembler* masm) { | 111 void DebugCodegen::GenerateFrameDropperLiveEdit(MacroAssembler* masm) { |
112 // We do not know our frame height, but set esp based on ebp. | 112 // We do not know our frame height, but set esp based on ebp. |
113 __ lea(esp, Operand(ebp, -1 * kPointerSize)); | 113 __ lea(esp, Operand(ebp, FrameDropperFrameConstants::kFunctionOffset)); |
114 | |
115 __ pop(edi); // Function. | 114 __ pop(edi); // Function. |
| 115 __ add(esp, Immediate(-FrameDropperFrameConstants::kCodeOffset)); // INTERNAL |
| 116 // frame |
| 117 // marker |
| 118 // and code |
116 __ pop(ebp); | 119 __ pop(ebp); |
117 | 120 |
118 ParameterCount dummy(0); | 121 ParameterCount dummy(0); |
119 __ FloodFunctionIfStepping(edi, no_reg, dummy, dummy); | 122 __ FloodFunctionIfStepping(edi, no_reg, dummy, dummy); |
120 | 123 |
121 // Load context from the function. | 124 // Load context from the function. |
122 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); | 125 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); |
123 | 126 |
124 // Clear new.target register as a safety measure. | 127 // Clear new.target register as a safety measure. |
125 __ mov(edx, masm->isolate()->factory()->undefined_value()); | 128 __ mov(edx, masm->isolate()->factory()->undefined_value()); |
126 | 129 |
127 // Get function code. | 130 // Get function code. |
128 __ mov(ebx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); | 131 __ mov(ebx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); |
129 __ mov(ebx, FieldOperand(ebx, SharedFunctionInfo::kCodeOffset)); | 132 __ mov(ebx, FieldOperand(ebx, SharedFunctionInfo::kCodeOffset)); |
130 __ lea(ebx, FieldOperand(ebx, Code::kHeaderSize)); | 133 __ lea(ebx, FieldOperand(ebx, Code::kHeaderSize)); |
131 | 134 |
132 // Re-run JSFunction, edi is function, esi is context. | 135 // Re-run JSFunction, edi is function, esi is context. |
133 __ jmp(ebx); | 136 __ jmp(ebx); |
134 } | 137 } |
135 | 138 |
136 | 139 |
137 const bool LiveEdit::kFrameDropperSupported = true; | 140 const bool LiveEdit::kFrameDropperSupported = true; |
138 | 141 |
139 #undef __ | 142 #undef __ |
140 | 143 |
141 } // namespace internal | 144 } // namespace internal |
142 } // namespace v8 | 145 } // namespace v8 |
143 | 146 |
144 #endif // V8_TARGET_ARCH_X87 | 147 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |