Index: src/arm64/code-stubs-arm64.cc |
diff --git a/src/arm64/code-stubs-arm64.cc b/src/arm64/code-stubs-arm64.cc |
index bdcd08aefe3fd26302c35529c0ce650e45b9a33e..6583775a6601bfd87b1570d7991ffad921d6b1b0 100644 |
--- a/src/arm64/code-stubs-arm64.cc |
+++ b/src/arm64/code-stubs-arm64.cc |
@@ -3833,6 +3833,22 @@ void SubStringStub::Generate(MacroAssembler* masm) { |
} |
+void ToNumberStub::Generate(MacroAssembler* masm) { |
+ // The ToNumber stub takes one argument in x0. |
+ Label check_heap_number, call_builtin; |
+ __ JumpIfNotSmi(x0, &check_heap_number); |
+ __ Ret(); |
+ |
+ __ bind(&check_heap_number); |
+ __ JumpIfNotHeapNumber(x0, &call_builtin); |
+ __ Ret(); |
+ |
+ __ bind(&call_builtin); |
+ __ push(x0); |
+ __ InvokeBuiltin(Builtins::TO_NUMBER, JUMP_FUNCTION); |
+} |
+ |
+ |
void StringHelper::GenerateFlatOneByteStringEquals( |
MacroAssembler* masm, Register left, Register right, Register scratch1, |
Register scratch2, Register scratch3) { |