Created attachment 386612 [details] [diff] [review] Patch The problem is related to this code in RegExpNativeCompiler::compile: /* * If the regexp is too long nanojit will assert when we * try to insert the guard record. */ if (re_length > 1024) return JS_FALSE; The regexp in this test case is longer that 1024, so we exit here. But the fragment doesn't get blacklisted, so we keep trying to compile it again and again. Each compilation is only about 100,000 cycles, but we run so many of them (repeating the match operation globally on a string of increasing length) that they add up. I tried adding "fragment->blacklist()" to the code above, but that doesn't work. Because of the way the regexp identity is stored in a fragment, it ends up not getting stored in this case, so we don't find the blacklisted fragment ever, and keep trying to compile over and over. Instead, I decided to use a free flag bit in JSRegExp to record the fact that we can't compile the regexp and shouldn't try again. This also allows us to bail out of the native compilation path faster than before.
Comment on attachment 386612 [details] [diff] [review] Patch Time to move this stuff out of the lir.
Pushed to TM as 24ea6a78f889.
If this is wanted on the 1.9.1 branch please request approval on the patch.
Created attachment 425345 [details] [diff] [review] Patch rebased for 1.9.1 (context changed only)
Comment on attachment 425345 [details] [diff] [review] Patch rebased for 1.9.1 (context changed only) a=beltzner for 1.9.1