Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1191)

Unified Diff: src/jsregexp.cc

Issue 6340: If an allocation is so huge that we cannot code the size needed in the failur... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 12 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap-inl.h ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/jsregexp.cc
===================================================================
--- src/jsregexp.cc (revision 469)
+++ src/jsregexp.cc (working copy)
@@ -279,19 +279,23 @@
multiline_option, &number_of_captures,
&error_message, &JSREMalloc, &JSREFree);
- if (code == NULL && malloc_failure->IsRetryAfterGC()) {
- // Performs a GC, then retries.
- if (!Heap::CollectGarbage(malloc_failure->requested(),
- malloc_failure->allocation_space())) {
- // TODO(1181417): Fix this.
- V8::FatalProcessOutOfMemory("RegExpImpl::JsreCompile");
+ if (code == NULL) {
+ if (malloc_failure->IsRetryAfterGC()) {
+ // Performs a GC, then retries.
+ if (!Heap::CollectGarbage(malloc_failure->requested(),
+ malloc_failure->allocation_space())) {
+ // TODO(1181417): Fix this.
+ V8::FatalProcessOutOfMemory("RegExpImpl::JsreCompile");
+ }
+ malloc_failure = Failure::Exception();
+ code = jsRegExpCompile(two_byte_pattern->GetTwoByteData(),
+ pattern->length(), case_option,
+ multiline_option, &number_of_captures,
+ &error_message, &JSREMalloc, &JSREFree);
}
- malloc_failure = Failure::Exception();
- code = jsRegExpCompile(two_byte_pattern->GetTwoByteData(),
- pattern->length(), case_option,
- multiline_option, &number_of_captures,
- &error_message, &JSREMalloc, &JSREFree);
- if (code == NULL && malloc_failure->IsRetryAfterGC()) {
+ if (code == NULL &&
+ (malloc_failure->IsRetryAfterGC() ||
+ malloc_failure->IsOutOfMemoryFailure())) {
// TODO(1181417): Fix this.
V8::FatalProcessOutOfMemory("RegExpImpl::JsreCompile");
}
« no previous file with comments | « src/heap-inl.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698