Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 3e52cc0e6fd61cf0607644ae4cde52316685010e..1e196720f5168bb917035812cbd45eeaf31dfc68 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -241,7 +241,7 @@ void i::FatalProcessOutOfMemory(const char* location) { |
// When V8 cannot allocated memory FatalProcessOutOfMemory is called. |
// The default fatal error handler is called and execution is stopped. |
-void i::V8::FatalProcessOutOfMemory(const char* location, bool take_snapshot) { |
+void i::V8::FatalProcessOutOfMemory(const char* location, bool is_heap_oom) { |
i::Isolate* isolate = i::Isolate::Current(); |
char last_few_messages[Heap::kTraceRingBufferSize + 1]; |
char js_stacktrace[Heap::kStacktraceBufferSize + 1]; |
@@ -303,7 +303,9 @@ void i::V8::FatalProcessOutOfMemory(const char* location, bool take_snapshot) { |
PrintF("\n<--- Last few GCs --->\n%s\n", first_newline); |
PrintF("\n<--- JS stacktrace --->\n%s\n", js_stacktrace); |
} |
- Utils::ApiCheck(false, location, "Allocation failed - process out of memory"); |
+ Utils::ApiCheck(false, location, is_heap_oom |
+ ? "Allocation failed - JavaScript heap out of memory" |
+ : "Allocation failed - process out of memory"); |
// If the fatal error handler returns, we stop execution. |
FATAL("API fatal error handler returned after process out of memory"); |
} |