diff --git a/src/mips/assembler-mips.cc b/src/mips/assembler-mips.cc index a04d456ae9..fcf49f110d 100644 --- a/src/mips/assembler-mips.cc +++ b/src/mips/assembler-mips.cc @@ -1347,7 +1347,7 @@ void Assembler::rotrv(Register rd, Register rt, Register rs) { // Helper for base-reg + offset, when offset is larger than int16. void Assembler::LoadRegPlusOffsetToAt(const MemOperand& src) { ASSERT(!src.rm().is(at)); - lui(at, src.offset_ >> kLuiShift); + lui(at, (src.offset_ >> kLuiShift) & kImm16Mask); ori(at, at, src.offset_ & kImm16Mask); // Load 32-bit offset. addu(at, at, src.rm()); // Add base register. } diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc index d46998ffd2..ba954017a7 100644 --- a/src/mips/lithium-codegen-mips.cc +++ b/src/mips/lithium-codegen-mips.cc @@ -407,6 +407,9 @@ Register LCodeGen::EmitLoadRegister(LOperand* op, Register scratch) { if (r.IsInteger32()) { ASSERT(literal->IsNumber()); __ li(scratch, Operand(static_cast(literal->Number()))); + } else if (r.IsSmi()) { + ASSERT(constant->HasSmiValue()); + __ li(scratch, Operand(Smi::FromInt(constant->Integer32Value()))); } else if (r.IsDouble()) { Abort("EmitLoadRegister: Unsupported double immediate."); } else {