Remove a couple of deprecated APIs that moved to Isolate
authorjochen@chromium.org <jochen@chromium.org>
Fri, 19 Sep 2014 11:27:54 +0000 (11:27 +0000)
committerjochen@chromium.org <jochen@chromium.org>
Fri, 19 Sep 2014 11:27:54 +0000 (11:27 +0000)
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

include/v8.h
src/api.cc

index 26d8710..ec1941e 100644 (file)
@@ -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 ---
 
 
@@ -5130,50 +5120,6 @@ class V8_EXPORT V8 {
       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
    * in the given isolate.
    *
index 107c7e8..e11d140 100644 (file)
@@ -471,30 +471,23 @@ void ResourceConstraints::ConfigureDefaults(uint64_t physical_memory,
 }
 
 
-bool SetResourceConstraints(Isolate* v8_isolate,
-                            ResourceConstraints* constraints) {
-  i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
-  int semi_space_size = constraints->max_semi_space_size();
-  int old_space_size = constraints->max_old_space_size();
-  int max_executable_size = constraints->max_executable_size();
-  size_t code_range_size = constraints->code_range_size();
+void SetResourceConstraints(i::Isolate* isolate,
+                            const ResourceConstraints& constraints) {
+  int semi_space_size = constraints.max_semi_space_size();
+  int old_space_size = constraints.max_old_space_size();
+  int max_executable_size = constraints.max_executable_size();
+  size_t code_range_size = constraints.code_range_size();
   if (semi_space_size != 0 || old_space_size != 0 ||
       max_executable_size != 0 || code_range_size != 0) {
-    // After initialization it's too late to change Heap constraints.
-    DCHECK(!isolate->IsInitialized());
-    bool result = isolate->heap()->ConfigureHeap(semi_space_size,
-                                                 old_space_size,
-                                                 max_executable_size,
-                                                 code_range_size);
-    if (!result) return false;
-  }
-  if (constraints->stack_limit() != NULL) {
-    uintptr_t limit = reinterpret_cast<uintptr_t>(constraints->stack_limit());
+    isolate->heap()->ConfigureHeap(semi_space_size, old_space_size,
+                                   max_executable_size, code_range_size);
+  }
+  if (constraints.stack_limit() != NULL) {
+    uintptr_t limit = reinterpret_cast<uintptr_t>(constraints.stack_limit());
     isolate->stack_guard()->SetStackLimit(limit);
   }
 
-  isolate->set_max_available_threads(constraints->max_available_threads());
-  return true;
+  isolate->set_max_available_threads(constraints.max_available_threads());
 }
 
 
@@ -5065,38 +5058,6 @@ void v8::V8::SetReturnAddressLocationResolver(
   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(
     ArrayBuffer::Allocator* allocator) {
   if (!Utils::ApiCheck(i::V8::ArrayBufferAllocator() == NULL,
@@ -6616,8 +6577,7 @@ Isolate* Isolate::New(const Isolate::CreateParams& params) {
     isolate->logger()->SetCodeEventHandler(kJitCodeEventDefault,
                                            params.code_event_handler);
   }
-  SetResourceConstraints(v8_isolate,
-                         const_cast<ResourceConstraints*>(&params.constraints));
+  SetResourceConstraints(isolate, params.constraints);
   if (params.enable_serializer) {
     isolate->enable_serializer();
   }