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

Side by Side Diff: src/builtins/builtins-array.cc

Issue 2207903002: [builtins] fix mapcheck in Array.includes fast-case when searching for String (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | test/mjsunit/es7/regress/regress-633883.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/builtins/builtins.h" 5 #include "src/builtins/builtins.h"
6 #include "src/builtins/builtins-utils.h" 6 #include "src/builtins/builtins-utils.h"
7 7
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/elements.h" 9 #include "src/elements.h"
10 10
(...skipping 1499 matching lines...) Expand 10 before | Expand all | Expand 10 after
1510 assembler->Bind(&string_loop); 1510 assembler->Bind(&string_loop);
1511 { 1511 {
1512 Label continue_loop(assembler); 1512 Label continue_loop(assembler);
1513 assembler->GotoUnless( 1513 assembler->GotoUnless(
1514 assembler->Int32LessThan(index_var.value(), len_var.value()), 1514 assembler->Int32LessThan(index_var.value(), len_var.value()),
1515 &return_false); 1515 &return_false);
1516 Node* element_k = 1516 Node* element_k =
1517 assembler->LoadFixedArrayElement(elements, index_var.value()); 1517 assembler->LoadFixedArrayElement(elements, index_var.value());
1518 assembler->GotoIf(assembler->WordIsSmi(element_k), &continue_loop); 1518 assembler->GotoIf(assembler->WordIsSmi(element_k), &continue_loop);
1519 assembler->GotoUnless(assembler->Int32LessThan( 1519 assembler->GotoUnless(assembler->Int32LessThan(
1520 assembler->LoadMapInstanceType(element_k), 1520 assembler->LoadInstanceType(element_k),
1521 assembler->Int32Constant(FIRST_NONSTRING_TYPE)), 1521 assembler->Int32Constant(FIRST_NONSTRING_TYPE)),
1522 &continue_loop); 1522 &continue_loop);
1523 1523
1524 // TODO(bmeurer): Consider inlining the StringEqual logic here. 1524 // TODO(bmeurer): Consider inlining the StringEqual logic here.
1525 Callable callable = CodeFactory::StringEqual(assembler->isolate()); 1525 Callable callable = CodeFactory::StringEqual(assembler->isolate());
1526 Node* result = 1526 Node* result =
1527 assembler->CallStub(callable, context, search_element, element_k); 1527 assembler->CallStub(callable, context, search_element, element_k);
1528 assembler->Branch( 1528 assembler->Branch(
1529 assembler->WordEqual(assembler->BooleanConstant(true), result), 1529 assembler->WordEqual(assembler->BooleanConstant(true), result),
1530 &return_true, &continue_loop); 1530 &return_true, &continue_loop);
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
1734 assembler->Return(assembler->BooleanConstant(false)); 1734 assembler->Return(assembler->BooleanConstant(false));
1735 1735
1736 assembler->Bind(&call_runtime); 1736 assembler->Bind(&call_runtime);
1737 assembler->Return(assembler->CallRuntime(Runtime::kArrayIncludes_Slow, 1737 assembler->Return(assembler->CallRuntime(Runtime::kArrayIncludes_Slow,
1738 context, array, search_element, 1738 context, array, search_element,
1739 start_from)); 1739 start_from));
1740 } 1740 }
1741 1741
1742 } // namespace internal 1742 } // namespace internal
1743 } // namespace v8 1743 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/es7/regress/regress-633883.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698