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 | |
272 // We do not know our frame height, but set esp based on ebp. | 268 // We do not know our frame height, but set esp based on ebp. |
273 __ lea(esp, Operand(ebp, -4 * kPointerSize)); | 269 __ lea(esp, Operand(ebp, -4 * kPointerSize)); |
274 | 270 |
275 __ pop(edi); // function | 271 __ pop(edi); // function |
276 | 272 |
277 // Skip code self-reference and marker. | 273 // Skip code self-reference and marker. |
278 __ add(Operand(esp), Immediate(2 * kPointerSize)); | 274 __ add(Operand(esp), Immediate(2 * kPointerSize)); |
279 | 275 |
280 __ pop(esi); // Context. | 276 __ pop(esi); // Context. |
281 __ pop(ebp); | 277 __ pop(ebp); |
282 | 278 |
283 // Get function code. | 279 // Get function code. |
284 __ mov(edx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); | 280 __ mov(edx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); |
285 __ mov(edx, FieldOperand(edx, SharedFunctionInfo::kCodeOffset)); | 281 __ mov(edx, FieldOperand(edx, SharedFunctionInfo::kCodeOffset)); |
286 __ lea(edx, FieldOperand(edx, Code::kHeaderSize)); | 282 __ lea(edx, FieldOperand(edx, Code::kHeaderSize)); |
287 | 283 |
288 // Re-run JSFunction, edi is function, esi is context. | 284 // Re-run JSFunction, edi is function, esi is context. |
289 __ jmp(Operand(edx)); | 285 __ jmp(Operand(edx)); |
290 } | 286 } |
291 | 287 |
292 #undef __ | 288 #undef __ |
293 | 289 |
294 | 290 |
295 // TODO(LiveEdit): consider making it platform-independent. | 291 void Debug::SetUpFrameDropperFrame(StackFrame* bottom_js_frame, |
296 // TODO(LiveEdit): use more named constants instead of numbers. | 292 Handle<Code> code) { |
297 Object** Debug::SetUpFrameDropperFrame(StackFrame* bottom_js_frame, | |
298 Handle<Code> code) { | |
299 ASSERT(bottom_js_frame->is_java_script()); | 293 ASSERT(bottom_js_frame->is_java_script()); |
300 | 294 |
301 Address fp = bottom_js_frame->fp(); | 295 Address fp = bottom_js_frame->fp(); |
302 Memory::Object_at(fp - 4 * kPointerSize) = | 296 Memory::Object_at(fp - 4 * kPointerSize) = |
303 Memory::Object_at(fp - 2 * kPointerSize); // Move edi (function). | 297 Memory::Object_at(fp - 2 * kPointerSize); // Move edi (function). |
304 | 298 |
305 Memory::Object_at(fp - 3 * kPointerSize) = *code; | 299 Memory::Object_at(fp - 3 * kPointerSize) = *code; |
306 Memory::Object_at(fp - 2 * kPointerSize) = Smi::FromInt(StackFrame::INTERNAL); | 300 Memory::Object_at(fp - 2 * kPointerSize) = Smi::FromInt(StackFrame::INTERNAL); |
307 | |
308 return reinterpret_cast<Object**>(&Memory::Object_at(fp - 4 * kPointerSize)); | |
309 } | 301 } |
310 | |
311 const int Debug::kFrameDropperFrameSize = 5; | 302 const int Debug::kFrameDropperFrameSize = 5; |
312 | 303 |
313 | 304 |
314 #endif // ENABLE_DEBUGGER_SUPPORT | 305 #endif // ENABLE_DEBUGGER_SUPPORT |
315 | 306 |
316 } } // namespace v8::internal | 307 } } // namespace v8::internal |
317 | 308 |
318 #endif // V8_TARGET_ARCH_IA32 | 309 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |