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

Side by Side Diff: src/mips/code-stubs-mips.cc

Issue 128683002: Array constructor can be simplified by loading context from JSFunction. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Simple ports. Created 6 years, 11 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/ia32/lithium-codegen-ia32.cc ('k') | src/mips/lithium-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 5714 matching lines...) Expand 10 before | Expand all | Expand 10 after
5725 // Also pop ra to get Ret(0). 5725 // Also pop ra to get Ret(0).
5726 __ MultiPop(kSavedRegs | ra.bit()); 5726 __ MultiPop(kSavedRegs | ra.bit());
5727 __ Ret(); 5727 __ Ret();
5728 } 5728 }
5729 5729
5730 5730
5731 template<class T> 5731 template<class T>
5732 static void CreateArrayDispatch(MacroAssembler* masm, 5732 static void CreateArrayDispatch(MacroAssembler* masm,
5733 AllocationSiteOverrideMode mode) { 5733 AllocationSiteOverrideMode mode) {
5734 if (mode == DISABLE_ALLOCATION_SITES) { 5734 if (mode == DISABLE_ALLOCATION_SITES) {
5735 T stub(GetInitialFastElementsKind(), 5735 T stub(GetInitialFastElementsKind(), mode);
5736 CONTEXT_CHECK_REQUIRED,
5737 mode);
5738 __ TailCallStub(&stub); 5736 __ TailCallStub(&stub);
5739 } else if (mode == DONT_OVERRIDE) { 5737 } else if (mode == DONT_OVERRIDE) {
5740 int last_index = GetSequenceIndexFromFastElementsKind( 5738 int last_index = GetSequenceIndexFromFastElementsKind(
5741 TERMINAL_FAST_ELEMENTS_KIND); 5739 TERMINAL_FAST_ELEMENTS_KIND);
5742 for (int i = 0; i <= last_index; ++i) { 5740 for (int i = 0; i <= last_index; ++i) {
5743 ElementsKind kind = GetFastElementsKindFromSequenceIndex(i); 5741 ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
5744 T stub(kind); 5742 T stub(kind);
5745 __ TailCallStub(&stub, eq, a3, Operand(kind)); 5743 __ TailCallStub(&stub, eq, a3, Operand(kind));
5746 } 5744 }
5747 5745
(...skipping 28 matching lines...) Expand all
5776 5774
5777 // look at the first argument 5775 // look at the first argument
5778 __ lw(t1, MemOperand(sp, 0)); 5776 __ lw(t1, MemOperand(sp, 0));
5779 __ Branch(&normal_sequence, eq, t1, Operand(zero_reg)); 5777 __ Branch(&normal_sequence, eq, t1, Operand(zero_reg));
5780 5778
5781 if (mode == DISABLE_ALLOCATION_SITES) { 5779 if (mode == DISABLE_ALLOCATION_SITES) {
5782 ElementsKind initial = GetInitialFastElementsKind(); 5780 ElementsKind initial = GetInitialFastElementsKind();
5783 ElementsKind holey_initial = GetHoleyElementsKind(initial); 5781 ElementsKind holey_initial = GetHoleyElementsKind(initial);
5784 5782
5785 ArraySingleArgumentConstructorStub stub_holey(holey_initial, 5783 ArraySingleArgumentConstructorStub stub_holey(holey_initial,
5786 CONTEXT_CHECK_REQUIRED,
5787 DISABLE_ALLOCATION_SITES); 5784 DISABLE_ALLOCATION_SITES);
5788 __ TailCallStub(&stub_holey); 5785 __ TailCallStub(&stub_holey);
5789 5786
5790 __ bind(&normal_sequence); 5787 __ bind(&normal_sequence);
5791 ArraySingleArgumentConstructorStub stub(initial, 5788 ArraySingleArgumentConstructorStub stub(initial,
5792 CONTEXT_CHECK_REQUIRED,
5793 DISABLE_ALLOCATION_SITES); 5789 DISABLE_ALLOCATION_SITES);
5794 __ TailCallStub(&stub); 5790 __ TailCallStub(&stub);
5795 } else if (mode == DONT_OVERRIDE) { 5791 } else if (mode == DONT_OVERRIDE) {
5796 // We are going to create a holey array, but our kind is non-holey. 5792 // We are going to create a holey array, but our kind is non-holey.
5797 // Fix kind and retry (only if we have an allocation site in the cell). 5793 // Fix kind and retry (only if we have an allocation site in the cell).
5798 __ Addu(a3, a3, Operand(1)); 5794 __ Addu(a3, a3, Operand(1));
5799 __ lw(t1, FieldMemOperand(a2, Cell::kValueOffset)); 5795 __ lw(t1, FieldMemOperand(a2, Cell::kValueOffset));
5800 5796
5801 if (FLAG_debug_code) { 5797 if (FLAG_debug_code) {
5802 __ lw(t1, FieldMemOperand(t1, 0)); 5798 __ lw(t1, FieldMemOperand(t1, 0));
(...skipping 30 matching lines...) Expand all
5833 5829
5834 template<class T> 5830 template<class T>
5835 static void ArrayConstructorStubAheadOfTimeHelper(Isolate* isolate) { 5831 static void ArrayConstructorStubAheadOfTimeHelper(Isolate* isolate) {
5836 int to_index = GetSequenceIndexFromFastElementsKind( 5832 int to_index = GetSequenceIndexFromFastElementsKind(
5837 TERMINAL_FAST_ELEMENTS_KIND); 5833 TERMINAL_FAST_ELEMENTS_KIND);
5838 for (int i = 0; i <= to_index; ++i) { 5834 for (int i = 0; i <= to_index; ++i) {
5839 ElementsKind kind = GetFastElementsKindFromSequenceIndex(i); 5835 ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
5840 T stub(kind); 5836 T stub(kind);
5841 stub.GetCode(isolate); 5837 stub.GetCode(isolate);
5842 if (AllocationSite::GetMode(kind) != DONT_TRACK_ALLOCATION_SITE) { 5838 if (AllocationSite::GetMode(kind) != DONT_TRACK_ALLOCATION_SITE) {
5843 T stub1(kind, CONTEXT_CHECK_REQUIRED, DISABLE_ALLOCATION_SITES); 5839 T stub1(kind, DISABLE_ALLOCATION_SITES);
5844 stub1.GetCode(isolate); 5840 stub1.GetCode(isolate);
5845 } 5841 }
5846 } 5842 }
5847 } 5843 }
5848 5844
5849 5845
5850 void ArrayConstructorStubBase::GenerateStubsAheadOfTime(Isolate* isolate) { 5846 void ArrayConstructorStubBase::GenerateStubsAheadOfTime(Isolate* isolate) {
5851 ArrayConstructorStubAheadOfTimeHelper<ArrayNoArgumentConstructorStub>( 5847 ArrayConstructorStubAheadOfTimeHelper<ArrayNoArgumentConstructorStub>(
5852 isolate); 5848 isolate);
5853 ArrayConstructorStubAheadOfTimeHelper<ArraySingleArgumentConstructorStub>( 5849 ArrayConstructorStubAheadOfTimeHelper<ArraySingleArgumentConstructorStub>(
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
6027 __ bind(&fast_elements_case); 6023 __ bind(&fast_elements_case);
6028 GenerateCase(masm, FAST_ELEMENTS); 6024 GenerateCase(masm, FAST_ELEMENTS);
6029 } 6025 }
6030 6026
6031 6027
6032 #undef __ 6028 #undef __
6033 6029
6034 } } // namespace v8::internal 6030 } } // namespace v8::internal
6035 6031
6036 #endif // V8_TARGET_ARCH_MIPS 6032 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698