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

Unified Diff: src/builtins/builtins-array.cc

Issue 2395453002: [stubs] Add String and JSReceiver instance type predicates (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | src/builtins/builtins-conversion.cc » ('j') | src/code-stub-assembler.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/builtins-array.cc
diff --git a/src/builtins/builtins-array.cc b/src/builtins/builtins-array.cc
index ba9db3523323eab8814204c6bf27f1d1db7b68fe..b4969f1e575b2003f6b94a9c353011bfa0f8dfe0 100644
--- a/src/builtins/builtins-array.cc
+++ b/src/builtins/builtins-array.cc
@@ -1410,10 +1410,8 @@ void Builtins::Generate_ArrayIncludes(CodeStubAssembler* assembler) {
assembler->Bind(&not_heap_num);
Node* search_type = assembler->LoadMapInstanceType(map);
- assembler->GotoIf(
- assembler->Int32LessThan(
- search_type, assembler->Int32Constant(FIRST_NONSTRING_TYPE)),
- &string_loop);
+ assembler->GotoIf(assembler->IsStringInstanceType(search_type),
+ &string_loop);
assembler->GotoIf(
assembler->Word32Equal(search_type,
assembler->Int32Constant(SIMD128_VALUE_TYPE)),
@@ -1517,9 +1515,8 @@ void Builtins::Generate_ArrayIncludes(CodeStubAssembler* assembler) {
Node* element_k = assembler->LoadFixedArrayElement(
elements, index_var.value(), 0, CodeStubAssembler::INTPTR_PARAMETERS);
assembler->GotoIf(assembler->WordIsSmi(element_k), &continue_loop);
- assembler->GotoUnless(assembler->Int32LessThan(
- assembler->LoadInstanceType(element_k),
- assembler->Int32Constant(FIRST_NONSTRING_TYPE)),
+ assembler->GotoUnless(assembler->IsStringInstanceType(
+ assembler->LoadInstanceType(element_k)),
&continue_loop);
// TODO(bmeurer): Consider inlining the StringEqual logic here.
@@ -1855,10 +1852,8 @@ void Builtins::Generate_ArrayIndexOf(CodeStubAssembler* assembler) {
assembler->Bind(&not_heap_num);
Node* search_type = assembler->LoadMapInstanceType(map);
- assembler->GotoIf(
- assembler->Int32LessThan(
- search_type, assembler->Int32Constant(FIRST_NONSTRING_TYPE)),
- &string_loop);
+ assembler->GotoIf(assembler->IsStringInstanceType(search_type),
+ &string_loop);
assembler->GotoIf(
assembler->Word32Equal(search_type,
assembler->Int32Constant(SIMD128_VALUE_TYPE)),
@@ -1937,9 +1932,8 @@ void Builtins::Generate_ArrayIndexOf(CodeStubAssembler* assembler) {
Node* element_k = assembler->LoadFixedArrayElement(
elements, index_var.value(), 0, CodeStubAssembler::INTPTR_PARAMETERS);
assembler->GotoIf(assembler->WordIsSmi(element_k), &continue_loop);
- assembler->GotoUnless(assembler->Int32LessThan(
- assembler->LoadInstanceType(element_k),
- assembler->Int32Constant(FIRST_NONSTRING_TYPE)),
+ assembler->GotoUnless(assembler->IsStringInstanceType(
+ assembler->LoadInstanceType(element_k)),
&continue_loop);
// TODO(bmeurer): Consider inlining the StringEqual logic here.
« no previous file with comments | « no previous file | src/builtins/builtins-conversion.cc » ('j') | src/code-stub-assembler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698