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

Unified Diff: test/mjsunit/array-splice.js

Issue 397593008: Keep new arrays allocated with 'new Array(N)' in fast mode (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix slow test Created 6 years, 5 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 | « test/mjsunit/array-feedback.js ('k') | test/mjsunit/array-unshift.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/array-splice.js
diff --git a/test/mjsunit/array-splice.js b/test/mjsunit/array-splice.js
index be2b1064e6a12f49d00e713a42b126a4eb45c485..03afac3ec4cdbe6795c8090e9262abbbd1204d48 100644
--- a/test/mjsunit/array-splice.js
+++ b/test/mjsunit/array-splice.js
@@ -25,6 +25,8 @@
// (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
+
// Check that splicing array of holes keeps it as array of holes
(function() {
for (var i = 0; i < 7; i++) {
@@ -357,7 +359,9 @@
(function() {
for (var i = 0; i < 7; i++) {
try {
- new Array(Math.pow(2, 32) - 3).splice(-1, 0, 1, 2, 3, 4, 5);
+ var a = %NormalizeElements([]);
+ a.length = Math.pow(2, 32) - 3;
+ a.splice(-1, 0, 1, 2, 3, 4, 5);
throw 'Should have thrown RangeError';
} catch (e) {
assertTrue(e instanceof RangeError);
@@ -365,7 +369,8 @@
// Check smi boundary
var bigNum = (1 << 30) - 3;
- var array = new Array(bigNum);
+ var array = %NormalizeElements([]);
+ array.length = bigNum;
array.splice(-1, 0, 1, 2, 3, 4, 5, 6, 7);
assertEquals(bigNum + 7, array.length);
}
« no previous file with comments | « test/mjsunit/array-feedback.js ('k') | test/mjsunit/array-unshift.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698