Reviewers: Hannes Payer,
Description:
Remove obsolete Malloced::FatalProcessOutOfMemory.
[email protected]
Please review this at https://codereview.chromium.org/897213003/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+11, -14 lines):
M src/allocation.h
M src/allocation.cc
M src/serialize.cc
M src/zone.cc
Index: src/allocation.cc
diff --git a/src/allocation.cc b/src/allocation.cc
index
96fd71f11bd3d55be11d7f157ee885e838c430be..8a03a9cf91f7ec996f76c24ef8571700cea03201
100644
--- a/src/allocation.cc
+++ b/src/allocation.cc
@@ -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;
}
Index: src/allocation.h
diff --git a/src/allocation.h b/src/allocation.h
index
2fea7b2826edcd6d3a6af821a475afd543322a37..292e1fe23b5f8a070eac5a165aad5dac2b052818
100644
--- a/src/allocation.h
+++ b/src/allocation.h
@@ -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;
}
Index: src/serialize.cc
diff --git a/src/serialize.cc b/src/serialize.cc
index
f2c7cab3ce81a743d9626bcc1c52cdb3bed74d28..887276f9cf0dc1b65e6f90432e14cea0b205e9e3
100644
--- a/src/serialize.cc
+++ b/src/serialize.cc
@@ -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>();
}
Index: src/zone.cc
diff --git a/src/zone.cc b/src/zone.cc
index
41eff835901d202d5b7ae3f6d25328d64244a4ca..e3f559aac22451c35b782f7abd30c5d9d5f3f027
100644
--- a/src/zone.cc
+++ b/src/zone.cc
@@ -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;
}
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.