diff options
author | isaacs <i@izs.me> | 2012-06-09 08:09:42 -0700 |
---|---|---|
committer | isaacs <i@izs.me> | 2012-06-09 08:09:42 -0700 |
commit | 940a6863ead6622e5439e07be631359c31e63b68 (patch) | |
tree | c5aa25c048b8f0fd622d4c42fa134ca645fcbcd7 /deps/v8/test/mjsunit/array-bounds-check-removal.js | |
parent | 569acea0eefed2c7da7453b7dcef6ff47491ca1c (diff) | |
download | android-node-v8-940a6863ead6622e5439e07be631359c31e63b68.tar.gz android-node-v8-940a6863ead6622e5439e07be631359c31e63b68.tar.bz2 android-node-v8-940a6863ead6622e5439e07be631359c31e63b68.zip |
Roll V8 back to 3.9.24.31
Diffstat (limited to 'deps/v8/test/mjsunit/array-bounds-check-removal.js')
-rw-r--r-- | deps/v8/test/mjsunit/array-bounds-check-removal.js | 145 |
1 files changed, 0 insertions, 145 deletions
diff --git a/deps/v8/test/mjsunit/array-bounds-check-removal.js b/deps/v8/test/mjsunit/array-bounds-check-removal.js deleted file mode 100644 index 81064aa237..0000000000 --- a/deps/v8/test/mjsunit/array-bounds-check-removal.js +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright 2011 the V8 project authors. All rights reserved. -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Flags: --allow-natives-syntax --expose-gc - -var a = new Int32Array(1024); - -function test_base(base,cond) { - a[base + 1] = 1; - a[base + 4] = 2; - a[base + 3] = 3; - a[base + 2] = 4; - a[base + 4] = base + 4; - if (cond) { - a[base + 1] = 1; - a[base + 2] = 2; - a[base + 2] = 3; - a[base + 2] = 4; - a[base + 4] = base + 4; - } else { - a[base + 6] = 1; - a[base + 4] = 2; - a[base + 3] = 3; - a[base + 2] = 4; - a[base + 4] = base - 4; - } -} - -function check_test_base(base,cond) { - if (cond) { - assertEquals(1, a[base + 1]); - assertEquals(4, a[base + 2]); - assertEquals(base + 4, a[base + 4]); - } else { - assertEquals(1, a[base + 6]); - assertEquals(3, a[base + 3]); - assertEquals(4, a[base + 2]); - assertEquals(base - 4, a[base + 4]); - } -} - - -function test_minus(base,cond) { - a[base - 1] = 1; - a[base - 2] = 2; - a[base + 4] = 3; - a[base] = 4; - a[base + 4] = base + 4; - if (cond) { - a[base - 4] = 1; - a[base + 5] = 2; - a[base + 3] = 3; - a[base + 2] = 4; - a[base + 4] = base + 4; - } else { - a[base + 6] = 1; - a[base + 4] = 2; - a[base + 3] = 3; - a[base + 2] = 4; - a[base + 4] = base - 4; - } -} - -function check_test_minus(base,cond) { - if (cond) { - assertEquals(2, a[base + 5]); - assertEquals(3, a[base + 3]); - assertEquals(4, a[base + 2]); - assertEquals(base + 4, a[base + 4]); - } else { - assertEquals(1, a[base + 6]); - assertEquals(3, a[base + 3]); - assertEquals(4, a[base + 2]); - assertEquals(base - 4, a[base + 4]); - } -} - -test_base(1,true); -test_base(2,true); -test_base(1,false); -test_base(2,false); -%OptimizeFunctionOnNextCall(test_base); -test_base(3,true); -check_test_base(3,true); -test_base(3,false); -check_test_base(3,false); - -test_minus(5,true); -test_minus(6,true); -%OptimizeFunctionOnNextCall(test_minus); -test_minus(7,true); -check_test_minus(7,true); -test_minus(7,false); -check_test_minus(7,false); - -// Optimization status: -// YES: 1 -// NO: 2 -// ALWAYS: 3 -// NEVER: 4 - -if (false) { -test_base(5,true); -test_base(6,true); -test_base(5,false); -test_base(6,false); -%OptimizeFunctionOnNextCall(test_base); -test_base(-2,true); -assertTrue(%GetOptimizationStatus(test_base) != 1); - -test_base(5,true); -test_base(6,true); -test_base(5,false); -test_base(6,false); -%OptimizeFunctionOnNextCall(test_base); -test_base(2048,true); -assertTrue(%GetOptimizationStatus(test_base) != 1); -} - -gc(); - |