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

Unified Diff: test/mjsunit/compiler/regress-639210.js

Issue 2270793004: [turbofan] Fix merging of empty and non-empty state in load elimination. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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 | « src/compiler/load-elimination.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/compiler/regress-639210.js
diff --git a/test/mjsunit/compiler/regress-639210.js b/test/mjsunit/compiler/regress-639210.js
new file mode 100644
index 0000000000000000000000000000000000000000..50303fb9d6c699302b7f3933c0853667c9021520
--- /dev/null
+++ b/test/mjsunit/compiler/regress-639210.js
@@ -0,0 +1,38 @@
+// Copyright 2016 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
+
+var m = (function m() {
+ "use asm"
+ var i32 = new Int32Array(4);
+ var f64 = new Float64Array(4);
+
+ function init() {
+ i32[0] = 1;
+ f64[0] = 0.1;
+ }
+
+ function load(b) {
+ return (b ? 0 : i32[0]) + i32[0];
+ }
+
+ function store(b) {
+ if (b|0) {
+ } else {
+ f64[0] = 42;
+ }
+ return f64[0];
+ }
+
+ return { init : init, load : load, store : store };
+})();
+
+m.init();
+
+%OptimizeFunctionOnNextCall(m.load);
+assertEquals(2, m.load());
+
+%OptimizeFunctionOnNextCall(m.store);
+assertEquals(0.1, m.store(1));
« no previous file with comments | « src/compiler/load-elimination.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698