Index: src/mips64/code-stubs-mips64.cc |
diff --git a/src/mips64/code-stubs-mips64.cc b/src/mips64/code-stubs-mips64.cc |
index 117d5c899dd8570b3395fe3412d996e6f9922559..7887f4722193296697c892bb7bb150ed83a13c65 100644 |
--- a/src/mips64/code-stubs-mips64.cc |
+++ b/src/mips64/code-stubs-mips64.cc |
@@ -20,45 +20,18 @@ |
namespace v8 { |
namespace internal { |
+#define __ ACCESS_MASM(masm) |
-static void InitializeArrayConstructorDescriptor( |
- Isolate* isolate, CodeStubDescriptor* descriptor, |
- int constant_stack_parameter_count) { |
- Address deopt_handler = Runtime::FunctionForId( |
- Runtime::kArrayConstructor)->entry; |
- |
- if (constant_stack_parameter_count == 0) { |
- descriptor->Initialize(deopt_handler, constant_stack_parameter_count, |
- JS_FUNCTION_STUB_MODE); |
- } else { |
- descriptor->Initialize(a0, deopt_handler, constant_stack_parameter_count, |
- JS_FUNCTION_STUB_MODE); |
- } |
-} |
- |
- |
-static void InitializeInternalArrayConstructorDescriptor( |
- Isolate* isolate, CodeStubDescriptor* descriptor, |
- int constant_stack_parameter_count) { |
- Address deopt_handler = Runtime::FunctionForId( |
- Runtime::kInternalArrayConstructor)->entry; |
- |
- if (constant_stack_parameter_count == 0) { |
- descriptor->Initialize(deopt_handler, constant_stack_parameter_count, |
- JS_FUNCTION_STUB_MODE); |
- } else { |
- descriptor->Initialize(a0, deopt_handler, constant_stack_parameter_count, |
- JS_FUNCTION_STUB_MODE); |
- } |
-} |
- |
- |
-void ArrayNArgumentsConstructorStub::InitializeDescriptor( |
- CodeStubDescriptor* descriptor) { |
- InitializeArrayConstructorDescriptor(isolate(), descriptor, -1); |
+void ArrayNArgumentsConstructorStub::Generate(MacroAssembler* masm) { |
+ __ dsll(t9, a0, kPointerSizeLog2); |
+ __ Daddu(t9, sp, t9); |
+ __ sw(a1, MemOperand(t9, 0)); |
+ __ Push(a1); |
+ __ Push(a2); |
+ __ Daddu(a0, a0, 3); |
+ __ TailCallRuntime(Runtime::kNewArray); |
} |
- |
void FastArrayPushStub::InitializeDescriptor(CodeStubDescriptor* descriptor) { |
Address deopt_handler = Runtime::FunctionForId(Runtime::kArrayPush)->entry; |
descriptor->Initialize(a0, deopt_handler, -1, JS_FUNCTION_STUB_MODE); |
@@ -70,14 +43,6 @@ void FastFunctionBindStub::InitializeDescriptor( |
descriptor->Initialize(a0, deopt_handler, -1, JS_FUNCTION_STUB_MODE); |
} |
-void InternalArrayNArgumentsConstructorStub::InitializeDescriptor( |
- CodeStubDescriptor* descriptor) { |
- InitializeInternalArrayConstructorDescriptor(isolate(), descriptor, -1); |
-} |
- |
- |
-#define __ ACCESS_MASM(masm) |
- |
static void EmitIdenticalObjectComparison(MacroAssembler* masm, Label* slow, |
Condition cc); |
static void EmitSmiNonsmiComparison(MacroAssembler* masm, |
@@ -1013,7 +978,7 @@ void CodeStub::GenerateStubsAheadOfTime(Isolate* isolate) { |
CEntryStub::GenerateAheadOfTime(isolate); |
StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(isolate); |
StubFailureTrampolineStub::GenerateAheadOfTime(isolate); |
- ArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); |
+ CommonArrayConstructorStub::GenerateStubsAheadOfTime(isolate); |
CreateAllocationSiteStub::GenerateAheadOfTime(isolate); |
CreateWeakCellStub::GenerateAheadOfTime(isolate); |
BinaryOpICStub::GenerateAheadOfTime(isolate); |
@@ -4383,19 +4348,13 @@ static void ArrayConstructorStubAheadOfTimeHelper(Isolate* isolate) { |
} |
} |
- |
-void ArrayConstructorStubBase::GenerateStubsAheadOfTime(Isolate* isolate) { |
+void CommonArrayConstructorStub::GenerateStubsAheadOfTime(Isolate* isolate) { |
ArrayConstructorStubAheadOfTimeHelper<ArrayNoArgumentConstructorStub>( |
isolate); |
ArrayConstructorStubAheadOfTimeHelper<ArraySingleArgumentConstructorStub>( |
isolate); |
- ArrayConstructorStubAheadOfTimeHelper<ArrayNArgumentsConstructorStub>( |
- isolate); |
-} |
- |
- |
-void InternalArrayConstructorStubBase::GenerateStubsAheadOfTime( |
- Isolate* isolate) { |
+ ArrayNArgumentsConstructorStub stub(isolate); |
+ stub.GetCode(); |
ElementsKind kinds[2] = { FAST_ELEMENTS, FAST_HOLEY_ELEMENTS }; |
for (int i = 0; i < 2; i++) { |
// For internal arrays we only need a few things. |
@@ -4403,8 +4362,6 @@ void InternalArrayConstructorStubBase::GenerateStubsAheadOfTime( |
stubh1.GetCode(); |
InternalArraySingleArgumentConstructorStub stubh2(isolate, kinds[i]); |
stubh2.GetCode(); |
- InternalArrayNArgumentsConstructorStub stubh3(isolate, kinds[i]); |
- stubh3.GetCode(); |
} |
} |
@@ -4423,13 +4380,15 @@ void ArrayConstructorStub::GenerateDispatchToArrayStub( |
CreateArrayDispatchOneArgument(masm, mode); |
__ bind(¬_one_case); |
- CreateArrayDispatch<ArrayNArgumentsConstructorStub>(masm, mode); |
+ ArrayNArgumentsConstructorStub stub(masm->isolate()); |
+ __ TailCallStub(&stub); |
} else if (argument_count() == NONE) { |
CreateArrayDispatch<ArrayNoArgumentConstructorStub>(masm, mode); |
} else if (argument_count() == ONE) { |
CreateArrayDispatchOneArgument(masm, mode); |
} else if (argument_count() == MORE_THAN_ONE) { |
- CreateArrayDispatch<ArrayNArgumentsConstructorStub>(masm, mode); |
+ ArrayNArgumentsConstructorStub stub(masm->isolate()); |
+ __ TailCallStub(&stub); |
} else { |
UNREACHABLE(); |
} |
@@ -4513,7 +4472,7 @@ void InternalArrayConstructorStub::GenerateCase( |
InternalArrayNoArgumentConstructorStub stub0(isolate(), kind); |
__ TailCallStub(&stub0, lo, a0, Operand(1)); |
- InternalArrayNArgumentsConstructorStub stubN(isolate(), kind); |
+ ArrayNArgumentsConstructorStub stubN(isolate()); |
__ TailCallStub(&stubN, hi, a0, Operand(1)); |
if (IsFastPackedElementsKind(kind)) { |