Index: src/arm/lithium-codegen-arm.cc |
diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc |
index 667646474a9f9e4fff164d2703aa56e9dee3e9c9..2372f784e591218c7926ce3c9d7023716165e8de 100644 |
--- a/src/arm/lithium-codegen-arm.cc |
+++ b/src/arm/lithium-codegen-arm.cc |
@@ -5534,9 +5534,17 @@ void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { |
void LCodeGen::DoTypeof(LTypeof* instr) { |
- Register input = ToRegister(instr->value()); |
- __ push(input); |
- CallRuntime(Runtime::kTypeof, 1, instr); |
+ DCHECK(ToRegister(instr->value()).is(r3)); |
+ DCHECK(ToRegister(instr->result()).is(r0)); |
+ Label end, do_call; |
+ Register value_register = ToRegister(instr->value()); |
+ __ JumpIfNotSmi(value_register, &do_call); |
+ __ mov(r0, Operand(isolate()->factory()->number_string())); |
+ __ jmp(&end); |
+ __ bind(&do_call); |
+ TypeofStub stub(isolate()); |
+ CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
+ __ bind(&end); |
} |