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

Unified Diff: test/mjsunit/regress/typed-array-lifetime.js

Issue 1493983004: [crankshaft] Loads and stores to typed arrays have to reference the backing store holder (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years 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/mjsunit.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/typed-array-lifetime.js
diff --git a/test/mjsunit/regress/typed-array-lifetime.js b/test/mjsunit/regress/typed-array-lifetime.js
new file mode 100644
index 0000000000000000000000000000000000000000..db9a216531f03ee4128f14b0c9081af7e6fc529b
--- /dev/null
+++ b/test/mjsunit/regress/typed-array-lifetime.js
@@ -0,0 +1,26 @@
+// Copyright 2015 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// Flags: --allow-natives-syntax --typed-array-max-size-in-heap=1
+
+var foo = (function () {
+ var y = 0;
+ return function foo(x) {
+ // Needs to be an external array.
+ var a = new Float64Array(32);
+ a[0] = 42;
+ y = x + 0.1; // This has to allocate.
+ return a[0];
+ }
+})();
+
+foo(1);
+foo(1);
+%OptimizeFunctionOnNextCall(foo);
+foo(1);
+// Try to force a GC during allocation in above marked line.
+for (var i = 0; i < 20; ++i) {
+ %SetAllocationTimeout(i, i, false);
+ assertEquals(42, foo(2));
+}
« no previous file with comments | « test/mjsunit/mjsunit.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698