Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Unified Diff: src/builtins/builtins-conversion-gen.cc

Issue 2874423003: [csa] Add ToLength and ToString variants with inlined fast checks (Closed)
Patch Set: ToString Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/builtins/builtins-array-gen.cc ('k') | src/builtins/builtins-regexp-gen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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), &not_string);
- Return(input);
-
- Label not_heap_number(this);
-
- BIND(&not_string);
- { Branch(IsHeapNumberMap(input_map), &is_number, &not_heap_number); }
-
- BIND(&is_number);
- { Return(NumberToString(context, input)); }
-
- BIND(&not_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 )
« no previous file with comments | « src/builtins/builtins-array-gen.cc ('k') | src/builtins/builtins-regexp-gen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698