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

Unified Diff: test/mjsunit/compiler/deopt-materialize-accumulator.js

Issue 1707133003: [Interpreter] Fix deopt when accumulator needs to be materialized. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments and add test Created 4 years, 10 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/x87/builtins-x87.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/deopt-materialize-accumulator.js
diff --git a/test/mjsunit/compiler/escape-analysis-deopt-5.js b/test/mjsunit/compiler/deopt-materialize-accumulator.js
similarity index 80%
copy from test/mjsunit/compiler/escape-analysis-deopt-5.js
copy to test/mjsunit/compiler/deopt-materialize-accumulator.js
index e70f0b1221bd9ab9b33c72da70db4a38897fe34b..c80e329150383ba24ab0949bbdc470576c4570bb 100644
--- a/test/mjsunit/compiler/escape-analysis-deopt-5.js
+++ b/test/mjsunit/compiler/deopt-materialize-accumulator.js
@@ -25,17 +25,17 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// Flags: --allow-natives-syntax --turbo-escape
+// Flags: --allow-natives-syntax
+//
+// Tests that Turbofan correctly materializes values which are in the
+// interpreters accumulator during deopt.
-function f() {
- var x = new Array(2);
- x[0] = 23.1234;
- x[1] = 25.1234;
- %DeoptimizeNow();
- return x[0];
+var global = 3;
+function f(a) {
+ // This will trigger a deopt since global was previously a SMI, with the
+ // accumulator holding an unboxed double which needs materialized.
+ global = %_MathSqrt(a);
}
-
-assertEquals(f(), 23.1234);
-assertEquals(f(), 23.1234);
%OptimizeFunctionOnNextCall(f);
-assertEquals(f(), 23.1234);
+f(0.25);
+assertEquals(0.5, global);
« no previous file with comments | « src/x87/builtins-x87.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698