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

Unified Diff: test/webkit/dfg-array-dead.js

Issue 18068003: Migrated several tests from blink to V8 repository. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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
Index: test/webkit/dfg-array-dead.js
diff --git a/test/webkit/concat-while-having-a-bad-time.js b/test/webkit/dfg-array-dead.js
similarity index 67%
copy from test/webkit/concat-while-having-a-bad-time.js
copy to test/webkit/dfg-array-dead.js
index dfda1e08a0b36194b787a44ee12a9693acd8aeaf..a6276178f330570b3f1096034e8cde25b95a1b0c 100644
--- a/test/webkit/concat-while-having-a-bad-time.js
+++ b/test/webkit/dfg-array-dead.js
@@ -22,10 +22,31 @@
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description(
-"Tests the behavior of Array.prototype.concat while the array is having a bad time due to one of the elements we are concatenating."
+"Tests that an array being dead does not result in register allocation failures."
);
-Object.defineProperty(Array.prototype, 0, { writable: false });
-shouldBe("[42].concat()", "[42]");
+function foo() {
+ var z = new Array(00, 01, 02, 03, 04, 05, 06, 07, 08, 09,
+ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
+ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
+ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
+ 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
+ 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
+ 60, 61, 62, 63, 64, 65, 66, 67, 68, 69);
+ z = bar(1);
+
+ return z.length;
+}
+
+function bar(x) {
+ var a = [];
+ a[x] = 1;
+
+ return a;
+}
+
+for (var i = 0; i < 1000; ++i) {
+ shouldBe("foo()", "2");
+}

Powered by Google App Engine
This is Rietveld 408576698