regexp-3.js (440B)
1 // |jit-test| --fast-warmup; --no-threads 2 3 // Test invalidation of Ion code when RegExpPrototype fuse is popped. 4 function test() { 5 var s = "foobar"; 6 var re = /abc.+/; 7 var count = 0; 8 for (var i = 0; i < 200; i++) { 9 s.replace(re, "").replace(re, ""); 10 if (i === 150) { 11 // Pop the fuse. 12 RegExp.prototype.exec = function() { 13 count++; 14 return null; 15 }; 16 } 17 } 18 assertEq(count, 98); 19 } 20 test();