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/mips/builtins-mips.cc

Issue 83583003: MIPS: Fix and simplify code aging. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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
« no previous file with comments | « src/mips/assembler-mips-inl.h ('k') | src/mips/codegen-mips.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 795 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 } 806 }
807 807
808 808
809 static void GenerateMakeCodeYoungAgainCommon(MacroAssembler* masm) { 809 static void GenerateMakeCodeYoungAgainCommon(MacroAssembler* masm) {
810 // For now, we are relying on the fact that make_code_young doesn't do any 810 // For now, we are relying on the fact that make_code_young doesn't do any
811 // garbage collection which allows us to save/restore the registers without 811 // garbage collection which allows us to save/restore the registers without
812 // worrying about which of them contain pointers. We also don't build an 812 // worrying about which of them contain pointers. We also don't build an
813 // internal frame to make the code faster, since we shouldn't have to do stack 813 // internal frame to make the code faster, since we shouldn't have to do stack
814 // crawls in MakeCodeYoung. This seems a bit fragile. 814 // crawls in MakeCodeYoung. This seems a bit fragile.
815 815
816 __ mov(a0, ra); 816 // Set a0 to point to the head of the PlatformCodeAge sequence.
817 // Adjust a0 to point to the head of the PlatformCodeAge sequence
818 __ Subu(a0, a0, 817 __ Subu(a0, a0,
819 Operand((kNoCodeAgeSequenceLength - 1) * Assembler::kInstrSize)); 818 Operand((kNoCodeAgeSequenceLength - 1) * Assembler::kInstrSize));
820 // Restore the original return address of the function
821 __ mov(ra, at);
822 819
823 // The following registers must be saved and restored when calling through to 820 // The following registers must be saved and restored when calling through to
824 // the runtime: 821 // the runtime:
825 // a0 - contains return address (beginning of patch sequence) 822 // a0 - contains return address (beginning of patch sequence)
826 // a1 - isolate 823 // a1 - isolate
827 RegList saved_regs = 824 RegList saved_regs =
828 (a0.bit() | a1.bit() | ra.bit() | fp.bit()) & ~sp.bit(); 825 (a0.bit() | a1.bit() | ra.bit() | fp.bit()) & ~sp.bit();
829 FrameScope scope(masm, StackFrame::MANUAL); 826 FrameScope scope(masm, StackFrame::MANUAL);
830 __ MultiPush(saved_regs); 827 __ MultiPush(saved_regs);
831 __ PrepareCallCFunction(1, 0, a2); 828 __ PrepareCallCFunction(1, 0, a2);
(...skipping 16 matching lines...) Expand all
848 CODE_AGE_LIST(DEFINE_CODE_AGE_BUILTIN_GENERATOR) 845 CODE_AGE_LIST(DEFINE_CODE_AGE_BUILTIN_GENERATOR)
849 #undef DEFINE_CODE_AGE_BUILTIN_GENERATOR 846 #undef DEFINE_CODE_AGE_BUILTIN_GENERATOR
850 847
851 848
852 void Builtins::Generate_MarkCodeAsExecutedOnce(MacroAssembler* masm) { 849 void Builtins::Generate_MarkCodeAsExecutedOnce(MacroAssembler* masm) {
853 // For now, as in GenerateMakeCodeYoungAgainCommon, we are relying on the fact 850 // For now, as in GenerateMakeCodeYoungAgainCommon, we are relying on the fact
854 // that make_code_young doesn't do any garbage collection which allows us to 851 // that make_code_young doesn't do any garbage collection which allows us to
855 // save/restore the registers without worrying about which of them contain 852 // save/restore the registers without worrying about which of them contain
856 // pointers. 853 // pointers.
857 854
858 __ mov(a0, ra); 855 // Set a0 to point to the head of the PlatformCodeAge sequence.
859 // Adjust a0 to point to the head of the PlatformCodeAge sequence
860 __ Subu(a0, a0, 856 __ Subu(a0, a0,
861 Operand((kNoCodeAgeSequenceLength - 1) * Assembler::kInstrSize)); 857 Operand((kNoCodeAgeSequenceLength - 1) * Assembler::kInstrSize));
862 // Restore the original return address of the function
863 __ mov(ra, at);
864 858
865 // The following registers must be saved and restored when calling through to 859 // The following registers must be saved and restored when calling through to
866 // the runtime: 860 // the runtime:
867 // a0 - contains return address (beginning of patch sequence) 861 // a0 - contains return address (beginning of patch sequence)
868 // a1 - isolate 862 // a1 - isolate
869 RegList saved_regs = 863 RegList saved_regs =
870 (a0.bit() | a1.bit() | ra.bit() | fp.bit()) & ~sp.bit(); 864 (a0.bit() | a1.bit() | ra.bit() | fp.bit()) & ~sp.bit();
871 FrameScope scope(masm, StackFrame::MANUAL); 865 FrameScope scope(masm, StackFrame::MANUAL);
872 __ MultiPush(saved_regs); 866 __ MultiPush(saved_regs);
873 __ PrepareCallCFunction(1, 0, a2); 867 __ PrepareCallCFunction(1, 0, a2);
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after
1524 __ bind(&dont_adapt_arguments); 1518 __ bind(&dont_adapt_arguments);
1525 __ Jump(a3); 1519 __ Jump(a3);
1526 } 1520 }
1527 1521
1528 1522
1529 #undef __ 1523 #undef __
1530 1524
1531 } } // namespace v8::internal 1525 } } // namespace v8::internal
1532 1526
1533 #endif // V8_TARGET_ARCH_MIPS 1527 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/assembler-mips-inl.h ('k') | src/mips/codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698