Commit e50161e5 authored by Camillo Bruni's avatar Camillo Bruni Committed by Commit Bot

[API] Advance API deprecation

Bug: v8:11165, v8:10096
Change-Id: I4be596f74a231641b8032e70063f47f4776ec6a8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2539919Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71212}
parent 87c81250
...@@ -1654,7 +1654,7 @@ class V8_EXPORT Module : public Data { ...@@ -1654,7 +1654,7 @@ class V8_EXPORT Module : public Data {
*/ */
V8_WARN_UNUSED_RESULT Maybe<bool> SetSyntheticModuleExport( V8_WARN_UNUSED_RESULT Maybe<bool> SetSyntheticModuleExport(
Isolate* isolate, Local<String> export_name, Local<Value> export_value); Isolate* isolate, Local<String> export_name, Local<Value> export_value);
V8_DEPRECATE_SOON( V8_DEPRECATED(
"Use the preceding SetSyntheticModuleExport with an Isolate parameter, " "Use the preceding SetSyntheticModuleExport with an Isolate parameter, "
"instead of the one that follows. The former will throw a runtime " "instead of the one that follows. The former will throw a runtime "
"error if called for an export that doesn't exist (as per spec); " "error if called for an export that doesn't exist (as per spec); "
...@@ -1839,7 +1839,7 @@ class V8_EXPORT ScriptCompiler { ...@@ -1839,7 +1839,7 @@ class V8_EXPORT ScriptCompiler {
public: public:
enum Encoding { ONE_BYTE, TWO_BYTE, UTF8 }; enum Encoding { ONE_BYTE, TWO_BYTE, UTF8 };
V8_DEPRECATE_SOON( V8_DEPRECATED(
"This class takes ownership of source_stream, so use the constructor " "This class takes ownership of source_stream, so use the constructor "
"taking a unique_ptr to make these semantics clearer") "taking a unique_ptr to make these semantics clearer")
StreamedSource(ExternalSourceStream* source_stream, Encoding encoding); StreamedSource(ExternalSourceStream* source_stream, Encoding encoding);
...@@ -1946,7 +1946,7 @@ class V8_EXPORT ScriptCompiler { ...@@ -1946,7 +1946,7 @@ class V8_EXPORT ScriptCompiler {
* This API allows to start the streaming with as little data as possible, and * This API allows to start the streaming with as little data as possible, and
* the remaining data (for example, the ScriptOrigin) is passed to Compile. * the remaining data (for example, the ScriptOrigin) is passed to Compile.
*/ */
V8_DEPRECATE_SOON("Use ScriptCompiler::StartStreamingScript instead.") V8_DEPRECATED("Use ScriptCompiler::StartStreamingScript instead.")
static ScriptStreamingTask* StartStreamingScript( static ScriptStreamingTask* StartStreamingScript(
Isolate* isolate, StreamedSource* source, Isolate* isolate, StreamedSource* source,
CompileOptions options = kNoCompileOptions); CompileOptions options = kNoCompileOptions);
...@@ -3452,7 +3452,7 @@ class V8_EXPORT Symbol : public Name { ...@@ -3452,7 +3452,7 @@ class V8_EXPORT Symbol : public Name {
*/ */
Local<Value> Description() const; Local<Value> Description() const;
V8_DEPRECATE_SOON("Use Symbol::Description()") V8_DEPRECATED("Use Symbol::Description()")
Local<Value> Name() const { return Description(); } Local<Value> Name() const { return Description(); }
/** /**
...@@ -7228,36 +7228,11 @@ class V8_EXPORT ResourceConstraints { ...@@ -7228,36 +7228,11 @@ class V8_EXPORT ResourceConstraints {
initial_young_generation_size_ = initial_size; initial_young_generation_size_ = initial_size;
} }
/**
* Deprecated functions. Do not use in new code.
*/
V8_DEPRECATED("Use code_range_size_in_bytes.")
size_t code_range_size() const { return code_range_size_ / kMB; }
V8_DEPRECATED("Use set_code_range_size_in_bytes.")
void set_code_range_size(size_t limit_in_mb) {
code_range_size_ = limit_in_mb * kMB;
}
V8_DEPRECATED("Use max_young_generation_size_in_bytes.")
size_t max_semi_space_size_in_kb() const;
V8_DEPRECATED("Use set_max_young_generation_size_in_bytes.")
void set_max_semi_space_size_in_kb(size_t limit_in_kb);
V8_DEPRECATED("Use max_old_generation_size_in_bytes.")
size_t max_old_space_size() const { return max_old_generation_size_ / kMB; }
V8_DEPRECATED("Use set_max_old_generation_size_in_bytes.")
void set_max_old_space_size(size_t limit_in_mb) {
max_old_generation_size_ = limit_in_mb * kMB;
}
V8_DEPRECATED("Zone does not pool memory any more.")
size_t max_zone_pool_size() const { return max_zone_pool_size_; }
V8_DEPRECATED("Zone does not pool memory any more.")
void set_max_zone_pool_size(size_t bytes) { max_zone_pool_size_ = bytes; }
private: private:
static constexpr size_t kMB = 1048576u; static constexpr size_t kMB = 1048576u;
size_t code_range_size_ = 0; size_t code_range_size_ = 0;
size_t max_old_generation_size_ = 0; size_t max_old_generation_size_ = 0;
size_t max_young_generation_size_ = 0; size_t max_young_generation_size_ = 0;
size_t max_zone_pool_size_ = 0;
size_t initial_old_generation_size_ = 0; size_t initial_old_generation_size_ = 0;
size_t initial_young_generation_size_ = 0; size_t initial_young_generation_size_ = 0;
uint32_t* stack_limit_ = nullptr; uint32_t* stack_limit_ = nullptr;
...@@ -8843,7 +8818,7 @@ class V8_EXPORT Isolate { ...@@ -8843,7 +8818,7 @@ class V8_EXPORT Isolate {
std::unique_ptr<MeasureMemoryDelegate> delegate, std::unique_ptr<MeasureMemoryDelegate> delegate,
MeasureMemoryExecution execution = MeasureMemoryExecution::kDefault); MeasureMemoryExecution execution = MeasureMemoryExecution::kDefault);
V8_DEPRECATE_SOON("Use the version with a delegate") V8_DEPRECATED("Use the version with a delegate")
MaybeLocal<Promise> MeasureMemory(Local<Context> context, MaybeLocal<Promise> MeasureMemory(Local<Context> context,
MeasureMemoryMode mode); MeasureMemoryMode mode);
...@@ -8906,10 +8881,6 @@ class V8_EXPORT Isolate { ...@@ -8906,10 +8881,6 @@ class V8_EXPORT Isolate {
*/ */
Local<Context> GetCurrentContext(); Local<Context> GetCurrentContext();
/** Returns the last context entered through V8's C++ API. */
V8_DEPRECATED("Use GetEnteredOrMicrotaskContext().")
Local<Context> GetEnteredContext();
/** /**
* Returns either the last context entered through V8's C++ API, or the * Returns either the last context entered through V8's C++ API, or the
* context of the currently running microtask while processing microtasks. * context of the currently running microtask while processing microtasks.
...@@ -9188,12 +9159,6 @@ class V8_EXPORT Isolate { ...@@ -9188,12 +9159,6 @@ class V8_EXPORT Isolate {
*/ */
void SetPromiseRejectCallback(PromiseRejectCallback callback); void SetPromiseRejectCallback(PromiseRejectCallback callback);
/**
* An alias for PerformMicrotaskCheckpoint.
*/
V8_DEPRECATED("Use PerformMicrotaskCheckpoint.")
void RunMicrotasks() { PerformMicrotaskCheckpoint(); }
/** /**
* Runs the default MicrotaskQueue until it gets empty and perform other * Runs the default MicrotaskQueue until it gets empty and perform other
* microtask checkpoint steps, such as calling ClearKeptObjects. Asserts that * microtask checkpoint steps, such as calling ClearKeptObjects. Asserts that
...@@ -9487,11 +9452,6 @@ class V8_EXPORT Isolate { ...@@ -9487,11 +9452,6 @@ class V8_EXPORT Isolate {
* strings should be allowed. * strings should be allowed.
*/ */
V8_DEPRECATED( V8_DEPRECATED(
"Use Isolate::SetModifyCodeGenerationFromStringsCallback instead. "
"See http://crbug.com/v8/10096.")
void SetAllowCodeGenerationFromStringsCallback(
AllowCodeGenerationFromStringsCallback callback);
V8_DEPRECATE_SOON(
"Use Isolate::SetModifyCodeGenerationFromStringsCallback with " "Use Isolate::SetModifyCodeGenerationFromStringsCallback with "
"ModifyCodeGenerationFromStringsCallback2 instead. See " "ModifyCodeGenerationFromStringsCallback2 instead. See "
"http://crbug.com/1096017 and TC39 Dynamic Code Brand Checks proposal " "http://crbug.com/1096017 and TC39 Dynamic Code Brand Checks proposal "
...@@ -9856,7 +9816,7 @@ class V8_EXPORT V8 { ...@@ -9856,7 +9816,7 @@ class V8_EXPORT V8 {
* \param context The third argument passed to the Linux signal handler, which * \param context The third argument passed to the Linux signal handler, which
* points to a ucontext_t structure. * points to a ucontext_t structure.
*/ */
V8_DEPRECATE_SOON("Use TryHandleWebAssemblyTrapPosix") V8_DEPRECATED("Use TryHandleWebAssemblyTrapPosix")
static bool TryHandleSignal(int signal_number, void* info, void* context); static bool TryHandleSignal(int signal_number, void* info, void* context);
#endif // V8_OS_POSIX #endif // V8_OS_POSIX
......
...@@ -954,17 +954,6 @@ void ResourceConstraints::ConfigureDefaults(uint64_t physical_memory, ...@@ -954,17 +954,6 @@ void ResourceConstraints::ConfigureDefaults(uint64_t physical_memory,
} }
} }
size_t ResourceConstraints::max_semi_space_size_in_kb() const {
return i::Heap::SemiSpaceSizeFromYoungGenerationSize(
max_young_generation_size_) /
i::KB;
}
void ResourceConstraints::set_max_semi_space_size_in_kb(size_t limit_in_kb) {
set_max_young_generation_size_in_bytes(
i::Heap::YoungGenerationSizeFromSemiSpaceSize(limit_in_kb * i::KB));
}
i::Address* V8::GlobalizeReference(i::Isolate* isolate, i::Address* obj) { i::Address* V8::GlobalizeReference(i::Isolate* isolate, i::Address* obj) {
LOG_API(isolate, Persistent, New); LOG_API(isolate, Persistent, New);
i::Handle<i::Object> result = isolate->global_handles()->Create(*obj); i::Handle<i::Object> result = isolate->global_handles()->Create(*obj);
...@@ -8172,14 +8161,6 @@ v8::Local<v8::Context> Isolate::GetCurrentContext() { ...@@ -8172,14 +8161,6 @@ v8::Local<v8::Context> Isolate::GetCurrentContext() {
return Utils::ToLocal(i::Handle<i::Context>(native_context, isolate)); return Utils::ToLocal(i::Handle<i::Context>(native_context, isolate));
} }
v8::Local<v8::Context> Isolate::GetEnteredContext() {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
i::Handle<i::Object> last =
isolate->handle_scope_implementer()->LastEnteredContext();
if (last.is_null()) return Local<Context>();
return Utils::ToLocal(i::Handle<i::Context>::cast(last));
}
v8::Local<v8::Context> Isolate::GetEnteredOrMicrotaskContext() { v8::Local<v8::Context> Isolate::GetEnteredOrMicrotaskContext() {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
i::Handle<i::Object> last = i::Handle<i::Object> last =
...@@ -9063,8 +9044,6 @@ size_t Isolate::CopyCodePages(size_t capacity, MemoryRange* code_pages_out) { ...@@ -9063,8 +9044,6 @@ size_t Isolate::CopyCodePages(size_t capacity, MemoryRange* code_pages_out) {
CALLBACK_SETTER(FatalErrorHandler, FatalErrorCallback, exception_behavior) CALLBACK_SETTER(FatalErrorHandler, FatalErrorCallback, exception_behavior)
CALLBACK_SETTER(OOMErrorHandler, OOMErrorCallback, oom_behavior) CALLBACK_SETTER(OOMErrorHandler, OOMErrorCallback, oom_behavior)
CALLBACK_SETTER(AllowCodeGenerationFromStringsCallback,
AllowCodeGenerationFromStringsCallback, allow_code_gen_callback)
CALLBACK_SETTER(ModifyCodeGenerationFromStringsCallback, CALLBACK_SETTER(ModifyCodeGenerationFromStringsCallback,
ModifyCodeGenerationFromStringsCallback, ModifyCodeGenerationFromStringsCallback,
modify_code_gen_callback) modify_code_gen_callback)
......
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