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

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

Issue 238253013: Introduce PushQuad and PopQuad for x64 port. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/x64/frames-x64.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 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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 { AllowExternalCallThatCantCauseGC scope(masm()); 223 { AllowExternalCallThatCantCauseGC scope(masm());
224 __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate()), 6); 224 __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate()), 6);
225 } 225 }
226 // Preserve deoptimizer object in register rax and get the input 226 // Preserve deoptimizer object in register rax and get the input
227 // frame descriptor pointer. 227 // frame descriptor pointer.
228 __ movp(rbx, Operand(rax, Deoptimizer::input_offset())); 228 __ movp(rbx, Operand(rax, Deoptimizer::input_offset()));
229 229
230 // Fill in the input registers. 230 // Fill in the input registers.
231 for (int i = kNumberOfRegisters -1; i >= 0; i--) { 231 for (int i = kNumberOfRegisters -1; i >= 0; i--) {
232 int offset = (i * kPointerSize) + FrameDescription::registers_offset(); 232 int offset = (i * kPointerSize) + FrameDescription::registers_offset();
233 __ Pop(Operand(rbx, offset)); 233 __ PopQuad(Operand(rbx, offset));
234 } 234 }
235 235
236 // Fill in the double input registers. 236 // Fill in the double input registers.
237 int double_regs_offset = FrameDescription::double_registers_offset(); 237 int double_regs_offset = FrameDescription::double_registers_offset();
238 for (int i = 0; i < XMMRegister::NumAllocatableRegisters(); i++) { 238 for (int i = 0; i < XMMRegister::NumAllocatableRegisters(); i++) {
239 int dst_offset = i * kDoubleSize + double_regs_offset; 239 int dst_offset = i * kDoubleSize + double_regs_offset;
240 __ popq(Operand(rbx, dst_offset)); 240 __ popq(Operand(rbx, dst_offset));
241 } 241 }
242 242
243 // Remove the bailout id and return address from the stack. 243 // Remove the bailout id and return address from the stack.
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 __ j(below, &outer_push_loop); 300 __ j(below, &outer_push_loop);
301 301
302 for (int i = 0; i < XMMRegister::NumAllocatableRegisters(); ++i) { 302 for (int i = 0; i < XMMRegister::NumAllocatableRegisters(); ++i) {
303 XMMRegister xmm_reg = XMMRegister::FromAllocationIndex(i); 303 XMMRegister xmm_reg = XMMRegister::FromAllocationIndex(i);
304 int src_offset = i * kDoubleSize + double_regs_offset; 304 int src_offset = i * kDoubleSize + double_regs_offset;
305 __ movsd(xmm_reg, Operand(rbx, src_offset)); 305 __ movsd(xmm_reg, Operand(rbx, src_offset));
306 } 306 }
307 307
308 // Push state, pc, and continuation from the last output frame. 308 // Push state, pc, and continuation from the last output frame.
309 __ Push(Operand(rbx, FrameDescription::state_offset())); 309 __ Push(Operand(rbx, FrameDescription::state_offset()));
310 __ Push(Operand(rbx, FrameDescription::pc_offset())); 310 __ PushQuad(Operand(rbx, FrameDescription::pc_offset()));
311 __ Push(Operand(rbx, FrameDescription::continuation_offset())); 311 __ PushQuad(Operand(rbx, FrameDescription::continuation_offset()));
312 312
313 // Push the registers from the last output frame. 313 // Push the registers from the last output frame.
314 for (int i = 0; i < kNumberOfRegisters; i++) { 314 for (int i = 0; i < kNumberOfRegisters; i++) {
315 int offset = (i * kPointerSize) + FrameDescription::registers_offset(); 315 int offset = (i * kPointerSize) + FrameDescription::registers_offset();
316 __ Push(Operand(rbx, offset)); 316 __ PushQuad(Operand(rbx, offset));
317 } 317 }
318 318
319 // Restore the registers from the stack. 319 // Restore the registers from the stack.
320 for (int i = kNumberOfRegisters - 1; i >= 0 ; i--) { 320 for (int i = kNumberOfRegisters - 1; i >= 0 ; i--) {
321 Register r = Register::from_code(i); 321 Register r = Register::from_code(i);
322 // Do not restore rsp, simply pop the value into the next register 322 // Do not restore rsp, simply pop the value into the next register
323 // and overwrite this afterwards. 323 // and overwrite this afterwards.
324 if (r.is(rsp)) { 324 if (r.is(rsp)) {
325 ASSERT(i > 0); 325 ASSERT(i > 0);
326 r = Register::from_code(i - 1); 326 r = Register::from_code(i - 1);
(...skipping 18 matching lines...) Expand all
345 USE(start); 345 USE(start);
346 __ pushq_imm32(i); 346 __ pushq_imm32(i);
347 __ jmp(&done); 347 __ jmp(&done);
348 ASSERT(masm()->pc_offset() - start == table_entry_size_); 348 ASSERT(masm()->pc_offset() - start == table_entry_size_);
349 } 349 }
350 __ bind(&done); 350 __ bind(&done);
351 } 351 }
352 352
353 353
354 void FrameDescription::SetCallerPc(unsigned offset, intptr_t value) { 354 void FrameDescription::SetCallerPc(unsigned offset, intptr_t value) {
355 if (kPCOnStackSize == 2 * kPointerSize) {
356 // Zero out the high-32 bit of PC for x32 port.
357 SetFrameSlot(offset + kPointerSize, 0);
358 }
355 SetFrameSlot(offset, value); 359 SetFrameSlot(offset, value);
356 } 360 }
357 361
358 362
359 void FrameDescription::SetCallerFp(unsigned offset, intptr_t value) { 363 void FrameDescription::SetCallerFp(unsigned offset, intptr_t value) {
364 if (kFPOnStackSize == 2 * kPointerSize) {
365 // Zero out the high-32 bit of FP for x32 port.
366 SetFrameSlot(offset + kPointerSize, 0);
367 }
360 SetFrameSlot(offset, value); 368 SetFrameSlot(offset, value);
361 } 369 }
362 370
363 371
364 void FrameDescription::SetCallerConstantPool(unsigned offset, intptr_t value) { 372 void FrameDescription::SetCallerConstantPool(unsigned offset, intptr_t value) {
365 // No out-of-line constant pool support. 373 // No out-of-line constant pool support.
366 UNREACHABLE(); 374 UNREACHABLE();
367 } 375 }
368 376
369 377
370 #undef __ 378 #undef __
371 379
372 380
373 } } // namespace v8::internal 381 } } // namespace v8::internal
374 382
375 #endif // V8_TARGET_ARCH_X64 383 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « no previous file | src/x64/frames-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698