Reviewers: jarin,

Message:
Committed patchset #1 manually as r18290.

Description:
Added regression test for escape analysis.

BUG=
[email protected]

Committed: https://code.google.com/p/v8/source/detail?r=18290

Please review this at https://codereview.chromium.org/99133011/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+13, -10 lines):
  A + test/mjsunit/regress/regress-323845.js


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();


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to