Index: src/builtins/builtins-conversion-gen.cc |
diff --git a/src/builtins/builtins-conversion-gen.cc b/src/builtins/builtins-conversion-gen.cc |
index 21d59346b54a9d862ab77eaa74af088c616ce61f..5fe2cb03bd3d9c95501cef7145e753afc9e47ec1 100644 |
--- a/src/builtins/builtins-conversion-gen.cc |
+++ b/src/builtins/builtins-conversion-gen.cc |
@@ -133,35 +133,7 @@ TF_BUILTIN(ToString, CodeStubAssembler) { |
Node* context = Parameter(Descriptor::kContext); |
Node* input = Parameter(Descriptor::kArgument); |
- Label is_number(this); |
- Label runtime(this); |
- |
- GotoIf(TaggedIsSmi(input), &is_number); |
- |
- Node* input_map = LoadMap(input); |
- Node* input_instance_type = LoadMapInstanceType(input_map); |
- |
- Label not_string(this); |
- GotoIfNot(IsStringInstanceType(input_instance_type), ¬_string); |
- Return(input); |
- |
- Label not_heap_number(this); |
- |
- BIND(¬_string); |
- { Branch(IsHeapNumberMap(input_map), &is_number, ¬_heap_number); } |
- |
- BIND(&is_number); |
- { Return(NumberToString(context, input)); } |
- |
- BIND(¬_heap_number); |
- { |
- GotoIf(Word32NotEqual(input_instance_type, Int32Constant(ODDBALL_TYPE)), |
- &runtime); |
- Return(LoadObjectField(input, Oddball::kToStringOffset)); |
- } |
- |
- BIND(&runtime); |
- { Return(CallRuntime(Runtime::kToString, context, input)); } |
+ Return(ToString(context, input)); |
} |
// 7.1.1.1 OrdinaryToPrimitive ( O, hint ) |