| Index: src/mips/lithium-codegen-mips.cc
|
| diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc
|
| index e790798f77e18c6a579b4833c7e6d30c4659787e..eb1b17b6d26b1685b245f02c9f850f353225d0d7 100644
|
| --- a/src/mips/lithium-codegen-mips.cc
|
| +++ b/src/mips/lithium-codegen-mips.cc
|
| @@ -4241,18 +4241,30 @@ void LCodeGen::DoArrayLiteral(LArrayLiteral* instr) {
|
|
|
| void LCodeGen::DoObjectLiteral(LObjectLiteral* instr) {
|
| ASSERT(ToRegister(instr->result()).is(v0));
|
| +
|
| + Handle<FixedArray> constant_properties =
|
| + instr->hydrogen()->constant_properties();
|
| +
|
| __ lw(t0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
|
| __ lw(t0, FieldMemOperand(t0, JSFunction::kLiteralsOffset));
|
| __ li(a3, Operand(Smi::FromInt(instr->hydrogen()->literal_index())));
|
| - __ li(a2, Operand(instr->hydrogen()->constant_properties()));
|
| - __ li(a1, Operand(Smi::FromInt(instr->hydrogen()->fast_elements() ? 1 : 0)));
|
| + __ li(a2, Operand(constant_properties));
|
| + int flags = instr->hydrogen()->fast_elements()
|
| + ? ObjectLiteral::kFastElements
|
| + : ObjectLiteral::kNoFlags;
|
| + __ li(a1, Operand(Smi::FromInt(flags)));
|
| __ Push(t0, a3, a2, a1);
|
|
|
| // Pick the right runtime function to call.
|
| + int properties_count = constant_properties->length() / 2;
|
| if (instr->hydrogen()->depth() > 1) {
|
| CallRuntime(Runtime::kCreateObjectLiteral, 4, instr);
|
| - } else {
|
| + } else if (flags != ObjectLiteral::kFastElements ||
|
| + properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) {
|
| CallRuntime(Runtime::kCreateObjectLiteralShallow, 4, instr);
|
| + } else {
|
| + FastCloneShallowObjectStub stub(properties_count);
|
| + CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
|
| }
|
| }
|
|
|
|
|