]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - tests/stress/multi-put-by-offset-multiple-transitions.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / multi-put-by-offset-multiple-transitions.js
diff --git a/tests/stress/multi-put-by-offset-multiple-transitions.js b/tests/stress/multi-put-by-offset-multiple-transitions.js
new file mode 100644 (file)
index 0000000..99987ef
--- /dev/null
@@ -0,0 +1,30 @@
+function foo(o) {
+    o.x = 1;
+    o.y = 2;
+    o.a = 3;
+    o.b = 4;
+    o.c = 5;
+    o.d = 6;
+    o.e = 7;
+    o.f = 8;
+    o.g = 9;
+    o.h = 10;
+    o.i = 11;
+}
+
+noInline(foo);
+
+function Foo() {
+    foo(this);
+}
+
+var result = 0;
+
+for (var i = 0; i < 100000; ++i) {
+    foo({f:42});
+    result += (new Foo()).x;
+}
+
+if (result != 100000)
+    throw "Bad result: " + result;
+