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