Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Side by Side Diff: src/ia32/debug-ia32.cc

Issue 1118007: LiveEdit: implement frame dropping (Closed)
Patch Set: adding rule to mjsunit.status Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/frames.cc ('k') | src/liveedit.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 199
200 void Debug::GenerateStubNoRegistersDebugBreak(MacroAssembler* masm) { 200 void Debug::GenerateStubNoRegistersDebugBreak(MacroAssembler* masm) {
201 // Register state for stub CallFunction (from CallFunctionStub in ic-ia32.cc). 201 // Register state for stub CallFunction (from CallFunctionStub in ic-ia32.cc).
202 // ----------- S t a t e ------------- 202 // ----------- S t a t e -------------
203 // No registers used on entry. 203 // No registers used on entry.
204 // ----------------------------------- 204 // -----------------------------------
205 Generate_DebugBreakCallHelper(masm, 0, false); 205 Generate_DebugBreakCallHelper(masm, 0, false);
206 } 206 }
207 207
208 208
209 void Debug::GeneratePlainReturnLiveEdit(MacroAssembler* masm) {
210 masm->ret(0);
211 }
212
213 // FrameDropper is a code replacement for a JavaScript frame with possibly
214 // several frames above.
215 // There is no calling conventions here, because it never actually gets called,
216 // it only gets returned to.
217 // Frame structure (conforms InternalFrame structure):
218 // -- JSFunction
219 // -- code
220 // -- SMI maker
221 // -- context
222 // -- frame base
223 void Debug::GenerateFrameDropperLiveEdit(MacroAssembler* masm) {
224 // We do not know our frame height, but set esp based on ebp.
225 __ lea(esp, Operand(ebp, -4 * kPointerSize));
226
227 __ pop(edi); // function
228
229 // Skip code self-reference and marker.
230 __ add(Operand(esp), Immediate(2 * kPointerSize));
231
232 __ pop(esi); // Context.
233 __ pop(ebp);
234
235 // Get function code.
236 __ mov(edx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset));
237 __ mov(edx, FieldOperand(edx, SharedFunctionInfo::kCodeOffset));
238 __ lea(edx, FieldOperand(edx, Code::kHeaderSize));
239
240 // Re-run JSFunction, edi is function, esi is context.
241 __ jmp(Operand(edx));
242 }
243
209 #undef __ 244 #undef __
210 245
246
247 void Debug::SetUpFrameDropperFrame(StackFrame* bottom_js_frame,
248 Handle<Code> code) {
249 ASSERT(bottom_js_frame->is_java_script());
250
251 Address fp = bottom_js_frame->fp();
252 Memory::Object_at(fp - 4 * kPointerSize) =
253 Memory::Object_at(fp - 2 * kPointerSize); // Move edi (function).
254
255 Memory::Object_at(fp - 3 * kPointerSize) = *code;
256 Memory::Object_at(fp - 2 * kPointerSize) = Smi::FromInt(StackFrame::INTERNAL);
257 }
258 const int Debug::kFrameDropperFrameSize = 5;
259
260
211 #endif // ENABLE_DEBUGGER_SUPPORT 261 #endif // ENABLE_DEBUGGER_SUPPORT
212 262
213 } } // namespace v8::internal 263 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/frames.cc ('k') | src/liveedit.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698