Reviewers: dcarney,
Description:
Remove deprecated Isolate::New and SetArrayBufferAllocator methods
Embedders have to always provide an array buffer allocator, and it needs
to be passed via Isolate::CreateParams
BUG=none
R=dcar...@chromium.org
LOG=y
Please review this at https://codereview.chromium.org/1114873002/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+2, -43 lines):
M include/v8.h
M src/api.cc
M src/v8.h
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index
89c9042ea8e9c5f2ffb1fa67ea7e43412e3e48ca..641312e2c4e59b4fb831e8b760fd4d0eb4cf4381
100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -5123,8 +5123,6 @@ class V8_EXPORT Isolate {
*/
static Isolate* New(const CreateParams& params);
- static V8_DEPRECATED("Always pass CreateParams", Isolate* New());
-
/**
* Returns the entered isolate for the current thread or NULL in
* case there is no current isolate.
@@ -5708,16 +5706,6 @@ class V8_EXPORT V8 {
AllowCodeGenerationFromStringsCallback
that));
/**
- * Set allocator to use for ArrayBuffer memory.
- * The allocator should be set only once. The allocator should be set
- * before any code tha uses ArrayBuffers is executed.
- * This allocator is used in all isolates.
- */
- static V8_DEPRECATE_SOON(
- "Use isolate version",
- void SetArrayBufferAllocator(ArrayBuffer::Allocator* allocator));
-
- /**
* Check if V8 is dead and therefore unusable. This is the case after
* fatal errors such as out-of-memory situations.
*/
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index
de0b0076e0901093d5c8dab59880495ad567342e..7b6d5e7f23d4a72be2e232f3240bcb49a96f53b1
100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -5315,15 +5315,6 @@ void v8::V8::SetReturnAddressLocationResolver(
i::V8::SetReturnAddressLocationResolver(return_address_resolver);
}
-void v8::V8::SetArrayBufferAllocator(
- ArrayBuffer::Allocator* allocator) {
- if (!Utils::ApiCheck(i::V8::ArrayBufferAllocator() == NULL,
- "v8::V8::SetArrayBufferAllocator",
- "ArrayBufferAllocator might only be set once"))
- return;
- i::V8::SetArrayBufferAllocator(allocator);
-}
-
bool v8::V8::Dispose() {
i::V8::TearDown();
@@ -6759,20 +6750,11 @@ Isolate* Isolate::GetCurrent() {
}
-Isolate* Isolate::New() {
- Isolate::CreateParams create_params;
- return New(create_params);
-}
-
-
Isolate* Isolate::New(const Isolate::CreateParams& params) {
i::Isolate* isolate = new i::Isolate(false);
Isolate* v8_isolate = reinterpret_cast<Isolate*>(isolate);
- if (params.array_buffer_allocator != NULL) {
- isolate->set_array_buffer_allocator(params.array_buffer_allocator);
- } else {
- isolate->set_array_buffer_allocator(i::V8::ArrayBufferAllocator());
- }
+ CHECK(params.array_buffer_allocator != NULL);
+ isolate->set_array_buffer_allocator(params.array_buffer_allocator);
if (params.snapshot_blob != NULL) {
isolate->set_snapshot_blob(params.snapshot_blob);
} else {
Index: src/v8.h
diff --git a/src/v8.h b/src/v8.h
index
211f3c6141a79650fa798ef9351e1276a24486c8..71dd42f49df8dae580a36492e306a07432d728d5
100644
--- a/src/v8.h
+++ b/src/v8.h
@@ -69,15 +69,6 @@ class V8 : public AllStatic {
// Support for entry hooking JITed code.
static void SetFunctionEntryHook(FunctionEntryHook entry_hook);
- static v8::ArrayBuffer::Allocator* ArrayBufferAllocator() {
- return array_buffer_allocator_;
- }
-
- static void SetArrayBufferAllocator(v8::ArrayBuffer::Allocator
*allocator) {
- CHECK_NULL(array_buffer_allocator_);
- array_buffer_allocator_ = allocator;
- }
-
static void InitializePlatform(v8::Platform* platform);
static void ShutdownPlatform();
static v8::Platform* GetCurrentPlatform();
@@ -89,8 +80,6 @@ class V8 : public AllStatic {
static void InitializeOncePerProcessImpl();
static void InitializeOncePerProcess();
- // Allocator for external array buffers.
- static v8::ArrayBuffer::Allocator* array_buffer_allocator_;
// v8::Platform to use.
static v8::Platform* platform_;
};
--
--
v8-dev mailing list
v8-dev@googlegroups.com
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 v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.