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

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

Issue 2714193002: Remove SMI length check from TF_BUILTIN(ArrayIncludes, CodeStubAssembler) (Closed)
Patch Set: No 'ToWord32' Created 3 years, 10 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 | no next file » | no next file with comments »
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 e8ee8640c665b16a380fb3f3a2c65eabca1c8929..7b4e7f540c635393dfb1f75e674b7956c17ca1f8 100644
--- a/src/builtins/builtins-array.cc
+++ b/src/builtins/builtins-array.cc
@@ -1702,11 +1702,12 @@ TF_BUILTIN(ArrayIncludes, CodeStubAssembler) {
Bind(&init_len);
{
- // Handle case where JSArray length is not an Smi in the runtime
- Node* len = LoadObjectField(array, JSArray::kLengthOffset);
- GotoIfNot(TaggedIsSmi(len), &call_runtime);
+ // JSArray length is always an Smi for fast arrays.
+ CSA_ASSERT(this,
+ TaggedIsSmi(LoadObjectField(array, JSArray::kLengthOffset)));
+ Node* len = LoadAndUntagObjectField(array, JSArray::kLengthOffset);
- len_var.Bind(SmiToWord(len));
+ len_var.Bind(len);
caitp 2017/02/25 18:03:06 Do we still need `len_var`? It never changes at an
vabr (Chromium) 2017/02/25 18:35:48 So that I learn more: (1) Changing would mean that
caitp 2017/02/25 18:40:12 There's another Bind() call before this line, but
GotoIf(IsUndefined(start_from), &select_loop);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698