diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc index c16467c6c8..d341326562 100644 --- a/src/mips/lithium-codegen-mips.cc +++ b/src/mips/lithium-codegen-mips.cc @@ -411,11 +411,7 @@ Register LCodeGen::EmitLoadRegister(LOperand* op, Register scratch) { Abort("EmitLoadRegister: Unsupported double immediate."); } else { ASSERT(r.IsTagged()); - if (literal->IsSmi()) { - __ li(scratch, Operand(literal)); - } else { - __ LoadHeapObject(scratch, Handle::cast(literal)); - } + __ LoadObject(scratch, literal); } return scratch; } else if (op->IsStackSlot() || op->IsArgument()) { @@ -1628,12 +1624,7 @@ void LCodeGen::DoConstantD(LConstantD* instr) { void LCodeGen::DoConstantT(LConstantT* instr) { Handle value = instr->value(); AllowDeferredHandleDereference smi_check; - if (value->IsSmi()) { - __ li(ToRegister(instr->result()), Operand(value)); - } else { - __ LoadHeapObject(ToRegister(instr->result()), - Handle::cast(value)); - } + __ LoadObject(ToRegister(instr->result()), value); } @@ -2886,9 +2877,9 @@ void LCodeGen::EmitLoadFieldOrConstantFunction(Register result, __ lw(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); __ lw(result, FieldMemOperand(result, offset + FixedArray::kHeaderSize)); } - } else if (lookup.IsConstantFunction()) { - Handle function(lookup.GetConstantFunctionFromMap(*type)); - __ LoadHeapObject(result, function); + } else if (lookup.IsConstant()) { + Handle constant(lookup.GetConstantFromMap(*type), isolate()); + __ LoadObject(result, constant); } else { // Negative lookup. // Check prototypes. diff --git a/src/mips/stub-cache-mips.cc b/src/mips/stub-cache-mips.cc index 89d8e68d5e..c4b1ee57a7 100644 --- a/src/mips/stub-cache-mips.cc +++ b/src/mips/stub-cache-mips.cc @@ -470,10 +470,9 @@ void BaseStoreStubCompiler::GenerateStoreTransition(MacroAssembler* masm, Representation representation = details.representation(); ASSERT(!representation.IsNone()); - if (details.type() == CONSTANT_FUNCTION) { - Handle constant( - HeapObject::cast(descriptors->GetValue(descriptor))); - __ LoadHeapObject(scratch1, constant); + if (details.type() == CONSTANT) { + Handle constant(descriptors->GetValue(descriptor), masm->isolate()); + __ LoadObject(scratch1, constant); __ Branch(miss_label, ne, value_reg, Operand(scratch1)); } else if (FLAG_track_fields && representation.IsSmi()) { __ JumpIfNotSmi(value_reg, miss_label); @@ -532,7 +531,7 @@ void BaseStoreStubCompiler::GenerateStoreTransition(MacroAssembler* masm, OMIT_REMEMBERED_SET, OMIT_SMI_CHECK); - if (details.type() == CONSTANT_FUNCTION) { + if (details.type() == CONSTANT) { ASSERT(value_reg.is(a0)); __ Ret(USE_DELAY_SLOT); __ mov(v0, a0); @@ -1404,9 +1403,9 @@ void BaseLoadStubCompiler::GenerateLoadField(Register reg, } -void BaseLoadStubCompiler::GenerateLoadConstant(Handle value) { +void BaseLoadStubCompiler::GenerateLoadConstant(Handle value) { // Return the constant value. - __ LoadHeapObject(v0, value); + __ LoadObject(v0, value); __ Ret(); } @@ -2709,7 +2708,7 @@ Handle CallStubCompiler::CompileCallConstant( Handle code = CompileCustomCall(object, holder, Handle::null(), function, Handle::cast(name), - Code::CONSTANT_FUNCTION); + Code::CONSTANT); // A null handle means bail out to the regular compiler code below. if (!code.is_null()) return code; }