]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - tests/stress/llint-cache-replace-then-cache-get-and-fold-then-invalidate.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / llint-cache-replace-then-cache-get-and-fold-then-invalidate.js
diff --git a/tests/stress/llint-cache-replace-then-cache-get-and-fold-then-invalidate.js b/tests/stress/llint-cache-replace-then-cache-get-and-fold-then-invalidate.js
new file mode 100644 (file)
index 0000000..c288482
--- /dev/null
@@ -0,0 +1,26 @@
+var o = {f:42};
+
+function foo(v) {
+    o.f = v;
+}
+
+function bar() {
+    return o.f;
+}
+
+noInline(foo);
+noInline(bar);
+
+foo(42);
+foo(42);
+
+for (var i = 0; i < 100000; ++i) {
+    var result = bar();
+    if (result != 42)
+        throw "Error: bad result: " + result;
+}
+
+foo(53);
+var result = bar();
+if (result != 53)
+    throw "Error: bad result at end: " + result;