[test] Reduce iteration count in elements-kind test

Change-Id: I0117b0c2b646cb1005b63e9648d604b26581d977
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2335187
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69229}
diff --git a/test/mjsunit/elements-kind.js b/test/mjsunit/elements-kind.js
index d98ceda..c18ea2c 100644
--- a/test/mjsunit/elements-kind.js
+++ b/test/mjsunit/elements-kind.js
@@ -109,11 +109,16 @@
   assertKind(elements_kind.fast, you);
 
   var temp = [];
-  temp[0xDECAF] = 0;
+  // If we store beyond kMaxGap (1024) we should transition to slow elements.
+  temp[1024] = 0;
   assertKind(elements_kind.dictionary, temp);
 
   var fast_double_array = new Array(0xDECAF);
-  for (var i = 0; i < 0xDECAF; i++) fast_double_array[i] = i / 2;
+  // If the gap is greater than 1024 (kMaxGap) we would transition the array
+  // to slow. So increment should be less than 1024.
+  for (var i = 0; i < 0xDECAF; i+=1023) {
+    fast_double_array[i] = i / 2;
+  }
   assertKind(elements_kind.fast_double, fast_double_array);
 
   assertKind(elements_kind.fixed_int8,    new Int8Array(007));