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

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

Issue 43333003: Move movq(Register, ExternalReference) into X64 MacroAssembler (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « src/x64/codegen-x64.cc ('k') | src/x64/lithium-codegen-x64.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 } 125 }
126 if ((non_object_regs & (1 << r)) != 0) { 126 if ((non_object_regs & (1 << r)) != 0) {
127 __ PushInt64AsTwoSmis(reg); 127 __ PushInt64AsTwoSmis(reg);
128 } 128 }
129 } 129 }
130 130
131 #ifdef DEBUG 131 #ifdef DEBUG
132 __ RecordComment("// Calling from debug break to runtime - come in - over"); 132 __ RecordComment("// Calling from debug break to runtime - come in - over");
133 #endif 133 #endif
134 __ Set(rax, 0); // No arguments (argc == 0). 134 __ Set(rax, 0); // No arguments (argc == 0).
135 __ movq(rbx, ExternalReference::debug_break(masm->isolate())); 135 __ Move(rbx, ExternalReference::debug_break(masm->isolate()));
136 136
137 CEntryStub ceb(1); 137 CEntryStub ceb(1);
138 __ CallStub(&ceb); 138 __ CallStub(&ceb);
139 139
140 // Restore the register values from the expression stack. 140 // Restore the register values from the expression stack.
141 for (int i = kNumJSCallerSaved - 1; i >= 0; i--) { 141 for (int i = kNumJSCallerSaved - 1; i >= 0; i--) {
142 int r = JSCallerSavedCode(i); 142 int r = JSCallerSavedCode(i);
143 Register reg = { r }; 143 Register reg = { r };
144 if (FLAG_debug_code) { 144 if (FLAG_debug_code) {
145 __ Set(reg, kDebugZapValue); 145 __ Set(reg, kDebugZapValue);
(...skipping 19 matching lines...) Expand all
165 // be an unwanted return address left on the stack. Here we get rid of that. 165 // be an unwanted return address left on the stack. Here we get rid of that.
166 if (convert_call_to_jmp) { 166 if (convert_call_to_jmp) {
167 __ addq(rsp, Immediate(kPointerSize)); 167 __ addq(rsp, Immediate(kPointerSize));
168 } 168 }
169 169
170 // Now that the break point has been handled, resume normal execution by 170 // Now that the break point has been handled, resume normal execution by
171 // jumping to the target address intended by the caller and that was 171 // jumping to the target address intended by the caller and that was
172 // overwritten by the address of DebugBreakXXX. 172 // overwritten by the address of DebugBreakXXX.
173 ExternalReference after_break_target = 173 ExternalReference after_break_target =
174 ExternalReference(Debug_Address::AfterBreakTarget(), masm->isolate()); 174 ExternalReference(Debug_Address::AfterBreakTarget(), masm->isolate());
175 __ movq(kScratchRegister, after_break_target); 175 __ Move(kScratchRegister, after_break_target);
176 __ jmp(Operand(kScratchRegister, 0)); 176 __ jmp(Operand(kScratchRegister, 0));
177 } 177 }
178 178
179 179
180 void Debug::GenerateLoadICDebugBreak(MacroAssembler* masm) { 180 void Debug::GenerateLoadICDebugBreak(MacroAssembler* masm) {
181 // Register state for IC load call (from ic-x64.cc). 181 // Register state for IC load call (from ic-x64.cc).
182 // ----------- S t a t e ------------- 182 // ----------- S t a t e -------------
183 // -- rax : receiver 183 // -- rax : receiver
184 // -- rcx : name 184 // -- rcx : name
185 // ----------------------------------- 185 // -----------------------------------
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 312
313 void Debug::GeneratePlainReturnLiveEdit(MacroAssembler* masm) { 313 void Debug::GeneratePlainReturnLiveEdit(MacroAssembler* masm) {
314 masm->ret(0); 314 masm->ret(0);
315 } 315 }
316 316
317 317
318 void Debug::GenerateFrameDropperLiveEdit(MacroAssembler* masm) { 318 void Debug::GenerateFrameDropperLiveEdit(MacroAssembler* masm) {
319 ExternalReference restarter_frame_function_slot = 319 ExternalReference restarter_frame_function_slot =
320 ExternalReference(Debug_Address::RestarterFrameFunctionPointer(), 320 ExternalReference(Debug_Address::RestarterFrameFunctionPointer(),
321 masm->isolate()); 321 masm->isolate());
322 __ movq(rax, restarter_frame_function_slot); 322 __ Move(rax, restarter_frame_function_slot);
323 __ movq(Operand(rax, 0), Immediate(0)); 323 __ movq(Operand(rax, 0), Immediate(0));
324 324
325 // We do not know our frame height, but set rsp based on rbp. 325 // We do not know our frame height, but set rsp based on rbp.
326 __ lea(rsp, Operand(rbp, -1 * kPointerSize)); 326 __ lea(rsp, Operand(rbp, -1 * kPointerSize));
327 327
328 __ pop(rdi); // Function. 328 __ pop(rdi); // Function.
329 __ pop(rbp); 329 __ pop(rbp);
330 330
331 // Load context from the function. 331 // Load context from the function.
332 __ movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset)); 332 __ movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset));
333 333
334 // Get function code. 334 // Get function code.
335 __ movq(rdx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset)); 335 __ movq(rdx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset));
336 __ movq(rdx, FieldOperand(rdx, SharedFunctionInfo::kCodeOffset)); 336 __ movq(rdx, FieldOperand(rdx, SharedFunctionInfo::kCodeOffset));
337 __ lea(rdx, FieldOperand(rdx, Code::kHeaderSize)); 337 __ lea(rdx, FieldOperand(rdx, Code::kHeaderSize));
338 338
339 // Re-run JSFunction, rdi is function, rsi is context. 339 // Re-run JSFunction, rdi is function, rsi is context.
340 __ jmp(rdx); 340 __ jmp(rdx);
341 } 341 }
342 342
343 const bool Debug::kFrameDropperSupported = true; 343 const bool Debug::kFrameDropperSupported = true;
344 344
345 #undef __ 345 #undef __
346 346
347 #endif // ENABLE_DEBUGGER_SUPPORT 347 #endif // ENABLE_DEBUGGER_SUPPORT
348 348
349 } } // namespace v8::internal 349 } } // namespace v8::internal
350 350
351 #endif // V8_TARGET_ARCH_X64 351 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/codegen-x64.cc ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698