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

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

Issue 23480031: Enable preaging of code objects when --optimize-for-size. (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: bool -> enum Created 7 years, 2 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 | « src/mips/assembler-mips-inl.h ('k') | src/mips/full-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 839 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 GenerateMakeCodeYoungAgainCommon(masm); \ 850 GenerateMakeCodeYoungAgainCommon(masm); \
851 } \ 851 } \
852 void Builtins::Generate_Make##C##CodeYoungAgainOddMarking( \ 852 void Builtins::Generate_Make##C##CodeYoungAgainOddMarking( \
853 MacroAssembler* masm) { \ 853 MacroAssembler* masm) { \
854 GenerateMakeCodeYoungAgainCommon(masm); \ 854 GenerateMakeCodeYoungAgainCommon(masm); \
855 } 855 }
856 CODE_AGE_LIST(DEFINE_CODE_AGE_BUILTIN_GENERATOR) 856 CODE_AGE_LIST(DEFINE_CODE_AGE_BUILTIN_GENERATOR)
857 #undef DEFINE_CODE_AGE_BUILTIN_GENERATOR 857 #undef DEFINE_CODE_AGE_BUILTIN_GENERATOR
858 858
859 859
860 void Builtins::Generate_MarkCodeAsExecutedOnce(MacroAssembler* masm) {
861 // For now, as in GenerateMakeCodeYoungAgainCommon, we are relying on the fact
862 // that make_code_young doesn't do any garbage collection which allows us to
863 // save/restore the registers without worrying about which of them contain
864 // pointers.
865
866 __ mov(a0, ra);
867 // Adjust a0 to point to the head of the PlatformCodeAge sequence
868 __ Subu(a0, a0,
869 Operand((kNoCodeAgeSequenceLength - 1) * Assembler::kInstrSize));
870 // Restore the original return address of the function
871 __ mov(ra, at);
872
873 // The following registers must be saved and restored when calling through to
874 // the runtime:
875 // a0 - contains return address (beginning of patch sequence)
876 // a1 - isolate
877 RegList saved_regs =
878 (a0.bit() | a1.bit() | ra.bit() | fp.bit()) & ~sp.bit();
879 FrameScope scope(masm, StackFrame::MANUAL);
880 __ MultiPush(saved_regs);
881 __ PrepareCallCFunction(1, 0, a2);
882 __ li(a1, Operand(ExternalReference::isolate_address(masm->isolate())));
883 __ CallCFunction(
884 ExternalReference::get_mark_code_as_executed_function(masm->isolate()),
885 2);
886 __ MultiPop(saved_regs);
887
888 // Perform prologue operations usually performed by the young code stub.
889 __ Push(ra, fp, cp, a1);
890 __ Addu(fp, sp, Operand(2 * kPointerSize));
891
892 // Jump to point after the code-age stub.
893 __ Addu(a0, a0, Operand((kNoCodeAgeSequenceLength) * Assembler::kInstrSize));
894 __ Jump(a0);
895 }
896
897
898 void Builtins::Generate_MarkCodeAsExecutedTwice(MacroAssembler* masm) {
899 GenerateMakeCodeYoungAgainCommon(masm);
900 }
901
902
860 void Builtins::Generate_NotifyStubFailure(MacroAssembler* masm) { 903 void Builtins::Generate_NotifyStubFailure(MacroAssembler* masm) {
861 { 904 {
862 FrameScope scope(masm, StackFrame::INTERNAL); 905 FrameScope scope(masm, StackFrame::INTERNAL);
863 906
864 // Preserve registers across notification, this is important for compiled 907 // Preserve registers across notification, this is important for compiled
865 // stubs that tail call the runtime on deopts passing their parameters in 908 // stubs that tail call the runtime on deopts passing their parameters in
866 // registers. 909 // registers.
867 __ MultiPush(kJSCallerSaved | kCalleeSaved); 910 __ MultiPush(kJSCallerSaved | kCalleeSaved);
868 // Pass the function and deoptimization type to the runtime system. 911 // Pass the function and deoptimization type to the runtime system.
869 __ CallRuntime(Runtime::kNotifyStubFailure, 0); 912 __ CallRuntime(Runtime::kNotifyStubFailure, 0);
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
1474 __ bind(&dont_adapt_arguments); 1517 __ bind(&dont_adapt_arguments);
1475 __ Jump(a3); 1518 __ Jump(a3);
1476 } 1519 }
1477 1520
1478 1521
1479 #undef __ 1522 #undef __
1480 1523
1481 } } // namespace v8::internal 1524 } } // namespace v8::internal
1482 1525
1483 #endif // V8_TARGET_ARCH_MIPS 1526 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/assembler-mips-inl.h ('k') | src/mips/full-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698