Index: test/mjsunit/compiler/escape-analysis.js |
diff --git a/test/mjsunit/compiler/escape-analysis.js b/test/mjsunit/compiler/escape-analysis.js |
index 74e638a5381a9de6215e7f6649976419c1fce147..21ebcbbf49a078fcf1a6b8ed9b977ee08e56a7b7 100644 |
--- a/test/mjsunit/compiler/escape-analysis.js |
+++ b/test/mjsunit/compiler/escape-analysis.js |
@@ -271,3 +271,33 @@ |
%OptimizeFunctionOnNextCall(oob); |
assertEquals(7, oob(cons2, true)); |
})(); |
+ |
+ |
+// Test non-shallow nested graph of captured objects. |
+(function testDeep() { |
+ var deopt = { deopt:false }; |
+ function constructor1() { |
+ this.x = 23; |
+ } |
+ function constructor2(nested) { |
+ this.a = 17; |
+ this.b = nested; |
+ this.c = 42; |
+ } |
+ function deep() { |
+ var o1 = new constructor1(); |
+ var o2 = new constructor2(o1); |
+ assertEquals(17, o2.a); |
+ assertEquals(23, o2.b.x); |
+ assertEquals(42, o2.c); |
+ o1.x = 99; |
+ deopt.deopt; |
+ assertEquals(99, o1.x); |
+ assertEquals(99, o2.b.x); |
+ } |
+ deep(); deep(); |
+ %OptimizeFunctionOnNextCall(deep); |
+ deep(); deep(); |
+ delete deopt.deopt; |
+ deep(); deep(); |
+})(); |