| 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 #include "v8.h" | 5 #include "v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
| 8 | 8 |
| 9 #include "codegen.h" | 9 #include "codegen.h" |
| 10 #include "debug.h" | 10 #include "debug.h" |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 // If this call did not replace a call but patched other code then there will | 160 // If this call did not replace a call but patched other code then there will |
| 161 // be an unwanted return address left on the stack. Here we get rid of that. | 161 // be an unwanted return address left on the stack. Here we get rid of that. |
| 162 if (convert_call_to_jmp) { | 162 if (convert_call_to_jmp) { |
| 163 __ add(esp, Immediate(kPointerSize)); | 163 __ add(esp, Immediate(kPointerSize)); |
| 164 } | 164 } |
| 165 | 165 |
| 166 // Now that the break point has been handled, resume normal execution by | 166 // Now that the break point has been handled, resume normal execution by |
| 167 // jumping to the target address intended by the caller and that was | 167 // jumping to the target address intended by the caller and that was |
| 168 // overwritten by the address of DebugBreakXXX. | 168 // overwritten by the address of DebugBreakXXX. |
| 169 ExternalReference after_break_target = | 169 ExternalReference after_break_target = |
| 170 ExternalReference(Debug_Address::AfterBreakTarget(), masm->isolate()); | 170 ExternalReference::debug_after_break_target_address(masm->isolate()); |
| 171 __ jmp(Operand::StaticVariable(after_break_target)); | 171 __ jmp(Operand::StaticVariable(after_break_target)); |
| 172 } | 172 } |
| 173 | 173 |
| 174 | 174 |
| 175 void Debug::GenerateCallICStubDebugBreak(MacroAssembler* masm) { | 175 void Debug::GenerateCallICStubDebugBreak(MacroAssembler* masm) { |
| 176 // Register state for CallICStub | 176 // Register state for CallICStub |
| 177 // ----------- S t a t e ------------- | 177 // ----------- S t a t e ------------- |
| 178 // -- edx : type feedback slot (smi) | 178 // -- edx : type feedback slot (smi) |
| 179 // -- edi : function | 179 // -- edi : function |
| 180 // ----------------------------------- | 180 // ----------------------------------- |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 } | 301 } |
| 302 | 302 |
| 303 | 303 |
| 304 void Debug::GeneratePlainReturnLiveEdit(MacroAssembler* masm) { | 304 void Debug::GeneratePlainReturnLiveEdit(MacroAssembler* masm) { |
| 305 masm->ret(0); | 305 masm->ret(0); |
| 306 } | 306 } |
| 307 | 307 |
| 308 | 308 |
| 309 void Debug::GenerateFrameDropperLiveEdit(MacroAssembler* masm) { | 309 void Debug::GenerateFrameDropperLiveEdit(MacroAssembler* masm) { |
| 310 ExternalReference restarter_frame_function_slot = | 310 ExternalReference restarter_frame_function_slot = |
| 311 ExternalReference(Debug_Address::RestarterFrameFunctionPointer(), | 311 ExternalReference::debug_restarter_frame_function_pointer_address( |
| 312 masm->isolate()); | 312 masm->isolate()); |
| 313 __ mov(Operand::StaticVariable(restarter_frame_function_slot), Immediate(0)); | 313 __ mov(Operand::StaticVariable(restarter_frame_function_slot), Immediate(0)); |
| 314 | 314 |
| 315 // We do not know our frame height, but set esp based on ebp. | 315 // We do not know our frame height, but set esp based on ebp. |
| 316 __ lea(esp, Operand(ebp, -1 * kPointerSize)); | 316 __ lea(esp, Operand(ebp, -1 * kPointerSize)); |
| 317 | 317 |
| 318 __ pop(edi); // Function. | 318 __ pop(edi); // Function. |
| 319 __ pop(ebp); | 319 __ pop(ebp); |
| 320 | 320 |
| 321 // Load context from the function. | 321 // Load context from the function. |
| 322 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); | 322 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); |
| 323 | 323 |
| 324 // Get function code. | 324 // Get function code. |
| 325 __ mov(edx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); | 325 __ mov(edx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); |
| 326 __ mov(edx, FieldOperand(edx, SharedFunctionInfo::kCodeOffset)); | 326 __ mov(edx, FieldOperand(edx, SharedFunctionInfo::kCodeOffset)); |
| 327 __ lea(edx, FieldOperand(edx, Code::kHeaderSize)); | 327 __ lea(edx, FieldOperand(edx, Code::kHeaderSize)); |
| 328 | 328 |
| 329 // Re-run JSFunction, edi is function, esi is context. | 329 // Re-run JSFunction, edi is function, esi is context. |
| 330 __ jmp(edx); | 330 __ jmp(edx); |
| 331 } | 331 } |
| 332 | 332 |
| 333 const bool Debug::kFrameDropperSupported = true; | 333 const bool Debug::kFrameDropperSupported = true; |
| 334 | 334 |
| 335 #undef __ | 335 #undef __ |
| 336 | 336 |
| 337 } } // namespace v8::internal | 337 } } // namespace v8::internal |
| 338 | 338 |
| 339 #endif // V8_TARGET_ARCH_IA32 | 339 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |