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

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

Issue 975463002: Implement subclassing Arrays. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix arm again Created 5 years, 9 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_MIPS64 7 #if V8_TARGET_ARCH_MIPS64
8 8
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 4851 matching lines...) Expand 10 before | Expand all | Expand 10 after
4862 } 4862 }
4863 } 4863 }
4864 4864
4865 4865
4866 void ArrayConstructorStub::Generate(MacroAssembler* masm) { 4866 void ArrayConstructorStub::Generate(MacroAssembler* masm) {
4867 // ----------- S t a t e ------------- 4867 // ----------- S t a t e -------------
4868 // -- a0 : argc (only if argument_count() == ANY) 4868 // -- a0 : argc (only if argument_count() == ANY)
4869 // -- a1 : constructor 4869 // -- a1 : constructor
4870 // -- a2 : AllocationSite or undefined 4870 // -- a2 : AllocationSite or undefined
4871 // -- a3 : original constructor 4871 // -- a3 : original constructor
4872 // -- sp[0] : return address 4872 // -- sp[0] : last argument
4873 // -- sp[4] : last argument
4874 // ----------------------------------- 4873 // -----------------------------------
4875 4874
4876 if (FLAG_debug_code) { 4875 if (FLAG_debug_code) {
4877 // The array construct code is only set for the global and natives 4876 // The array construct code is only set for the global and natives
4878 // builtin Array functions which always have maps. 4877 // builtin Array functions which always have maps.
4879 4878
4880 // Initial map for the builtin Array function should be a map. 4879 // Initial map for the builtin Array function should be a map.
4881 __ ld(a4, FieldMemOperand(a1, JSFunction::kPrototypeOrInitialMapOffset)); 4880 __ ld(a4, FieldMemOperand(a1, JSFunction::kPrototypeOrInitialMapOffset));
4882 // Will both indicate a NULL and a Smi. 4881 // Will both indicate a NULL and a Smi.
4883 __ SmiTst(a4, at); 4882 __ SmiTst(a4, at);
(...skipping 17 matching lines...) Expand all
4901 4900
4902 __ ld(a3, FieldMemOperand(a2, AllocationSite::kTransitionInfoOffset)); 4901 __ ld(a3, FieldMemOperand(a2, AllocationSite::kTransitionInfoOffset));
4903 __ SmiUntag(a3); 4902 __ SmiUntag(a3);
4904 STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0); 4903 STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0);
4905 __ And(a3, a3, Operand(AllocationSite::ElementsKindBits::kMask)); 4904 __ And(a3, a3, Operand(AllocationSite::ElementsKindBits::kMask));
4906 GenerateDispatchToArrayStub(masm, DONT_OVERRIDE); 4905 GenerateDispatchToArrayStub(masm, DONT_OVERRIDE);
4907 4906
4908 __ bind(&no_info); 4907 __ bind(&no_info);
4909 GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES); 4908 GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES);
4910 4909
4910 // Subclassing.
4911 __ bind(&subclassing); 4911 __ bind(&subclassing);
4912 __ TailCallRuntime(Runtime::kThrowArrayNotSubclassableError, 0, 1); 4912 __ Push(a1);
4913 __ Push(a3);
4914
4915 // Adjust argc.
4916 switch (argument_count()) {
4917 case ANY:
4918 case MORE_THAN_ONE:
4919 __ li(at, Operand(2));
4920 __ addu(a0, a0, at);
4921 break;
4922 case NONE:
4923 __ li(a0, Operand(2));
4924 break;
4925 case ONE:
4926 __ li(a0, Operand(3));
4927 break;
4928 }
4929
4930 __ JumpToExternalReference(
4931 ExternalReference(Runtime::kArrayConstructorWithSubclassing, isolate()));
4913 } 4932 }
4914 4933
4915 4934
4916 void InternalArrayConstructorStub::GenerateCase( 4935 void InternalArrayConstructorStub::GenerateCase(
4917 MacroAssembler* masm, ElementsKind kind) { 4936 MacroAssembler* masm, ElementsKind kind) {
4918 4937
4919 InternalArrayNoArgumentConstructorStub stub0(isolate(), kind); 4938 InternalArrayNoArgumentConstructorStub stub0(isolate(), kind);
4920 __ TailCallStub(&stub0, lo, a0, Operand(1)); 4939 __ TailCallStub(&stub0, lo, a0, Operand(1));
4921 4940
4922 InternalArrayNArgumentsConstructorStub stubN(isolate(), kind); 4941 InternalArrayNArgumentsConstructorStub stubN(isolate(), kind);
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
5290 kStackUnwindSpace, kInvalidStackOffset, 5309 kStackUnwindSpace, kInvalidStackOffset,
5291 MemOperand(fp, 6 * kPointerSize), NULL); 5310 MemOperand(fp, 6 * kPointerSize), NULL);
5292 } 5311 }
5293 5312
5294 5313
5295 #undef __ 5314 #undef __
5296 5315
5297 } } // namespace v8::internal 5316 } } // namespace v8::internal
5298 5317
5299 #endif // V8_TARGET_ARCH_MIPS64 5318 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips/code-stubs-mips.cc ('k') | src/runtime/runtime.h » ('j') | src/runtime/runtime-array.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698