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

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

Issue 20262004: Use kRegisterSize when calling C++ runtime (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 7 years, 5 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
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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 __ movsd(Operand(rsp, offset), xmm_reg); 400 __ movsd(Operand(rsp, offset), xmm_reg);
401 } 401 }
402 402
403 // We push all registers onto the stack, even though we do not need 403 // We push all registers onto the stack, even though we do not need
404 // to restore all later. 404 // to restore all later.
405 for (int i = 0; i < kNumberOfRegisters; i++) { 405 for (int i = 0; i < kNumberOfRegisters; i++) {
406 Register r = Register::from_code(i); 406 Register r = Register::from_code(i);
407 __ push(r); 407 __ push(r);
408 } 408 }
409 409
410 const int kSavedRegistersAreaSize = kNumberOfRegisters * kPointerSize + 410 const int kSavedRegistersAreaSize = kNumberOfRegisters * kRegisterSize +
haitao.feng 2013/07/25 11:40:50 For X32, we used 8-byte push for bailout id and re
411 kDoubleRegsSize; 411 kDoubleRegsSize;
412 412
413 // We use this to keep the value of the fifth argument temporarily. 413 // We use this to keep the value of the fifth argument temporarily.
414 // Unfortunately we can't store it directly in r8 (used for passing 414 // Unfortunately we can't store it directly in r8 (used for passing
415 // this on linux), since it is another parameter passing register on windows. 415 // this on linux), since it is another parameter passing register on windows.
416 Register arg5 = r11; 416 Register arg5 = r11;
417 417
418 // Get the bailout id from the stack. 418 // Get the bailout id from the stack.
419 __ movq(arg_reg_3, Operand(rsp, kSavedRegistersAreaSize)); 419 __ movq(arg_reg_3, Operand(rsp, kSavedRegistersAreaSize));
420 420
421 // Get the address of the location in the code object 421 // Get the address of the location in the code object
422 // and compute the fp-to-sp delta in register arg5. 422 // and compute the fp-to-sp delta in register arg5.
423 __ movq(arg_reg_4, 423 __ movq(arg_reg_4,
424 Operand(rsp, kSavedRegistersAreaSize + 1 * kPointerSize)); 424 Operand(rsp, kSavedRegistersAreaSize + 1 * kPCOnStackSize));
425 __ lea(arg5, Operand(rsp, kSavedRegistersAreaSize + 2 * kPointerSize)); 425 __ lea(arg5, Operand(rsp, kSavedRegistersAreaSize + 1 * kPCOnStackSize +
426 1 * kRegisterSize));
426 427
427 __ subq(arg5, rbp); 428 __ subq(arg5, rbp);
428 __ neg(arg5); 429 __ neg(arg5);
429 430
430 // Allocate a new deoptimizer object. 431 // Allocate a new deoptimizer object.
431 __ PrepareCallCFunction(6); 432 __ PrepareCallCFunction(6);
432 __ movq(rax, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); 433 __ movq(rax, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
433 __ movq(arg_reg_1, rax); 434 __ movq(arg_reg_1, rax);
434 __ Set(arg_reg_2, type()); 435 __ Set(arg_reg_2, type());
435 // Args 3 and 4 are already in the right registers. 436 // Args 3 and 4 are already in the right registers.
(...skipping 23 matching lines...) Expand all
459 } 460 }
460 461
461 // Fill in the double input registers. 462 // Fill in the double input registers.
462 int double_regs_offset = FrameDescription::double_registers_offset(); 463 int double_regs_offset = FrameDescription::double_registers_offset();
463 for (int i = 0; i < XMMRegister::NumAllocatableRegisters(); i++) { 464 for (int i = 0; i < XMMRegister::NumAllocatableRegisters(); i++) {
464 int dst_offset = i * kDoubleSize + double_regs_offset; 465 int dst_offset = i * kDoubleSize + double_regs_offset;
465 __ pop(Operand(rbx, dst_offset)); 466 __ pop(Operand(rbx, dst_offset));
466 } 467 }
467 468
468 // Remove the bailout id and return address from the stack. 469 // Remove the bailout id and return address from the stack.
469 __ addq(rsp, Immediate(2 * kPointerSize)); 470 __ addq(rsp, Immediate(1 * kRegisterSize + 1 * kPCOnStackSize));
470 471
471 // Compute a pointer to the unwinding limit in register rcx; that is 472 // Compute a pointer to the unwinding limit in register rcx; that is
472 // the first stack slot not part of the input frame. 473 // the first stack slot not part of the input frame.
473 __ movq(rcx, Operand(rbx, FrameDescription::frame_size_offset())); 474 __ movq(rcx, Operand(rbx, FrameDescription::frame_size_offset()));
474 __ addq(rcx, rsp); 475 __ addq(rcx, rsp);
475 476
476 // Unwind the stack down to - but not including - the unwinding 477 // Unwind the stack down to - but not including - the unwinding
477 // limit and copy the contents of the activation frame to the input 478 // limit and copy the contents of the activation frame to the input
478 // frame description. 479 // frame description.
479 __ lea(rdx, Operand(rbx, FrameDescription::frame_content_offset())); 480 __ lea(rdx, Operand(rbx, FrameDescription::frame_content_offset()));
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 SetFrameSlot(offset, value); 588 SetFrameSlot(offset, value);
588 } 589 }
589 590
590 591
591 #undef __ 592 #undef __
592 593
593 594
594 } } // namespace v8::internal 595 } } // namespace v8::internal
595 596
596 #endif // V8_TARGET_ARCH_X64 597 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698