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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 // several frames above. | 258 // several frames above. |
259 // There is no calling conventions here, because it never actually gets called, | 259 // There is no calling conventions here, because it never actually gets called, |
260 // it only gets returned to. | 260 // it only gets returned to. |
261 // Frame structure (conforms InternalFrame structure): | 261 // Frame structure (conforms InternalFrame structure): |
262 // -- JSFunction | 262 // -- JSFunction |
263 // -- code | 263 // -- code |
264 // -- SMI maker | 264 // -- SMI maker |
265 // -- context | 265 // -- context |
266 // -- frame base | 266 // -- frame base |
267 void Debug::GenerateFrameDropperLiveEdit(MacroAssembler* masm) { | 267 void Debug::GenerateFrameDropperLiveEdit(MacroAssembler* masm) { |
| 268 ExternalReference restarter_frame_function_slot = |
| 269 ExternalReference(Debug_Address::RestarterFrameFunctionPointer()); |
| 270 __ mov(Operand::StaticVariable(restarter_frame_function_slot), Immediate(0)); |
| 271 |
268 // We do not know our frame height, but set esp based on ebp. | 272 // We do not know our frame height, but set esp based on ebp. |
269 __ lea(esp, Operand(ebp, -4 * kPointerSize)); | 273 __ lea(esp, Operand(ebp, -4 * kPointerSize)); |
270 | 274 |
271 __ pop(edi); // function | 275 __ pop(edi); // function |
272 | 276 |
273 // Skip code self-reference and marker. | 277 // Skip code self-reference and marker. |
274 __ add(Operand(esp), Immediate(2 * kPointerSize)); | 278 __ add(Operand(esp), Immediate(2 * kPointerSize)); |
275 | 279 |
276 __ pop(esi); // Context. | 280 __ pop(esi); // Context. |
277 __ pop(ebp); | 281 __ pop(ebp); |
278 | 282 |
279 // Get function code. | 283 // Get function code. |
280 __ mov(edx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); | 284 __ mov(edx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); |
281 __ mov(edx, FieldOperand(edx, SharedFunctionInfo::kCodeOffset)); | 285 __ mov(edx, FieldOperand(edx, SharedFunctionInfo::kCodeOffset)); |
282 __ lea(edx, FieldOperand(edx, Code::kHeaderSize)); | 286 __ lea(edx, FieldOperand(edx, Code::kHeaderSize)); |
283 | 287 |
284 // Re-run JSFunction, edi is function, esi is context. | 288 // Re-run JSFunction, edi is function, esi is context. |
285 __ jmp(Operand(edx)); | 289 __ jmp(Operand(edx)); |
286 } | 290 } |
287 | 291 |
288 #undef __ | 292 #undef __ |
289 | 293 |
290 | 294 |
291 void Debug::SetUpFrameDropperFrame(StackFrame* bottom_js_frame, | 295 // TODO(LiveEdit): consider making it platform-independent. |
292 Handle<Code> code) { | 296 // TODO(LiveEdit): use more named constants instead of numbers. |
| 297 Object** Debug::SetUpFrameDropperFrame(StackFrame* bottom_js_frame, |
| 298 Handle<Code> code) { |
293 ASSERT(bottom_js_frame->is_java_script()); | 299 ASSERT(bottom_js_frame->is_java_script()); |
294 | 300 |
295 Address fp = bottom_js_frame->fp(); | 301 Address fp = bottom_js_frame->fp(); |
296 Memory::Object_at(fp - 4 * kPointerSize) = | 302 Memory::Object_at(fp - 4 * kPointerSize) = |
297 Memory::Object_at(fp - 2 * kPointerSize); // Move edi (function). | 303 Memory::Object_at(fp - 2 * kPointerSize); // Move edi (function). |
298 | 304 |
299 Memory::Object_at(fp - 3 * kPointerSize) = *code; | 305 Memory::Object_at(fp - 3 * kPointerSize) = *code; |
300 Memory::Object_at(fp - 2 * kPointerSize) = Smi::FromInt(StackFrame::INTERNAL); | 306 Memory::Object_at(fp - 2 * kPointerSize) = Smi::FromInt(StackFrame::INTERNAL); |
| 307 |
| 308 return reinterpret_cast<Object**>(&Memory::Object_at(fp - 4 * kPointerSize)); |
301 } | 309 } |
| 310 |
302 const int Debug::kFrameDropperFrameSize = 5; | 311 const int Debug::kFrameDropperFrameSize = 5; |
303 | 312 |
304 | 313 |
305 #endif // ENABLE_DEBUGGER_SUPPORT | 314 #endif // ENABLE_DEBUGGER_SUPPORT |
306 | 315 |
307 } } // namespace v8::internal | 316 } } // namespace v8::internal |
308 | 317 |
309 #endif // V8_TARGET_ARCH_IA32 | 318 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |