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

Unified Diff: test/mjsunit/harmony/regress/regress-4755.js

Issue 1706283002: [fullcodegen] Implement operand stack depth tracking. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Turn off verification. 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/objects-printer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/regress/regress-4755.js
diff --git a/test/mjsunit/harmony/regress/regress-4755.js b/test/mjsunit/harmony/regress/regress-4755.js
new file mode 100644
index 0000000000000000000000000000000000000000..2a0df9dba4a2225da696bebc1cc3e46f0a54462d
--- /dev/null
+++ b/test/mjsunit/harmony/regress/regress-4755.js
@@ -0,0 +1,45 @@
+// 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 --harmony-do-expressions
+
+(function DoTryCatchInsideBinop() {
+ function f(a, b) {
+ return a + do { try { throw "boom" } catch(e) { b } }
+ }
+ assertEquals(3, f(1, 2));
+ assertEquals(3, f(1, 2));
+ %OptimizeFunctionOnNextCall(f);
+ assertEquals(3, f(1, 2));
+})();
+
+(function DoTryCatchInsideCall() {
+ function f(a, b) {
+ return Math.max(a, do { try { throw a } catch(e) { e + b } })
+ }
+ assertEquals(3, f(1, 2));
+ assertEquals(3, f(1, 2));
+ %OptimizeFunctionOnNextCall(f);
+ assertEquals(3, f(1, 2));
+})();
+
+(function DoTryCatchInsideTry() {
+ function f(a, b) {
+ try { return do { try { throw a } catch(e) { e + b } } } catch(e) {}
+ }
+ assertEquals(3, f(1, 2));
+ assertEquals(3, f(1, 2));
+ %OptimizeFunctionOnNextCall(f);
+ assertEquals(3, f(1, 2));
+})();
+
+(function DoTryCatchInsideFinally() {
+ function f(a, b) {
+ try {} finally { return do { try { throw a } catch(e) { e + b } } }
+ }
+ assertEquals(3, f(1, 2));
+ assertEquals(3, f(1, 2));
+ %OptimizeFunctionOnNextCall(f);
+ assertEquals(3, f(1, 2));
+})();
« no previous file with comments | « src/objects-printer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698