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

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

Issue 2714173002: Remove SMI length check from Builtins::Generate_ArrayIndexOf (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..137fa4d9dd674c5e4cff0dba6e3b39798b629fe2 100644
--- a/src/builtins/builtins-array.cc
+++ b/src/builtins/builtins-array.cc
@@ -2021,11 +2021,13 @@ void Builtins::Generate_ArrayIndexOf(compiler::CodeAssemblerState* state) {
assembler.Bind(&init_len);
{
- // Handle case where JSArray length is not an Smi in the runtime
- Node* len = assembler.LoadObjectField(array, JSArray::kLengthOffset);
- assembler.GotoIfNot(assembler.TaggedIsSmi(len), &call_runtime);
+ // JSArray length is always an Smi for fast arrays.
+ CSA_ASSERT(&assembler, assembler.TaggedIsSmi(assembler.LoadObjectField(
+ array, JSArray::kLengthOffset)));
+ Node* len =
+ assembler.LoadAndUntagObjectField(array, JSArray::kLengthOffset);
- len_var.Bind(assembler.SmiToWord(len));
+ len_var.Bind(len);
assembler.Branch(assembler.WordEqual(len_var.value(), intptr_zero),
&return_not_found, &init_k);
}
« 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