1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/pic/shape_regen.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,33 @@ 1.4 +// Try to test that we handle shape regeneration correctly. 1.5 +// This is a fragile test, but as of this writing, on dmandelin's 1.6 +// windows box, we have the same shape number with different 1.7 +// logical shapes in the two assertEq lines. 1.8 + 1.9 +var o; 1.10 +var p; 1.11 +var zz; 1.12 +var o2; 1.13 + 1.14 +function f(x) { 1.15 + return x.a; 1.16 +} 1.17 + 1.18 +gczeal(1); 1.19 +gc(); 1.20 + 1.21 +zz = { q: 11 }; 1.22 +o = { a: 77, b: 88 }; 1.23 +o2 = { c: 11 }; 1.24 +p = { b: 99, a: 11 }; 1.25 + 1.26 +//print('s ' + shapeOf(zz) + ' ' + shapeOf(o) + ' ' + shapeOf(o2) + ' ' + shapeOf(p)); 1.27 + 1.28 +assertEq(f(o), 77); 1.29 + 1.30 +o = undefined; 1.31 + 1.32 +gczeal(1); 1.33 +gc(); 1.34 +//print('s ' + 'x' + ' ' + shapeOf(p)); 1.35 + 1.36 +assertEq(f(p), 11);