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

Unified Diff: test/mjsunit/regress/regress-323845.js

Issue 99133011: Added regression test for escape analysis. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-323845.js
diff --git a/test/mjsunit/compiler/control-flow-0.js b/test/mjsunit/regress/regress-323845.js
similarity index 87%
copy from test/mjsunit/compiler/control-flow-0.js
copy to test/mjsunit/regress/regress-323845.js
index bcf4f2dc998c06f2ea1abab562e8bdf3bbc8fa75..4e81657917825d13db671922b58a05a3c7a5aa46 100644
--- a/test/mjsunit/compiler/control-flow-0.js
+++ b/test/mjsunit/regress/regress-323845.js
@@ -25,20 +25,23 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-function f() {
- return (42 + (0 == 1 ? 1 : 2));
-}
+// Regression test that breaks escape analysis because objects escape over
+// the arguments object.
+// Flags: --allow-natives-syntax
-function g(x) {
- return (x + (0 == 1 ? 1 : 2));
+function h() {
+ g.arguments;
}
+function g(x) {
+ h();
+}
-function h(x) {
- return ((x + 1) + (0 == 1 ? 1 : 2));
+function f() {
+ g({});
}
-assertEquals(44, f());
-assertEquals(45, g(43));
-assertEquals(47, h(44));
+f(); f(); f();
+%OptimizeFunctionOnNextCall(f);
+f();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698