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

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

Issue 2024253002: [stubs] Remove N-argument Hydrogen-based Array constructor stub (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix arm64 Created 4 years, 6 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 #if V8_TARGET_ARCH_MIPS64 5 #if V8_TARGET_ARCH_MIPS64
6 6
7 #include "src/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/api-arguments.h" 8 #include "src/api-arguments.h"
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
11 #include "src/ic/handler-compiler.h" 11 #include "src/ic/handler-compiler.h"
12 #include "src/ic/ic.h" 12 #include "src/ic/ic.h"
13 #include "src/ic/stub-cache.h" 13 #include "src/ic/stub-cache.h"
14 #include "src/isolate.h" 14 #include "src/isolate.h"
15 #include "src/mips64/code-stubs-mips64.h" 15 #include "src/mips64/code-stubs-mips64.h"
16 #include "src/regexp/jsregexp.h" 16 #include "src/regexp/jsregexp.h"
17 #include "src/regexp/regexp-macro-assembler.h" 17 #include "src/regexp/regexp-macro-assembler.h"
18 #include "src/runtime/runtime.h" 18 #include "src/runtime/runtime.h"
19 19
20 namespace v8 { 20 namespace v8 {
21 namespace internal { 21 namespace internal {
22 22
23 #define __ ACCESS_MASM(masm)
23 24
24 static void InitializeArrayConstructorDescriptor( 25 void ArrayNArgumentsConstructorStub::Generate(MacroAssembler* masm) {
25 Isolate* isolate, CodeStubDescriptor* descriptor, 26 __ dsll(t9, a0, kPointerSizeLog2);
26 int constant_stack_parameter_count) { 27 __ Daddu(t9, sp, t9);
27 Address deopt_handler = Runtime::FunctionForId( 28 __ sw(a1, MemOperand(t9, 0));
28 Runtime::kArrayConstructor)->entry; 29 __ Push(a1);
29 30 __ Push(a2);
30 if (constant_stack_parameter_count == 0) { 31 __ Daddu(a0, a0, 3);
31 descriptor->Initialize(deopt_handler, constant_stack_parameter_count, 32 __ TailCallRuntime(Runtime::kNewArray);
32 JS_FUNCTION_STUB_MODE);
33 } else {
34 descriptor->Initialize(a0, deopt_handler, constant_stack_parameter_count,
35 JS_FUNCTION_STUB_MODE);
36 }
37 } 33 }
38 34
39
40 static void InitializeInternalArrayConstructorDescriptor(
41 Isolate* isolate, CodeStubDescriptor* descriptor,
42 int constant_stack_parameter_count) {
43 Address deopt_handler = Runtime::FunctionForId(
44 Runtime::kInternalArrayConstructor)->entry;
45
46 if (constant_stack_parameter_count == 0) {
47 descriptor->Initialize(deopt_handler, constant_stack_parameter_count,
48 JS_FUNCTION_STUB_MODE);
49 } else {
50 descriptor->Initialize(a0, deopt_handler, constant_stack_parameter_count,
51 JS_FUNCTION_STUB_MODE);
52 }
53 }
54
55
56 void ArrayNArgumentsConstructorStub::InitializeDescriptor(
57 CodeStubDescriptor* descriptor) {
58 InitializeArrayConstructorDescriptor(isolate(), descriptor, -1);
59 }
60
61
62 void FastArrayPushStub::InitializeDescriptor(CodeStubDescriptor* descriptor) { 35 void FastArrayPushStub::InitializeDescriptor(CodeStubDescriptor* descriptor) {
63 Address deopt_handler = Runtime::FunctionForId(Runtime::kArrayPush)->entry; 36 Address deopt_handler = Runtime::FunctionForId(Runtime::kArrayPush)->entry;
64 descriptor->Initialize(a0, deopt_handler, -1, JS_FUNCTION_STUB_MODE); 37 descriptor->Initialize(a0, deopt_handler, -1, JS_FUNCTION_STUB_MODE);
65 } 38 }
66 39
67 void FastFunctionBindStub::InitializeDescriptor( 40 void FastFunctionBindStub::InitializeDescriptor(
68 CodeStubDescriptor* descriptor) { 41 CodeStubDescriptor* descriptor) {
69 Address deopt_handler = Runtime::FunctionForId(Runtime::kFunctionBind)->entry; 42 Address deopt_handler = Runtime::FunctionForId(Runtime::kFunctionBind)->entry;
70 descriptor->Initialize(a0, deopt_handler, -1, JS_FUNCTION_STUB_MODE); 43 descriptor->Initialize(a0, deopt_handler, -1, JS_FUNCTION_STUB_MODE);
71 } 44 }
72 45
73 void InternalArrayNArgumentsConstructorStub::InitializeDescriptor(
74 CodeStubDescriptor* descriptor) {
75 InitializeInternalArrayConstructorDescriptor(isolate(), descriptor, -1);
76 }
77
78
79 #define __ ACCESS_MASM(masm)
80
81 static void EmitIdenticalObjectComparison(MacroAssembler* masm, Label* slow, 46 static void EmitIdenticalObjectComparison(MacroAssembler* masm, Label* slow,
82 Condition cc); 47 Condition cc);
83 static void EmitSmiNonsmiComparison(MacroAssembler* masm, 48 static void EmitSmiNonsmiComparison(MacroAssembler* masm,
84 Register lhs, 49 Register lhs,
85 Register rhs, 50 Register rhs,
86 Label* rhs_not_nan, 51 Label* rhs_not_nan,
87 Label* slow, 52 Label* slow,
88 bool strict); 53 bool strict);
89 static void EmitStrictTwoHeapObjectCompare(MacroAssembler* masm, 54 static void EmitStrictTwoHeapObjectCompare(MacroAssembler* masm,
90 Register lhs, 55 Register lhs,
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after
1006 971
1007 bool CEntryStub::NeedsImmovableCode() { 972 bool CEntryStub::NeedsImmovableCode() {
1008 return true; 973 return true;
1009 } 974 }
1010 975
1011 976
1012 void CodeStub::GenerateStubsAheadOfTime(Isolate* isolate) { 977 void CodeStub::GenerateStubsAheadOfTime(Isolate* isolate) {
1013 CEntryStub::GenerateAheadOfTime(isolate); 978 CEntryStub::GenerateAheadOfTime(isolate);
1014 StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(isolate); 979 StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(isolate);
1015 StubFailureTrampolineStub::GenerateAheadOfTime(isolate); 980 StubFailureTrampolineStub::GenerateAheadOfTime(isolate);
1016 ArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); 981 CommonArrayConstructorStub::GenerateStubsAheadOfTime(isolate);
1017 CreateAllocationSiteStub::GenerateAheadOfTime(isolate); 982 CreateAllocationSiteStub::GenerateAheadOfTime(isolate);
1018 CreateWeakCellStub::GenerateAheadOfTime(isolate); 983 CreateWeakCellStub::GenerateAheadOfTime(isolate);
1019 BinaryOpICStub::GenerateAheadOfTime(isolate); 984 BinaryOpICStub::GenerateAheadOfTime(isolate);
1020 StoreRegistersStateStub::GenerateAheadOfTime(isolate); 985 StoreRegistersStateStub::GenerateAheadOfTime(isolate);
1021 RestoreRegistersStateStub::GenerateAheadOfTime(isolate); 986 RestoreRegistersStateStub::GenerateAheadOfTime(isolate);
1022 BinaryOpICWithAllocationSiteStub::GenerateAheadOfTime(isolate); 987 BinaryOpICWithAllocationSiteStub::GenerateAheadOfTime(isolate);
1023 StoreFastElementStub::GenerateAheadOfTime(isolate); 988 StoreFastElementStub::GenerateAheadOfTime(isolate);
1024 TypeofStub::GenerateAheadOfTime(isolate); 989 TypeofStub::GenerateAheadOfTime(isolate);
1025 } 990 }
1026 991
(...skipping 3349 matching lines...) Expand 10 before | Expand all | Expand 10 after
4376 ElementsKind kind = GetFastElementsKindFromSequenceIndex(i); 4341 ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
4377 T stub(isolate, kind); 4342 T stub(isolate, kind);
4378 stub.GetCode(); 4343 stub.GetCode();
4379 if (AllocationSite::GetMode(kind) != DONT_TRACK_ALLOCATION_SITE) { 4344 if (AllocationSite::GetMode(kind) != DONT_TRACK_ALLOCATION_SITE) {
4380 T stub1(isolate, kind, DISABLE_ALLOCATION_SITES); 4345 T stub1(isolate, kind, DISABLE_ALLOCATION_SITES);
4381 stub1.GetCode(); 4346 stub1.GetCode();
4382 } 4347 }
4383 } 4348 }
4384 } 4349 }
4385 4350
4386 4351 void CommonArrayConstructorStub::GenerateStubsAheadOfTime(Isolate* isolate) {
4387 void ArrayConstructorStubBase::GenerateStubsAheadOfTime(Isolate* isolate) {
4388 ArrayConstructorStubAheadOfTimeHelper<ArrayNoArgumentConstructorStub>( 4352 ArrayConstructorStubAheadOfTimeHelper<ArrayNoArgumentConstructorStub>(
4389 isolate); 4353 isolate);
4390 ArrayConstructorStubAheadOfTimeHelper<ArraySingleArgumentConstructorStub>( 4354 ArrayConstructorStubAheadOfTimeHelper<ArraySingleArgumentConstructorStub>(
4391 isolate); 4355 isolate);
4392 ArrayConstructorStubAheadOfTimeHelper<ArrayNArgumentsConstructorStub>( 4356 ArrayNArgumentsConstructorStub stub(isolate);
4393 isolate); 4357 stub.GetCode();
4394 }
4395
4396
4397 void InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(
4398 Isolate* isolate) {
4399 ElementsKind kinds[2] = { FAST_ELEMENTS, FAST_HOLEY_ELEMENTS }; 4358 ElementsKind kinds[2] = { FAST_ELEMENTS, FAST_HOLEY_ELEMENTS };
4400 for (int i = 0; i < 2; i++) { 4359 for (int i = 0; i < 2; i++) {
4401 // For internal arrays we only need a few things. 4360 // For internal arrays we only need a few things.
4402 InternalArrayNoArgumentConstructorStub stubh1(isolate, kinds[i]); 4361 InternalArrayNoArgumentConstructorStub stubh1(isolate, kinds[i]);
4403 stubh1.GetCode(); 4362 stubh1.GetCode();
4404 InternalArraySingleArgumentConstructorStub stubh2(isolate, kinds[i]); 4363 InternalArraySingleArgumentConstructorStub stubh2(isolate, kinds[i]);
4405 stubh2.GetCode(); 4364 stubh2.GetCode();
4406 InternalArrayNArgumentsConstructorStub stubh3(isolate, kinds[i]);
4407 stubh3.GetCode();
4408 } 4365 }
4409 } 4366 }
4410 4367
4411 4368
4412 void ArrayConstructorStub::GenerateDispatchToArrayStub( 4369 void ArrayConstructorStub::GenerateDispatchToArrayStub(
4413 MacroAssembler* masm, 4370 MacroAssembler* masm,
4414 AllocationSiteOverrideMode mode) { 4371 AllocationSiteOverrideMode mode) {
4415 if (argument_count() == ANY) { 4372 if (argument_count() == ANY) {
4416 Label not_zero_case, not_one_case; 4373 Label not_zero_case, not_one_case;
4417 __ And(at, a0, a0); 4374 __ And(at, a0, a0);
4418 __ Branch(&not_zero_case, ne, at, Operand(zero_reg)); 4375 __ Branch(&not_zero_case, ne, at, Operand(zero_reg));
4419 CreateArrayDispatch<ArrayNoArgumentConstructorStub>(masm, mode); 4376 CreateArrayDispatch<ArrayNoArgumentConstructorStub>(masm, mode);
4420 4377
4421 __ bind(&not_zero_case); 4378 __ bind(&not_zero_case);
4422 __ Branch(&not_one_case, gt, a0, Operand(1)); 4379 __ Branch(&not_one_case, gt, a0, Operand(1));
4423 CreateArrayDispatchOneArgument(masm, mode); 4380 CreateArrayDispatchOneArgument(masm, mode);
4424 4381
4425 __ bind(&not_one_case); 4382 __ bind(&not_one_case);
4426 CreateArrayDispatch<ArrayNArgumentsConstructorStub>(masm, mode); 4383 ArrayNArgumentsConstructorStub stub(masm->isolate());
4384 __ TailCallStub(&stub);
4427 } else if (argument_count() == NONE) { 4385 } else if (argument_count() == NONE) {
4428 CreateArrayDispatch<ArrayNoArgumentConstructorStub>(masm, mode); 4386 CreateArrayDispatch<ArrayNoArgumentConstructorStub>(masm, mode);
4429 } else if (argument_count() == ONE) { 4387 } else if (argument_count() == ONE) {
4430 CreateArrayDispatchOneArgument(masm, mode); 4388 CreateArrayDispatchOneArgument(masm, mode);
4431 } else if (argument_count() == MORE_THAN_ONE) { 4389 } else if (argument_count() == MORE_THAN_ONE) {
4432 CreateArrayDispatch<ArrayNArgumentsConstructorStub>(masm, mode); 4390 ArrayNArgumentsConstructorStub stub(masm->isolate());
4391 __ TailCallStub(&stub);
4433 } else { 4392 } else {
4434 UNREACHABLE(); 4393 UNREACHABLE();
4435 } 4394 }
4436 } 4395 }
4437 4396
4438 4397
4439 void ArrayConstructorStub::Generate(MacroAssembler* masm) { 4398 void ArrayConstructorStub::Generate(MacroAssembler* masm) {
4440 // ----------- S t a t e ------------- 4399 // ----------- S t a t e -------------
4441 // -- a0 : argc (only if argument_count() == ANY) 4400 // -- a0 : argc (only if argument_count() == ANY)
4442 // -- a1 : constructor 4401 // -- a1 : constructor
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
4506 __ JumpToExternalReference(ExternalReference(Runtime::kNewArray, isolate())); 4465 __ JumpToExternalReference(ExternalReference(Runtime::kNewArray, isolate()));
4507 } 4466 }
4508 4467
4509 4468
4510 void InternalArrayConstructorStub::GenerateCase( 4469 void InternalArrayConstructorStub::GenerateCase(
4511 MacroAssembler* masm, ElementsKind kind) { 4470 MacroAssembler* masm, ElementsKind kind) {
4512 4471
4513 InternalArrayNoArgumentConstructorStub stub0(isolate(), kind); 4472 InternalArrayNoArgumentConstructorStub stub0(isolate(), kind);
4514 __ TailCallStub(&stub0, lo, a0, Operand(1)); 4473 __ TailCallStub(&stub0, lo, a0, Operand(1));
4515 4474
4516 InternalArrayNArgumentsConstructorStub stubN(isolate(), kind); 4475 ArrayNArgumentsConstructorStub stubN(isolate());
4517 __ TailCallStub(&stubN, hi, a0, Operand(1)); 4476 __ TailCallStub(&stubN, hi, a0, Operand(1));
4518 4477
4519 if (IsFastPackedElementsKind(kind)) { 4478 if (IsFastPackedElementsKind(kind)) {
4520 // We might need to create a holey array 4479 // We might need to create a holey array
4521 // look at the first argument. 4480 // look at the first argument.
4522 __ ld(at, MemOperand(sp, 0)); 4481 __ ld(at, MemOperand(sp, 0));
4523 4482
4524 InternalArraySingleArgumentConstructorStub 4483 InternalArraySingleArgumentConstructorStub
4525 stub1_holey(isolate(), GetHoleyElementsKind(kind)); 4484 stub1_holey(isolate(), GetHoleyElementsKind(kind));
4526 __ TailCallStub(&stub1_holey, ne, at, Operand(zero_reg)); 4485 __ TailCallStub(&stub1_holey, ne, at, Operand(zero_reg));
(...skipping 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after
5647 kStackUnwindSpace, kInvalidStackOffset, 5606 kStackUnwindSpace, kInvalidStackOffset,
5648 return_value_operand, NULL); 5607 return_value_operand, NULL);
5649 } 5608 }
5650 5609
5651 #undef __ 5610 #undef __
5652 5611
5653 } // namespace internal 5612 } // namespace internal
5654 } // namespace v8 5613 } // namespace v8
5655 5614
5656 #endif // V8_TARGET_ARCH_MIPS64 5615 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698