Commit 4bdd165f authored by jochen@chromium.org's avatar jochen@chromium.org

Remove a couple of deprecated APIs that moved to Isolate

Embedders should either pass the information to via
Isolate::CreateParams or use Isolate::SetStackLimit where appropriate

BUG=none
R=svenpanne@chromium.org
LOG=y

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24080 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent ebf9b8ab
...@@ -4099,16 +4099,6 @@ class V8_EXPORT ResourceConstraints { ...@@ -4099,16 +4099,6 @@ class V8_EXPORT ResourceConstraints {
}; };
/**
* Sets the given ResourceConstraints on the given Isolate.
*
* Deprecated, will be removed. Pass constraints via Isolate::New or modify
* the stack limit via Isolate::SetStackLimit.
*/
bool V8_EXPORT SetResourceConstraints(Isolate* isolate,
ResourceConstraints* constraints);
// --- Exceptions --- // --- Exceptions ---
...@@ -5129,50 +5119,6 @@ class V8_EXPORT V8 { ...@@ -5129,50 +5119,6 @@ class V8_EXPORT V8 {
static void SetReturnAddressLocationResolver( static void SetReturnAddressLocationResolver(
ReturnAddressLocationResolver return_address_resolver); ReturnAddressLocationResolver return_address_resolver);
/**
* Allows the host application to provide the address of a function that's
* invoked on entry to every V8-generated function.
* Note that \p entry_hook is invoked at the very start of each
* generated function.
*
* \param isolate the isolate to operate on.
* \param entry_hook a function that will be invoked on entry to every
* V8-generated function.
* \returns true on success on supported platforms, false on failure.
* \note Setting an entry hook can only be done very early in an isolates
* lifetime, and once set, the entry hook cannot be revoked.
*
* Deprecated, will be removed. Use Isolate::New(entry_hook) instead.
*/
static bool SetFunctionEntryHook(Isolate* isolate,
FunctionEntryHook entry_hook);
/**
* Allows the host application to provide the address of a function that is
* notified each time code is added, moved or removed.
*
* \param options options for the JIT code event handler.
* \param event_handler the JIT code event handler, which will be invoked
* each time code is added, moved or removed.
* \note \p event_handler won't get notified of existent code.
* \note since code removal notifications are not currently issued, the
* \p event_handler may get notifications of code that overlaps earlier
* code notifications. This happens when code areas are reused, and the
* earlier overlapping code areas should therefore be discarded.
* \note the events passed to \p event_handler and the strings they point to
* are not guaranteed to live past each call. The \p event_handler must
* copy strings and other parameters it needs to keep around.
* \note the set of events declared in JitCodeEvent::EventType is expected to
* grow over time, and the JitCodeEvent structure is expected to accrue
* new members. The \p event_handler function must ignore event codes
* it does not recognize to maintain future compatibility.
*
* Deprecated, will be removed. Use Isolate::SetJitCodeEventHandler or
* Isolate::CreateParams instead.
*/
static void SetJitCodeEventHandler(JitCodeEventOptions options,
JitCodeEventHandler event_handler);
/** /**
* Forcefully terminate the current thread of JavaScript execution * Forcefully terminate the current thread of JavaScript execution
* in the given isolate. * in the given isolate.
......
...@@ -471,30 +471,23 @@ void ResourceConstraints::ConfigureDefaults(uint64_t physical_memory, ...@@ -471,30 +471,23 @@ void ResourceConstraints::ConfigureDefaults(uint64_t physical_memory,
} }
bool SetResourceConstraints(Isolate* v8_isolate, void SetResourceConstraints(i::Isolate* isolate,
ResourceConstraints* constraints) { const ResourceConstraints& constraints) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); int semi_space_size = constraints.max_semi_space_size();
int semi_space_size = constraints->max_semi_space_size(); int old_space_size = constraints.max_old_space_size();
int old_space_size = constraints->max_old_space_size(); int max_executable_size = constraints.max_executable_size();
int max_executable_size = constraints->max_executable_size(); size_t code_range_size = constraints.code_range_size();
size_t code_range_size = constraints->code_range_size();
if (semi_space_size != 0 || old_space_size != 0 || if (semi_space_size != 0 || old_space_size != 0 ||
max_executable_size != 0 || code_range_size != 0) { max_executable_size != 0 || code_range_size != 0) {
// After initialization it's too late to change Heap constraints. isolate->heap()->ConfigureHeap(semi_space_size, old_space_size,
DCHECK(!isolate->IsInitialized()); max_executable_size, code_range_size);
bool result = isolate->heap()->ConfigureHeap(semi_space_size, }
old_space_size, if (constraints.stack_limit() != NULL) {
max_executable_size, uintptr_t limit = reinterpret_cast<uintptr_t>(constraints.stack_limit());
code_range_size);
if (!result) return false;
}
if (constraints->stack_limit() != NULL) {
uintptr_t limit = reinterpret_cast<uintptr_t>(constraints->stack_limit());
isolate->stack_guard()->SetStackLimit(limit); isolate->stack_guard()->SetStackLimit(limit);
} }
isolate->set_max_available_threads(constraints->max_available_threads()); isolate->set_max_available_threads(constraints.max_available_threads());
return true;
} }
...@@ -5065,38 +5058,6 @@ void v8::V8::SetReturnAddressLocationResolver( ...@@ -5065,38 +5058,6 @@ void v8::V8::SetReturnAddressLocationResolver(
i::V8::SetReturnAddressLocationResolver(return_address_resolver); i::V8::SetReturnAddressLocationResolver(return_address_resolver);
} }
bool v8::V8::SetFunctionEntryHook(Isolate* ext_isolate,
FunctionEntryHook entry_hook) {
DCHECK(ext_isolate != NULL);
DCHECK(entry_hook != NULL);
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(ext_isolate);
// The entry hook can only be set before the Isolate is initialized, as
// otherwise the Isolate's code stubs generated at initialization won't
// contain entry hooks.
if (isolate->IsInitialized())
return false;
// Setting an entry hook is a one-way operation, once set, it cannot be
// changed or unset.
if (isolate->function_entry_hook() != NULL)
return false;
isolate->set_function_entry_hook(entry_hook);
return true;
}
void v8::V8::SetJitCodeEventHandler(
JitCodeEventOptions options, JitCodeEventHandler event_handler) {
i::Isolate* isolate = i::Isolate::Current();
// Ensure that logging is initialized for our isolate.
isolate->InitializeLoggingAndCounters();
isolate->logger()->SetCodeEventHandler(options, event_handler);
}
void v8::V8::SetArrayBufferAllocator( void v8::V8::SetArrayBufferAllocator(
ArrayBuffer::Allocator* allocator) { ArrayBuffer::Allocator* allocator) {
if (!Utils::ApiCheck(i::V8::ArrayBufferAllocator() == NULL, if (!Utils::ApiCheck(i::V8::ArrayBufferAllocator() == NULL,
...@@ -6616,8 +6577,7 @@ Isolate* Isolate::New(const Isolate::CreateParams& params) { ...@@ -6616,8 +6577,7 @@ Isolate* Isolate::New(const Isolate::CreateParams& params) {
isolate->logger()->SetCodeEventHandler(kJitCodeEventDefault, isolate->logger()->SetCodeEventHandler(kJitCodeEventDefault,
params.code_event_handler); params.code_event_handler);
} }
SetResourceConstraints(v8_isolate, SetResourceConstraints(isolate, params.constraints);
const_cast<ResourceConstraints*>(&params.constraints));
if (params.enable_serializer) { if (params.enable_serializer) {
isolate->enable_serializer(); isolate->enable_serializer();
} }
......
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