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

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

Issue 14738009: Ensure that soft-deopts don't count against opt_count (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Implement x64 and ARM, review feedback Created 7 years, 7 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 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 unsigned pc_offset = FullCodeGenerator::PcField::decode(pc_and_state); 523 unsigned pc_offset = FullCodeGenerator::PcField::decode(pc_and_state);
524 intptr_t pc_value = reinterpret_cast<intptr_t>(start + pc_offset); 524 intptr_t pc_value = reinterpret_cast<intptr_t>(start + pc_offset);
525 output_frame->SetPc(pc_value); 525 output_frame->SetPc(pc_value);
526 526
527 FullCodeGenerator::State state = 527 FullCodeGenerator::State state =
528 FullCodeGenerator::StateField::decode(pc_and_state); 528 FullCodeGenerator::StateField::decode(pc_and_state);
529 output_frame->SetState(Smi::FromInt(state)); 529 output_frame->SetState(Smi::FromInt(state));
530 530
531 // Set the continuation for the topmost frame. 531 // Set the continuation for the topmost frame.
532 if (is_topmost && bailout_type_ != DEBUGGER) { 532 if (is_topmost && bailout_type_ != DEBUGGER) {
533 Code* continuation = (bailout_type_ == EAGER) 533 Builtins* builtins = isolate_->builtins();
534 ? isolate_->builtins()->builtin(Builtins::kNotifyDeoptimized) 534 Code* continuation = builtins->builtin(Builtins::kNotifyDeoptimized);
535 : isolate_->builtins()->builtin(Builtins::kNotifyLazyDeoptimized); 535 if (bailout_type_ == LAZY) {
536 continuation = builtins->builtin(Builtins::kNotifyLazyDeoptimized);
537 } else if (bailout_type_ == SOFT) {
538 continuation = builtins->builtin(Builtins::kNotifySoftDeoptimized);
539 } else {
540 ASSERT(bailout_type_ == EAGER);
541 }
536 output_frame->SetContinuation( 542 output_frame->SetContinuation(
537 reinterpret_cast<intptr_t>(continuation->entry())); 543 reinterpret_cast<intptr_t>(continuation->entry()));
538 } 544 }
539 } 545 }
540 546
541 547
542 void Deoptimizer::FillInputFrame(Address tos, JavaScriptFrame* frame) { 548 void Deoptimizer::FillInputFrame(Address tos, JavaScriptFrame* frame) {
543 // Set the register values. The values are not important as there are no 549 // Set the register values. The values are not important as there are no
544 // callee saved registers in JavaScript frames, so all registers are 550 // callee saved registers in JavaScript frames, so all registers are
545 // spilled. Registers rbp and rsp are set to the correct values though. 551 // spilled. Registers rbp and rsp are set to the correct values though.
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 // We use this to keep the value of the fifth argument temporarily. 617 // We use this to keep the value of the fifth argument temporarily.
612 // Unfortunately we can't store it directly in r8 (used for passing 618 // Unfortunately we can't store it directly in r8 (used for passing
613 // this on linux), since it is another parameter passing register on windows. 619 // this on linux), since it is another parameter passing register on windows.
614 Register arg5 = r11; 620 Register arg5 = r11;
615 621
616 // Get the bailout id from the stack. 622 // Get the bailout id from the stack.
617 __ movq(arg_reg_3, Operand(rsp, kSavedRegistersAreaSize)); 623 __ movq(arg_reg_3, Operand(rsp, kSavedRegistersAreaSize));
618 624
619 // Get the address of the location in the code object if possible 625 // Get the address of the location in the code object if possible
620 // and compute the fp-to-sp delta in register arg5. 626 // and compute the fp-to-sp delta in register arg5.
621 if (type() == EAGER) { 627 if (type() == EAGER || type() == SOFT) {
622 __ Set(arg_reg_4, 0); 628 __ Set(arg_reg_4, 0);
623 __ lea(arg5, Operand(rsp, kSavedRegistersAreaSize + 1 * kPointerSize)); 629 __ lea(arg5, Operand(rsp, kSavedRegistersAreaSize + 1 * kPointerSize));
624 } else { 630 } else {
625 __ movq(arg_reg_4, 631 __ movq(arg_reg_4,
626 Operand(rsp, kSavedRegistersAreaSize + 1 * kPointerSize)); 632 Operand(rsp, kSavedRegistersAreaSize + 1 * kPointerSize));
627 __ lea(arg5, Operand(rsp, kSavedRegistersAreaSize + 2 * kPointerSize)); 633 __ lea(arg5, Operand(rsp, kSavedRegistersAreaSize + 2 * kPointerSize));
628 } 634 }
629 635
630 __ subq(arg5, rbp); 636 __ subq(arg5, rbp);
631 __ neg(arg5); 637 __ neg(arg5);
(...skipping 30 matching lines...) Expand all
662 } 668 }
663 669
664 // Fill in the double input registers. 670 // Fill in the double input registers.
665 int double_regs_offset = FrameDescription::double_registers_offset(); 671 int double_regs_offset = FrameDescription::double_registers_offset();
666 for (int i = 0; i < XMMRegister::NumAllocatableRegisters(); i++) { 672 for (int i = 0; i < XMMRegister::NumAllocatableRegisters(); i++) {
667 int dst_offset = i * kDoubleSize + double_regs_offset; 673 int dst_offset = i * kDoubleSize + double_regs_offset;
668 __ pop(Operand(rbx, dst_offset)); 674 __ pop(Operand(rbx, dst_offset));
669 } 675 }
670 676
671 // Remove the bailout id from the stack. 677 // Remove the bailout id from the stack.
672 if (type() == EAGER) { 678 if (type() == EAGER || type() == SOFT) {
673 __ addq(rsp, Immediate(kPointerSize)); 679 __ addq(rsp, Immediate(kPointerSize));
674 } else { 680 } else {
675 __ addq(rsp, Immediate(2 * kPointerSize)); 681 __ addq(rsp, Immediate(2 * kPointerSize));
676 } 682 }
677 683
678 // Compute a pointer to the unwinding limit in register rcx; that is 684 // Compute a pointer to the unwinding limit in register rcx; that is
679 // the first stack slot not part of the input frame. 685 // the first stack slot not part of the input frame.
680 __ movq(rcx, Operand(rbx, FrameDescription::frame_size_offset())); 686 __ movq(rcx, Operand(rbx, FrameDescription::frame_size_offset()));
681 __ addq(rcx, rsp); 687 __ addq(rcx, rsp);
682 688
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 } 789 }
784 __ bind(&done); 790 __ bind(&done);
785 } 791 }
786 792
787 #undef __ 793 #undef __
788 794
789 795
790 } } // namespace v8::internal 796 } } // namespace v8::internal
791 797
792 #endif // V8_TARGET_ARCH_X64 798 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698