Chromium Code Reviews| Index: test/mjsunit/compiler/escape-analysis.js |
| diff --git a/test/mjsunit/compiler/escape-analysis.js b/test/mjsunit/compiler/escape-analysis.js |
| index 9776f67ccf988486f795f0afecea6db4678f5d33..3b32027a1b3174552b29e043d0bd2baae7cc8983 100644 |
| --- a/test/mjsunit/compiler/escape-analysis.js |
| +++ b/test/mjsunit/compiler/escape-analysis.js |
| @@ -132,3 +132,40 @@ |
| delete deopt.deopt; |
| func(); func(); |
| })(); |
| + |
| + |
| +// Test deoptimization with captured objects on operand stack. |
|
titzer
2013/08/26 11:27:24
Do we need to test modifications of the captured o
Michael Starzinger
2013/08/26 16:15:44
Done. I added modifications of fields after the de
|
| +(function testDeoptOperand() { |
| + var deopt = { deopt:false }; |
| + function constructor1() { |
| + this.a = 1.0; |
| + this.b = 2.3; |
| + deopt.deopt; |
| + assertEquals(1.0, this.a); |
| + assertEquals(2.3, this.b); |
| + this.c = 3.0; |
| + this.d = 4.5; |
| + } |
| + function constructor2() { |
| + this.e = 5.0; |
| + this.f = new constructor1(); |
| + assertEquals(1.0, this.f.a); |
| + assertEquals(2.3, this.f.b); |
| + assertEquals(5.0, this.e); |
| + this.g = 6.7; |
| + } |
| + function func() { |
| + var o = new constructor2(); |
| + assertEquals(1.0, o.f.a); |
| + assertEquals(2.3, o.f.b); |
| + assertEquals(3.0, o.f.c); |
| + assertEquals(4.5, o.f.d); |
| + assertEquals(5.0, o.e); |
| + assertEquals(6.7, o.g); |
| + } |
| + func(); func(); |
| + %OptimizeFunctionOnNextCall(func); |
| + func(); func(); |
| + delete deopt.deopt; |
| + func(); func(); |
| +})(); |