| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 } | 121 } |
| 122 __ SmiTag(reg); | 122 __ SmiTag(reg); |
| 123 __ push(reg); | 123 __ push(reg); |
| 124 } | 124 } |
| 125 } | 125 } |
| 126 | 126 |
| 127 #ifdef DEBUG | 127 #ifdef DEBUG |
| 128 __ RecordComment("// Calling from debug break to runtime - come in - over"); | 128 __ RecordComment("// Calling from debug break to runtime - come in - over"); |
| 129 #endif | 129 #endif |
| 130 __ Set(eax, Immediate(0)); // No arguments. | 130 __ Set(eax, Immediate(0)); // No arguments. |
| 131 __ mov(ebx, Immediate(ExternalReference::debug_break())); | 131 __ mov(ebx, Immediate(ExternalReference::debug_break(masm->isolate()))); |
| 132 | 132 |
| 133 CEntryStub ceb(1); | 133 CEntryStub ceb(1); |
| 134 __ CallStub(&ceb); | 134 __ CallStub(&ceb); |
| 135 | 135 |
| 136 // Restore the register values containing object pointers from the expression | 136 // Restore the register values containing object pointers from the expression |
| 137 // stack. | 137 // stack. |
| 138 for (int i = kNumJSCallerSaved; --i >= 0;) { | 138 for (int i = kNumJSCallerSaved; --i >= 0;) { |
| 139 int r = JSCallerSavedCode(i); | 139 int r = JSCallerSavedCode(i); |
| 140 Register reg = { r }; | 140 Register reg = { r }; |
| 141 if (FLAG_debug_code) { | 141 if (FLAG_debug_code) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 156 // If this call did not replace a call but patched other code then there will | 156 // If this call did not replace a call but patched other code then there will |
| 157 // be an unwanted return address left on the stack. Here we get rid of that. | 157 // be an unwanted return address left on the stack. Here we get rid of that. |
| 158 if (convert_call_to_jmp) { | 158 if (convert_call_to_jmp) { |
| 159 __ add(Operand(esp), Immediate(kPointerSize)); | 159 __ add(Operand(esp), Immediate(kPointerSize)); |
| 160 } | 160 } |
| 161 | 161 |
| 162 // Now that the break point has been handled, resume normal execution by | 162 // Now that the break point has been handled, resume normal execution by |
| 163 // jumping to the target address intended by the caller and that was | 163 // jumping to the target address intended by the caller and that was |
| 164 // overwritten by the address of DebugBreakXXX. | 164 // overwritten by the address of DebugBreakXXX. |
| 165 ExternalReference after_break_target = | 165 ExternalReference after_break_target = |
| 166 ExternalReference(Debug_Address::AfterBreakTarget()); | 166 ExternalReference(Debug_Address::AfterBreakTarget(), masm->isolate()); |
| 167 __ jmp(Operand::StaticVariable(after_break_target)); | 167 __ jmp(Operand::StaticVariable(after_break_target)); |
| 168 } | 168 } |
| 169 | 169 |
| 170 | 170 |
| 171 void Debug::GenerateLoadICDebugBreak(MacroAssembler* masm) { | 171 void Debug::GenerateLoadICDebugBreak(MacroAssembler* masm) { |
| 172 // Register state for IC load call (from ic-ia32.cc). | 172 // Register state for IC load call (from ic-ia32.cc). |
| 173 // ----------- S t a t e ------------- | 173 // ----------- S t a t e ------------- |
| 174 // -- eax : receiver | 174 // -- eax : receiver |
| 175 // -- ecx : name | 175 // -- ecx : name |
| 176 // ----------------------------------- | 176 // ----------------------------------- |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 } | 272 } |
| 273 | 273 |
| 274 | 274 |
| 275 void Debug::GeneratePlainReturnLiveEdit(MacroAssembler* masm) { | 275 void Debug::GeneratePlainReturnLiveEdit(MacroAssembler* masm) { |
| 276 masm->ret(0); | 276 masm->ret(0); |
| 277 } | 277 } |
| 278 | 278 |
| 279 | 279 |
| 280 void Debug::GenerateFrameDropperLiveEdit(MacroAssembler* masm) { | 280 void Debug::GenerateFrameDropperLiveEdit(MacroAssembler* masm) { |
| 281 ExternalReference restarter_frame_function_slot = | 281 ExternalReference restarter_frame_function_slot = |
| 282 ExternalReference(Debug_Address::RestarterFrameFunctionPointer()); | 282 ExternalReference(Debug_Address::RestarterFrameFunctionPointer(), |
| 283 masm->isolate()); |
| 283 __ mov(Operand::StaticVariable(restarter_frame_function_slot), Immediate(0)); | 284 __ mov(Operand::StaticVariable(restarter_frame_function_slot), Immediate(0)); |
| 284 | 285 |
| 285 // We do not know our frame height, but set esp based on ebp. | 286 // We do not know our frame height, but set esp based on ebp. |
| 286 __ lea(esp, Operand(ebp, -1 * kPointerSize)); | 287 __ lea(esp, Operand(ebp, -1 * kPointerSize)); |
| 287 | 288 |
| 288 __ pop(edi); // Function. | 289 __ pop(edi); // Function. |
| 289 __ pop(ebp); | 290 __ pop(ebp); |
| 290 | 291 |
| 291 // Load context from the function. | 292 // Load context from the function. |
| 292 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); | 293 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); |
| 293 | 294 |
| 294 // Get function code. | 295 // Get function code. |
| 295 __ mov(edx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); | 296 __ mov(edx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); |
| 296 __ mov(edx, FieldOperand(edx, SharedFunctionInfo::kCodeOffset)); | 297 __ mov(edx, FieldOperand(edx, SharedFunctionInfo::kCodeOffset)); |
| 297 __ lea(edx, FieldOperand(edx, Code::kHeaderSize)); | 298 __ lea(edx, FieldOperand(edx, Code::kHeaderSize)); |
| 298 | 299 |
| 299 // Re-run JSFunction, edi is function, esi is context. | 300 // Re-run JSFunction, edi is function, esi is context. |
| 300 __ jmp(Operand(edx)); | 301 __ jmp(Operand(edx)); |
| 301 } | 302 } |
| 302 | 303 |
| 303 const bool Debug::kFrameDropperSupported = true; | 304 const bool Debug::kFrameDropperSupported = true; |
| 304 | 305 |
| 305 #undef __ | 306 #undef __ |
| 306 | 307 |
| 307 #endif // ENABLE_DEBUGGER_SUPPORT | 308 #endif // ENABLE_DEBUGGER_SUPPORT |
| 308 | 309 |
| 309 } } // namespace v8::internal | 310 } } // namespace v8::internal |
| 310 | 311 |
| 311 #endif // V8_TARGET_ARCH_IA32 | 312 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |