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

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

Issue 10701054: Enable stub generation using Hydrogen/Lithium (again) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 8 years 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 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 GenerateMakeCodeYoungAgainCommon(masm); \ 639 GenerateMakeCodeYoungAgainCommon(masm); \
640 } \ 640 } \
641 void Builtins::Generate_Make##C##CodeYoungAgainOddMarking( \ 641 void Builtins::Generate_Make##C##CodeYoungAgainOddMarking( \
642 MacroAssembler* masm) { \ 642 MacroAssembler* masm) { \
643 GenerateMakeCodeYoungAgainCommon(masm); \ 643 GenerateMakeCodeYoungAgainCommon(masm); \
644 } 644 }
645 CODE_AGE_LIST(DEFINE_CODE_AGE_BUILTIN_GENERATOR) 645 CODE_AGE_LIST(DEFINE_CODE_AGE_BUILTIN_GENERATOR)
646 #undef DEFINE_CODE_AGE_BUILTIN_GENERATOR 646 #undef DEFINE_CODE_AGE_BUILTIN_GENERATOR
647 647
648 648
649 void Builtins::Generate_NotifyICMiss(MacroAssembler* masm) {
650 // Enter an internal frame.
651 {
652 FrameScope scope(masm, StackFrame::INTERNAL);
653
654 // Preserve registers across notification this is important compiled stubs
Jakob Kummerow 2012/11/28 16:28:22 nit: missing comma after "notification", important
danno 2012/11/30 16:23:24 Done.
655 // that tail call the runtime on deopts passing their parameters in
656 // registers.
657 __ Pushad();
658 __ CallRuntime(Runtime::kNotifyICMiss, 0);
659 __ Popad();
660 // Tear down internal frame.
661 }
662
663 __ pop(MemOperand(rsp, 0)); // Ignore state offset
664 __ ret(0); // Return to IC Miss stub, continuation still on stack.
665 }
666
667
649 static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm, 668 static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm,
650 Deoptimizer::BailoutType type) { 669 Deoptimizer::BailoutType type) {
651 // Enter an internal frame. 670 // Enter an internal frame.
652 { 671 {
653 FrameScope scope(masm, StackFrame::INTERNAL); 672 FrameScope scope(masm, StackFrame::INTERNAL);
654 673
674 // Preserve registers across notification, this is important compiled stubs
Jakob Kummerow 2012/11/28 16:28:22 nit: important *for* compiled stubs
danno 2012/11/30 16:23:24 Done.
675 // that tail call the runtime on deopts passing their parameters in
676 // registers.
677 __ Pushad();
Jakob Kummerow 2012/11/28 16:28:22 Why do the other platforms (both ia32 and ARM) not
danno 2012/11/30 16:23:24 This is a cut/paste problem. Removed. On 2012/11/2
678
655 // Pass the deoptimization type to the runtime system. 679 // Pass the deoptimization type to the runtime system.
656 __ Push(Smi::FromInt(static_cast<int>(type))); 680 __ Push(Smi::FromInt(static_cast<int>(type)));
657 681
658 __ CallRuntime(Runtime::kNotifyDeoptimized, 1); 682 __ CallRuntime(Runtime::kNotifyDeoptimized, 1);
683
684 __ Popad();
659 // Tear down internal frame. 685 // Tear down internal frame.
660 } 686 }
661 687
662 // Get the full codegen state from the stack and untag it. 688 // Get the full codegen state from the stack and untag it.
663 __ SmiToInteger32(rcx, Operand(rsp, 1 * kPointerSize)); 689 __ SmiToInteger32(r10, Operand(rsp, 1 * kPointerSize));
664 690
665 // Switch on the state. 691 // Switch on the state.
666 Label not_no_registers, not_tos_rax; 692 Label not_no_registers, not_tos_rax;
667 __ cmpq(rcx, Immediate(FullCodeGenerator::NO_REGISTERS)); 693 __ cmpq(r10, Immediate(FullCodeGenerator::NO_REGISTERS));
668 __ j(not_equal, &not_no_registers, Label::kNear); 694 __ j(not_equal, &not_no_registers, Label::kNear);
669 __ ret(1 * kPointerSize); // Remove state. 695 __ ret(1 * kPointerSize); // Remove state.
670 696
671 __ bind(&not_no_registers); 697 __ bind(&not_no_registers);
672 __ movq(rax, Operand(rsp, 2 * kPointerSize)); 698 __ movq(rax, Operand(rsp, 2 * kPointerSize));
673 __ cmpq(rcx, Immediate(FullCodeGenerator::TOS_REG)); 699 __ cmpq(r10, Immediate(FullCodeGenerator::TOS_REG));
674 __ j(not_equal, &not_tos_rax, Label::kNear); 700 __ j(not_equal, &not_tos_rax, Label::kNear);
675 __ ret(2 * kPointerSize); // Remove state, rax. 701 __ ret(2 * kPointerSize); // Remove state, rax.
676 702
677 __ bind(&not_tos_rax); 703 __ bind(&not_tos_rax);
678 __ Abort("no cases left"); 704 __ Abort("no cases left");
679 } 705 }
680 706
681 void Builtins::Generate_NotifyDeoptimized(MacroAssembler* masm) { 707 void Builtins::Generate_NotifyDeoptimized(MacroAssembler* masm) {
682 Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::EAGER); 708 Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::EAGER);
683 } 709 }
(...skipping 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after
1816 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); 1842 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR);
1817 generator.Generate(); 1843 generator.Generate();
1818 } 1844 }
1819 1845
1820 1846
1821 #undef __ 1847 #undef __
1822 1848
1823 } } // namespace v8::internal 1849 } } // namespace v8::internal
1824 1850
1825 #endif // V8_TARGET_ARCH_X64 1851 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698