Commit 25fce2c5 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

Remove obsolete Malloced::FatalProcessOutOfMemory.

R=hpayer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#26570}
parent 307d2bdd
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "src/base/logging.h" #include "src/base/logging.h"
#include "src/base/platform/platform.h" #include "src/base/platform/platform.h"
#include "src/utils.h" #include "src/utils.h"
#include "src/v8.h"
#if V8_LIBC_BIONIC #if V8_LIBC_BIONIC
#include <malloc.h> // NOLINT #include <malloc.h> // NOLINT
...@@ -20,7 +21,7 @@ namespace internal { ...@@ -20,7 +21,7 @@ namespace internal {
void* Malloced::New(size_t size) { void* Malloced::New(size_t size) {
void* result = malloc(size); void* result = malloc(size);
if (result == NULL) { if (result == NULL) {
v8::internal::FatalProcessOutOfMemory("Malloced operator new"); V8::FatalProcessOutOfMemory("Malloced operator new");
} }
return result; return result;
} }
...@@ -31,11 +32,6 @@ void Malloced::Delete(void* p) { ...@@ -31,11 +32,6 @@ void Malloced::Delete(void* p) {
} }
void Malloced::FatalProcessOutOfMemory() {
v8::internal::FatalProcessOutOfMemory("Out of memory");
}
#ifdef DEBUG #ifdef DEBUG
static void* invalid = static_cast<void*>(NULL); static void* invalid = static_cast<void*>(NULL);
...@@ -96,7 +92,7 @@ void* AlignedAlloc(size_t size, size_t alignment) { ...@@ -96,7 +92,7 @@ void* AlignedAlloc(size_t size, size_t alignment) {
#else #else
if (posix_memalign(&ptr, alignment, size)) ptr = NULL; if (posix_memalign(&ptr, alignment, size)) ptr = NULL;
#endif #endif
if (ptr == NULL) FatalProcessOutOfMemory("AlignedAlloc"); if (ptr == NULL) V8::FatalProcessOutOfMemory("AlignedAlloc");
return ptr; return ptr;
} }
......
...@@ -21,7 +21,6 @@ class Malloced { ...@@ -21,7 +21,6 @@ class Malloced {
void* operator new(size_t size) { return New(size); } void* operator new(size_t size) { return New(size); }
void operator delete(void* p) { Delete(p); } void operator delete(void* p) { Delete(p); }
static void FatalProcessOutOfMemory();
static void* New(size_t size); static void* New(size_t size);
static void Delete(void* p); static void Delete(void* p);
}; };
...@@ -59,7 +58,7 @@ class AllStatic { ...@@ -59,7 +58,7 @@ class AllStatic {
template <typename T> template <typename T>
T* NewArray(size_t size) { T* NewArray(size_t size) {
T* result = new T[size]; T* result = new T[size];
if (result == NULL) Malloced::FatalProcessOutOfMemory(); if (result == NULL) FatalProcessOutOfMemory("NewArray");
return result; return result;
} }
......
...@@ -657,7 +657,7 @@ void Deserializer::Initialize(Isolate* isolate) { ...@@ -657,7 +657,7 @@ void Deserializer::Initialize(Isolate* isolate) {
void Deserializer::Deserialize(Isolate* isolate) { void Deserializer::Deserialize(Isolate* isolate) {
Initialize(isolate); Initialize(isolate);
if (!ReserveSpace()) FatalProcessOutOfMemory("deserializing context"); if (!ReserveSpace()) V8::FatalProcessOutOfMemory("deserializing context");
// No active threads. // No active threads.
DCHECK_NULL(isolate_->thread_manager()->FirstThreadStateInUse()); DCHECK_NULL(isolate_->thread_manager()->FirstThreadStateInUse());
// No active handles. // No active handles.
...@@ -702,7 +702,7 @@ MaybeHandle<Object> Deserializer::DeserializePartial( ...@@ -702,7 +702,7 @@ MaybeHandle<Object> Deserializer::DeserializePartial(
Handle<FixedArray>* outdated_contexts_out) { Handle<FixedArray>* outdated_contexts_out) {
Initialize(isolate); Initialize(isolate);
if (!ReserveSpace()) { if (!ReserveSpace()) {
FatalProcessOutOfMemory("deserialize context"); V8::FatalProcessOutOfMemory("deserialize context");
return MaybeHandle<Object>(); return MaybeHandle<Object>();
} }
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include <cstring> #include <cstring>
#include "src/v8.h"
#ifdef V8_USE_ADDRESS_SANITIZER #ifdef V8_USE_ADDRESS_SANITIZER
#include <sanitizer/asan_interface.h> #include <sanitizer/asan_interface.h>
#endif // V8_USE_ADDRESS_SANITIZER #endif // V8_USE_ADDRESS_SANITIZER
...@@ -237,7 +239,7 @@ Address Zone::NewExpand(int size) { ...@@ -237,7 +239,7 @@ Address Zone::NewExpand(int size) {
// Guard against integer overflow. // Guard against integer overflow.
if (new_size_no_overhead < static_cast<size_t>(size) || if (new_size_no_overhead < static_cast<size_t>(size) ||
new_size < static_cast<size_t>(kSegmentOverhead)) { new_size < static_cast<size_t>(kSegmentOverhead)) {
FatalProcessOutOfMemory("Zone"); V8::FatalProcessOutOfMemory("Zone");
return nullptr; return nullptr;
} }
if (new_size < static_cast<size_t>(kMinimumSegmentSize)) { if (new_size < static_cast<size_t>(kMinimumSegmentSize)) {
...@@ -250,12 +252,12 @@ Address Zone::NewExpand(int size) { ...@@ -250,12 +252,12 @@ Address Zone::NewExpand(int size) {
new_size = Max(min_new_size, static_cast<size_t>(kMaximumSegmentSize)); new_size = Max(min_new_size, static_cast<size_t>(kMaximumSegmentSize));
} }
if (new_size > INT_MAX) { if (new_size > INT_MAX) {
FatalProcessOutOfMemory("Zone"); V8::FatalProcessOutOfMemory("Zone");
return nullptr; return nullptr;
} }
Segment* segment = NewSegment(static_cast<int>(new_size)); Segment* segment = NewSegment(static_cast<int>(new_size));
if (segment == nullptr) { if (segment == nullptr) {
FatalProcessOutOfMemory("Zone"); V8::FatalProcessOutOfMemory("Zone");
return nullptr; return nullptr;
} }
......
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