| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 | 99 |
| 100 // Now that the break point has been handled, resume normal execution by | 100 // Now that the break point has been handled, resume normal execution by |
| 101 // jumping to the target address intended by the caller and that was | 101 // jumping to the target address intended by the caller and that was |
| 102 // overwritten by the address of DebugBreakXXX. | 102 // overwritten by the address of DebugBreakXXX. |
| 103 ExternalReference after_break_target = | 103 ExternalReference after_break_target = |
| 104 ExternalReference::debug_after_break_target_address(masm->isolate()); | 104 ExternalReference::debug_after_break_target_address(masm->isolate()); |
| 105 __ jmp(Operand::StaticVariable(after_break_target)); | 105 __ jmp(Operand::StaticVariable(after_break_target)); |
| 106 } | 106 } |
| 107 | 107 |
| 108 | 108 |
| 109 void DebugCodegen::GeneratePlainReturnLiveEdit(MacroAssembler* masm) { |
| 110 masm->ret(0); |
| 111 } |
| 112 |
| 113 |
| 109 void DebugCodegen::GenerateFrameDropperLiveEdit(MacroAssembler* masm) { | 114 void DebugCodegen::GenerateFrameDropperLiveEdit(MacroAssembler* masm) { |
| 115 ExternalReference restarter_frame_function_slot = |
| 116 ExternalReference::debug_restarter_frame_function_pointer_address( |
| 117 masm->isolate()); |
| 118 __ mov(Operand::StaticVariable(restarter_frame_function_slot), Immediate(0)); |
| 119 |
| 110 // We do not know our frame height, but set esp based on ebp. | 120 // We do not know our frame height, but set esp based on ebp. |
| 111 __ lea(esp, Operand(ebp, -1 * kPointerSize)); | 121 __ lea(esp, Operand(ebp, -1 * kPointerSize)); |
| 112 | 122 |
| 113 __ pop(edi); // Function. | 123 __ pop(edi); // Function. |
| 114 | |
| 115 ParameterCount dummy(0); | |
| 116 __ FloodFunctionIfStepping(edi, no_reg, dummy, dummy); | |
| 117 | |
| 118 __ pop(ebp); | 124 __ pop(ebp); |
| 119 | 125 |
| 120 // Load context from the function. | 126 // Load context from the function. |
| 121 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); | 127 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); |
| 122 | 128 |
| 123 // Get function code. | 129 // Get function code. |
| 124 __ mov(edx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); | 130 __ mov(edx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); |
| 125 __ mov(edx, FieldOperand(edx, SharedFunctionInfo::kCodeOffset)); | 131 __ mov(edx, FieldOperand(edx, SharedFunctionInfo::kCodeOffset)); |
| 126 __ lea(edx, FieldOperand(edx, Code::kHeaderSize)); | 132 __ lea(edx, FieldOperand(edx, Code::kHeaderSize)); |
| 127 | 133 |
| 128 // Re-run JSFunction, edi is function, esi is context. | 134 // Re-run JSFunction, edi is function, esi is context. |
| 129 __ jmp(edx); | 135 __ jmp(edx); |
| 130 } | 136 } |
| 131 | 137 |
| 132 | 138 |
| 133 const bool LiveEdit::kFrameDropperSupported = true; | 139 const bool LiveEdit::kFrameDropperSupported = true; |
| 134 | 140 |
| 135 #undef __ | 141 #undef __ |
| 136 | 142 |
| 137 } // namespace internal | 143 } // namespace internal |
| 138 } // namespace v8 | 144 } // namespace v8 |
| 139 | 145 |
| 140 #endif // V8_TARGET_ARCH_IA32 | 146 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |