Remove obsolete Malloced::FatalProcessOutOfMemory.

R=hpayer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#26570}
This commit is contained in:
mstarzinger 2015-02-11 01:25:37 -08:00 committed by Commit bot
parent 307d2bdd81
commit 25fce2c5c1
4 changed files with 11 additions and 14 deletions

View File

@ -9,6 +9,7 @@
#include "src/base/logging.h"
#include "src/base/platform/platform.h"
#include "src/utils.h"
#include "src/v8.h"
#if V8_LIBC_BIONIC
#include <malloc.h> // NOLINT
@ -20,7 +21,7 @@ namespace internal {
void* Malloced::New(size_t size) {
void* result = malloc(size);
if (result == NULL) {
v8::internal::FatalProcessOutOfMemory("Malloced operator new");
V8::FatalProcessOutOfMemory("Malloced operator new");
}
return result;
}
@ -31,11 +32,6 @@ void Malloced::Delete(void* p) {
}
void Malloced::FatalProcessOutOfMemory() {
v8::internal::FatalProcessOutOfMemory("Out of memory");
}
#ifdef DEBUG
static void* invalid = static_cast<void*>(NULL);
@ -96,7 +92,7 @@ void* AlignedAlloc(size_t size, size_t alignment) {
#else
if (posix_memalign(&ptr, alignment, size)) ptr = NULL;
#endif
if (ptr == NULL) FatalProcessOutOfMemory("AlignedAlloc");
if (ptr == NULL) V8::FatalProcessOutOfMemory("AlignedAlloc");
return ptr;
}

View File

@ -21,7 +21,6 @@ class Malloced {
void* operator new(size_t size) { return New(size); }
void operator delete(void* p) { Delete(p); }
static void FatalProcessOutOfMemory();
static void* New(size_t size);
static void Delete(void* p);
};
@ -59,7 +58,7 @@ class AllStatic {
template <typename T>
T* NewArray(size_t size) {
T* result = new T[size];
if (result == NULL) Malloced::FatalProcessOutOfMemory();
if (result == NULL) FatalProcessOutOfMemory("NewArray");
return result;
}

View File

@ -657,7 +657,7 @@ void Deserializer::Initialize(Isolate* isolate) {
void Deserializer::Deserialize(Isolate* isolate) {
Initialize(isolate);
if (!ReserveSpace()) FatalProcessOutOfMemory("deserializing context");
if (!ReserveSpace()) V8::FatalProcessOutOfMemory("deserializing context");
// No active threads.
DCHECK_NULL(isolate_->thread_manager()->FirstThreadStateInUse());
// No active handles.
@ -702,7 +702,7 @@ MaybeHandle<Object> Deserializer::DeserializePartial(
Handle<FixedArray>* outdated_contexts_out) {
Initialize(isolate);
if (!ReserveSpace()) {
FatalProcessOutOfMemory("deserialize context");
V8::FatalProcessOutOfMemory("deserialize context");
return MaybeHandle<Object>();
}

View File

@ -6,6 +6,8 @@
#include <cstring>
#include "src/v8.h"
#ifdef V8_USE_ADDRESS_SANITIZER
#include <sanitizer/asan_interface.h>
#endif // V8_USE_ADDRESS_SANITIZER
@ -237,7 +239,7 @@ Address Zone::NewExpand(int size) {
// Guard against integer overflow.
if (new_size_no_overhead < static_cast<size_t>(size) ||
new_size < static_cast<size_t>(kSegmentOverhead)) {
FatalProcessOutOfMemory("Zone");
V8::FatalProcessOutOfMemory("Zone");
return nullptr;
}
if (new_size < static_cast<size_t>(kMinimumSegmentSize)) {
@ -250,12 +252,12 @@ Address Zone::NewExpand(int size) {
new_size = Max(min_new_size, static_cast<size_t>(kMaximumSegmentSize));
}
if (new_size > INT_MAX) {
FatalProcessOutOfMemory("Zone");
V8::FatalProcessOutOfMemory("Zone");
return nullptr;
}
Segment* segment = NewSegment(static_cast<int>(new_size));
if (segment == nullptr) {
FatalProcessOutOfMemory("Zone");
V8::FatalProcessOutOfMemory("Zone");
return nullptr;
}