Postpone interrupts while compiling regexp code. This avoids
getting artificial stack overflows due to interrupts while compiling and visiting the AST nodes. Pending interrupts will be processed once we're done compiling. git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4412 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
d74a8a8014
commit
4fac395a04
@ -122,6 +122,7 @@ Handle<Object> RegExpImpl::Compile(Handle<JSRegExp> re,
|
|||||||
}
|
}
|
||||||
FlattenString(pattern);
|
FlattenString(pattern);
|
||||||
CompilationZoneScope zone_scope(DELETE_ON_EXIT);
|
CompilationZoneScope zone_scope(DELETE_ON_EXIT);
|
||||||
|
PostponeInterruptScope postpone;
|
||||||
RegExpCompileData parse_result;
|
RegExpCompileData parse_result;
|
||||||
FlatStringReader reader(pattern);
|
FlatStringReader reader(pattern);
|
||||||
if (!ParseRegExp(&reader, flags.is_multiline(), &parse_result)) {
|
if (!ParseRegExp(&reader, flags.is_multiline(), &parse_result)) {
|
||||||
@ -247,6 +248,7 @@ bool RegExpImpl::EnsureCompiledIrregexp(Handle<JSRegExp> re, bool is_ascii) {
|
|||||||
bool RegExpImpl::CompileIrregexp(Handle<JSRegExp> re, bool is_ascii) {
|
bool RegExpImpl::CompileIrregexp(Handle<JSRegExp> re, bool is_ascii) {
|
||||||
// Compile the RegExp.
|
// Compile the RegExp.
|
||||||
CompilationZoneScope zone_scope(DELETE_ON_EXIT);
|
CompilationZoneScope zone_scope(DELETE_ON_EXIT);
|
||||||
|
PostponeInterruptScope postpone;
|
||||||
Object* entry = re->DataAt(JSRegExp::code_index(is_ascii));
|
Object* entry = re->DataAt(JSRegExp::code_index(is_ascii));
|
||||||
if (entry->IsJSObject()) {
|
if (entry->IsJSObject()) {
|
||||||
// If it's a JSObject, a previous compilation failed and threw this object.
|
// If it's a JSObject, a previous compilation failed and threw this object.
|
||||||
|
Loading…
Reference in New Issue
Block a user