| Index: src/mips/code-stubs-mips.cc
|
| diff --git a/src/mips/code-stubs-mips.cc b/src/mips/code-stubs-mips.cc
|
| index f053c7942cb4acef733139aac2f8246ee9b54360..47afeb4330a4c8a2514501be78d3e3c8efdaa04f 100644
|
| --- a/src/mips/code-stubs-mips.cc
|
| +++ b/src/mips/code-stubs-mips.cc
|
| @@ -114,6 +114,17 @@ void KeyedLoadFastElementStub::InitializeInterfaceDescriptor(
|
| }
|
|
|
|
|
| +void KeyedLoadDictionaryElementStub::InitializeInterfaceDescriptor(
|
| + Isolate* isolate,
|
| + CodeStubInterfaceDescriptor* descriptor) {
|
| + static Register registers[] = {a1, a0 };
|
| + descriptor->register_param_count_ = 2;
|
| + descriptor->register_params_ = registers;
|
| + descriptor->deoptimization_handler_ =
|
| + FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure);
|
| +}
|
| +
|
| +
|
| void LoadFieldStub::InitializeInterfaceDescriptor(
|
| Isolate* isolate,
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| @@ -134,6 +145,19 @@ void KeyedLoadFieldStub::InitializeInterfaceDescriptor(
|
| }
|
|
|
|
|
| +void KeyedArrayCallStub::InitializeInterfaceDescriptor(
|
| + Isolate* isolate,
|
| + CodeStubInterfaceDescriptor* descriptor) {
|
| + static Register registers[] = { a2 };
|
| + descriptor->register_param_count_ = 1;
|
| + descriptor->register_params_ = registers;
|
| + descriptor->continuation_type_ = TAIL_CALL_CONTINUATION;
|
| + descriptor->handler_arguments_mode_ = PASS_ARGUMENTS;
|
| + descriptor->deoptimization_handler_ =
|
| + FUNCTION_ADDR(KeyedCallIC_MissFromStubFailure);
|
| +}
|
| +
|
| +
|
| void KeyedStoreFastElementStub::InitializeInterfaceDescriptor(
|
| Isolate* isolate,
|
| CodeStubInterfaceDescriptor* descriptor) {
|
| @@ -178,14 +202,21 @@ static void InitializeArrayConstructorDescriptor(
|
| // a0 -- number of arguments
|
| // a1 -- function
|
| // a2 -- type info cell with elements kind
|
| - static Register registers[] = { a1, a2 };
|
| - descriptor->register_param_count_ = 2;
|
| - if (constant_stack_parameter_count != 0) {
|
| + static Register registers_variable_args[] = { a1, a2, a0 };
|
| + static Register registers_no_args[] = { a1, a2 };
|
| +
|
| + if (constant_stack_parameter_count == 0) {
|
| + descriptor->register_param_count_ = 2;
|
| + descriptor->register_params_ = registers_no_args;
|
| + } else {
|
| // stack param count needs (constructor pointer, and single argument)
|
| + descriptor->handler_arguments_mode_ = PASS_ARGUMENTS;
|
| descriptor->stack_parameter_count_ = a0;
|
| + descriptor->register_param_count_ = 3;
|
| + descriptor->register_params_ = registers_variable_args;
|
| }
|
| +
|
| descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
|
| - descriptor->register_params_ = registers;
|
| descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
|
| descriptor->deoptimization_handler_ =
|
| Runtime::FunctionForId(Runtime::kArrayConstructor)->entry;
|
| @@ -199,15 +230,21 @@ static void InitializeInternalArrayConstructorDescriptor(
|
| // register state
|
| // a0 -- number of arguments
|
| // a1 -- constructor function
|
| - static Register registers[] = { a1 };
|
| - descriptor->register_param_count_ = 1;
|
| + static Register registers_variable_args[] = { a1, a0 };
|
| + static Register registers_no_args[] = { a1 };
|
|
|
| - if (constant_stack_parameter_count != 0) {
|
| - // Stack param count needs (constructor pointer, and single argument).
|
| + if (constant_stack_parameter_count == 0) {
|
| + descriptor->register_param_count_ = 1;
|
| + descriptor->register_params_ = registers_no_args;
|
| + } else {
|
| + // stack param count needs (constructor pointer, and single argument)
|
| + descriptor->handler_arguments_mode_ = PASS_ARGUMENTS;
|
| descriptor->stack_parameter_count_ = a0;
|
| + descriptor->register_param_count_ = 2;
|
| + descriptor->register_params_ = registers_variable_args;
|
| }
|
| +
|
| descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
|
| - descriptor->register_params_ = registers;
|
| descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
|
| descriptor->deoptimization_handler_ =
|
| Runtime::FunctionForId(Runtime::kInternalArrayConstructor)->entry;
|
| @@ -2932,7 +2969,7 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
|
| // Check that the RegExp has been compiled (data contains a fixed array).
|
| __ lw(regexp_data, FieldMemOperand(a0, JSRegExp::kDataOffset));
|
| if (FLAG_debug_code) {
|
| - __ And(t0, regexp_data, Operand(kSmiTagMask));
|
| + __ SmiTst(regexp_data, t0);
|
| __ Check(nz,
|
| kUnexpectedTypeForRegExpDataFixedArrayExpected,
|
| t0,
|
| @@ -5841,6 +5878,24 @@ void StubFailureTrampolineStub::Generate(MacroAssembler* masm) {
|
| }
|
|
|
|
|
| +void StubFailureTailCallTrampolineStub::Generate(MacroAssembler* masm) {
|
| + CEntryStub ces(1, fp_registers_ ? kSaveFPRegs : kDontSaveFPRegs);
|
| + __ Call(ces.GetCode(masm->isolate()), RelocInfo::CODE_TARGET);
|
| + __ mov(a1, v0);
|
| + int parameter_count_offset =
|
| + StubFailureTrampolineFrame::kCallerStackParameterCountFrameOffset;
|
| + __ lw(a0, MemOperand(fp, parameter_count_offset));
|
| + // The parameter count above includes the receiver for the arguments passed to
|
| + // the deoptimization handler. Subtract the receiver for the parameter count
|
| + // for the call.
|
| + __ Subu(a0, a0, 1);
|
| + masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE);
|
| + ParameterCount argument_count(a0);
|
| + __ InvokeFunction(
|
| + a1, argument_count, JUMP_FUNCTION, NullCallWrapper(), CALL_AS_METHOD);
|
| +}
|
| +
|
| +
|
| void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) {
|
| if (masm->isolate()->function_entry_hook() != NULL) {
|
| AllowStubCallsScope allow_stub_calls(masm, true);
|
| @@ -5992,11 +6047,14 @@ static void CreateArrayDispatchOneArgument(MacroAssembler* masm,
|
| __ lw(t1, FieldMemOperand(a2, Cell::kValueOffset));
|
| }
|
|
|
| - // Save the resulting elements kind in type info
|
| - __ SmiTag(a3);
|
| - __ lw(t1, FieldMemOperand(a2, Cell::kValueOffset));
|
| - __ sw(a3, FieldMemOperand(t1, AllocationSite::kTransitionInfoOffset));
|
| - __ SmiUntag(a3);
|
| + // Save the resulting elements kind in type info. We can't just store a3
|
| + // in the AllocationSite::transition_info field because elements kind is
|
| + // restricted to a portion of the field...upper bits need to be left alone.
|
| + STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0);
|
| + __ lw(t0, FieldMemOperand(t1, AllocationSite::kTransitionInfoOffset));
|
| + __ Addu(t0, t0, Operand(Smi::FromInt(kFastElementsKindPackedToHoley)));
|
| + __ sw(t0, FieldMemOperand(t1, AllocationSite::kTransitionInfoOffset));
|
| +
|
|
|
| __ bind(&normal_sequence);
|
| int last_index = GetSequenceIndexFromFastElementsKind(
|
| @@ -6106,7 +6164,7 @@ void ArrayConstructorStub::Generate(MacroAssembler* masm) {
|
| // Initial map for the builtin Array function should be a map.
|
| __ lw(a3, FieldMemOperand(a1, JSFunction::kPrototypeOrInitialMapOffset));
|
| // Will both indicate a NULL and a Smi.
|
| - __ And(at, a3, Operand(kSmiTagMask));
|
| + __ SmiTst(a3, at);
|
| __ Assert(ne, kUnexpectedInitialMapForArrayFunction,
|
| at, Operand(zero_reg));
|
| __ GetObjectType(a3, a3, t0);
|
| @@ -6138,6 +6196,8 @@ void ArrayConstructorStub::Generate(MacroAssembler* masm) {
|
|
|
| __ lw(a3, FieldMemOperand(a3, AllocationSite::kTransitionInfoOffset));
|
| __ SmiUntag(a3);
|
| + STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0);
|
| + __ And(a3, a3, Operand(AllocationSite::ElementsKindBits::kMask));
|
| GenerateDispatchToArrayStub(masm, DONT_OVERRIDE);
|
|
|
| __ bind(&no_info);
|
| @@ -6193,7 +6253,7 @@ void InternalArrayConstructorStub::Generate(MacroAssembler* masm) {
|
| // Initial map for the builtin Array function should be a map.
|
| __ lw(a3, FieldMemOperand(a1, JSFunction::kPrototypeOrInitialMapOffset));
|
| // Will both indicate a NULL and a Smi.
|
| - __ And(at, a3, Operand(kSmiTagMask));
|
| + __ SmiTst(a3, at);
|
| __ Assert(ne, kUnexpectedInitialMapForArrayFunction,
|
| at, Operand(zero_reg));
|
| __ GetObjectType(a3, a3, t0);
|
|
|