summaryrefslogtreecommitdiff
path: root/deps/v8/test/mjsunit/array-bounds-check-removal.js
diff options
context:
space:
mode:
authorFedor Indutny <fedor.indutny@gmail.com>2013-01-04 15:44:47 +0400
committerFedor Indutny <fedor.indutny@gmail.com>2013-01-04 15:44:47 +0400
commit0054264d884394b06cedf4885d3a0e7c90c34c64 (patch)
treeee9792417fda785b5bff9dfbde2fa4a0dd60aabd /deps/v8/test/mjsunit/array-bounds-check-removal.js
parent0459a230631f6ff44f63d46396c474c13e6c232c (diff)
downloadandroid-node-v8-0054264d884394b06cedf4885d3a0e7c90c34c64.tar.gz
android-node-v8-0054264d884394b06cedf4885d3a0e7c90c34c64.tar.bz2
android-node-v8-0054264d884394b06cedf4885d3a0e7c90c34c64.zip
v8: update to 3.15.11.5
Diffstat (limited to 'deps/v8/test/mjsunit/array-bounds-check-removal.js')
-rw-r--r--deps/v8/test/mjsunit/array-bounds-check-removal.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/deps/v8/test/mjsunit/array-bounds-check-removal.js b/deps/v8/test/mjsunit/array-bounds-check-removal.js
index df7988bdaa..7a7cb304de 100644
--- a/deps/v8/test/mjsunit/array-bounds-check-removal.js
+++ b/deps/v8/test/mjsunit/array-bounds-check-removal.js
@@ -178,5 +178,29 @@ short_test(a, 0);
assertTrue(%GetOptimizationStatus(short_test) != 1);
+// A test for when we would modify a phi index.
+var data_phi = [0, 1, 2, 3, 4, 5, 6, 7, 8];
+function test_phi(a, base, check) {
+ var index;
+ if (check) {
+ index = base + 1;
+ } else {
+ index = base + 2;
+ }
+ var result = a[index];
+ result += a[index + 1];
+ result += a[index - 1];
+ return result;
+}
+var result_phi = 0;
+result_phi = test_phi(data_phi, 3, true);
+assertEquals(12, result_phi);
+result_phi = test_phi(data_phi, 3, true);
+assertEquals(12, result_phi);
+%OptimizeFunctionOnNextCall(test_phi);
+result_phi = test_phi(data_phi, 3, true);
+assertEquals(12, result_phi);
+
+
gc();