1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/gc/incremental-01.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,31 @@ 1.4 +var objs; 1.5 + 1.6 +function init() 1.7 +{ 1.8 + objs = new Object(); 1.9 + var x = new Object(); 1.10 + objs.root1 = x; 1.11 + objs.root2 = new Object(); 1.12 + x.ptr = new Object(); 1.13 + x = null; 1.14 + 1.15 + /* 1.16 + * Clears out the arena lists. Otherwise all the objects above 1.17 + * would be considered to be created during the incremental GC. 1.18 + */ 1.19 + gc(); 1.20 +} 1.21 + 1.22 +/* 1.23 + * Use eval here so that the interpreter frames end up higher on the 1.24 + * stack, which avoids them being seen later on by the conservative 1.25 + * scanner. 1.26 + */ 1.27 +eval("init()"); 1.28 + 1.29 +gcslice(0); 1.30 +selectforgc(objs.root2); 1.31 +gcslice(1); 1.32 +objs.root2.ptr = objs.root1.ptr; 1.33 +objs.root1.ptr = null; 1.34 +gcslice();