Index: src/mips/lithium-codegen-mips.cc |
diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc |
index 09026cdfc8a1fd82896cab7033eb0044897cc8ab..b173e30a2bc6075fa376b8182fd6aaac71c4d555 100644 |
--- a/src/mips/lithium-codegen-mips.cc |
+++ b/src/mips/lithium-codegen-mips.cc |
@@ -5565,10 +5565,17 @@ void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { |
void LCodeGen::DoTypeof(LTypeof* instr) { |
+ DCHECK(ToRegister(instr->value()).is(a3)); |
DCHECK(ToRegister(instr->result()).is(v0)); |
- Register input = ToRegister(instr->value()); |
- __ push(input); |
- CallRuntime(Runtime::kTypeof, 1, instr); |
+ Label end, do_call; |
+ Register value_register = ToRegister(instr->value()); |
+ __ JumpIfNotSmi(value_register, &do_call); |
+ __ li(v0, Operand(isolate()->factory()->number_string())); |
+ __ jmp(&end); |
+ __ bind(&do_call); |
+ TypeofStub stub(isolate()); |
+ CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
+ __ bind(&end); |
} |