Commit 8fa3d991 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

Correctly report some internal OOM conditions.

R=hpayer@chromium.org
BUG=chromium:454615
LOG=N

Review URL: https://codereview.chromium.org/900793004

Cr-Commit-Position: refs/heads/master@{#26452}
parent a5593679
...@@ -2128,11 +2128,12 @@ void MarkCompactCollector::EnsureMarkingDequeIsCommittedAndInitialize() { ...@@ -2128,11 +2128,12 @@ void MarkCompactCollector::EnsureMarkingDequeIsCommittedAndInitialize() {
marking_deque_memory_ = new base::VirtualMemory(4 * MB); marking_deque_memory_ = new base::VirtualMemory(4 * MB);
} }
if (!marking_deque_memory_committed_) { if (!marking_deque_memory_committed_) {
bool success = marking_deque_memory_->Commit( if (!marking_deque_memory_->Commit(
reinterpret_cast<Address>(marking_deque_memory_->address()), reinterpret_cast<Address>(marking_deque_memory_->address()),
marking_deque_memory_->size(), marking_deque_memory_->size(),
false); // Not executable. false)) { // Not executable.
CHECK(success); V8::FatalProcessOutOfMemory("EnsureMarkingDequeIsCommitted");
}
marking_deque_memory_committed_ = true; marking_deque_memory_committed_ = true;
InitializeMarkingDeque(); InitializeMarkingDeque();
} }
......
...@@ -55,9 +55,11 @@ void StoreBuffer::SetUp() { ...@@ -55,9 +55,11 @@ void StoreBuffer::SetUp() {
old_limit_ = old_start_ + initial_length; old_limit_ = old_start_ + initial_length;
old_reserved_limit_ = old_start_ + kOldStoreBufferLength; old_reserved_limit_ = old_start_ + kOldStoreBufferLength;
CHECK(old_virtual_memory_->Commit(reinterpret_cast<void*>(old_start_), if (!old_virtual_memory_->Commit(reinterpret_cast<void*>(old_start_),
(old_limit_ - old_start_) * kPointerSize, (old_limit_ - old_start_) * kPointerSize,
false)); false)) {
V8::FatalProcessOutOfMemory("StoreBuffer::SetUp");
}
DCHECK(reinterpret_cast<Address>(start_) >= virtual_memory_->address()); DCHECK(reinterpret_cast<Address>(start_) >= virtual_memory_->address());
DCHECK(reinterpret_cast<Address>(limit_) >= virtual_memory_->address()); DCHECK(reinterpret_cast<Address>(limit_) >= virtual_memory_->address());
...@@ -71,9 +73,11 @@ void StoreBuffer::SetUp() { ...@@ -71,9 +73,11 @@ void StoreBuffer::SetUp() {
DCHECK((reinterpret_cast<uintptr_t>(limit_ - 1) & kStoreBufferOverflowBit) == DCHECK((reinterpret_cast<uintptr_t>(limit_ - 1) & kStoreBufferOverflowBit) ==
0); 0);
CHECK(virtual_memory_->Commit(reinterpret_cast<Address>(start_), if (!virtual_memory_->Commit(reinterpret_cast<Address>(start_),
kStoreBufferSize, kStoreBufferSize,
false)); // Not executable. false)) { // Not executable.
V8::FatalProcessOutOfMemory("StoreBuffer::SetUp");
}
heap_->public_set_store_buffer_top(start_); heap_->public_set_store_buffer_top(start_);
hash_set_1_ = new uintptr_t[kHashSetLength]; hash_set_1_ = new uintptr_t[kHashSetLength];
...@@ -133,8 +137,10 @@ void StoreBuffer::EnsureSpace(intptr_t space_needed) { ...@@ -133,8 +137,10 @@ void StoreBuffer::EnsureSpace(intptr_t space_needed) {
while (old_limit_ - old_top_ < space_needed && while (old_limit_ - old_top_ < space_needed &&
old_limit_ < old_reserved_limit_) { old_limit_ < old_reserved_limit_) {
size_t grow = old_limit_ - old_start_; // Double size. size_t grow = old_limit_ - old_start_; // Double size.
CHECK(old_virtual_memory_->Commit(reinterpret_cast<void*>(old_limit_), if (!old_virtual_memory_->Commit(reinterpret_cast<void*>(old_limit_),
grow * kPointerSize, false)); grow * kPointerSize, false)) {
V8::FatalProcessOutOfMemory("StoreBuffer::EnsureSpace");
}
old_limit_ += grow; old_limit_ += grow;
} }
......
...@@ -56,6 +56,7 @@ class V8 : public AllStatic { ...@@ -56,6 +56,7 @@ class V8 : public AllStatic {
static void TearDown(); static void TearDown();
// Report process out of memory. Implementation found in api.cc. // Report process out of memory. Implementation found in api.cc.
// This function will not return, but will terminate the execution.
static void FatalProcessOutOfMemory(const char* location, static void FatalProcessOutOfMemory(const char* location,
bool take_snapshot = false); bool take_snapshot = false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment