[api] Advance API deprecation for methods last changed in v9.7
Bug: v8:11165 Change-Id: I6d21b5ace124b6a47df983d5e3370d241f58f056 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3395880 Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Camillo Bruni <cbruni@chromium.org> Cr-Commit-Position: refs/heads/main@{#78785}
This commit is contained in:
parent
94ade104ea
commit
9cf4f1319d
@ -89,17 +89,6 @@ V8_PLATFORM_EXPORT void RunIdleTasks(v8::Platform* platform,
|
||||
v8::Isolate* isolate,
|
||||
double idle_time_in_seconds);
|
||||
|
||||
/**
|
||||
* Attempts to set the tracing controller for the given platform.
|
||||
*
|
||||
* The |platform| has to be created using |NewDefaultPlatform|.
|
||||
*
|
||||
*/
|
||||
V8_DEPRECATED("Access the DefaultPlatform directly")
|
||||
V8_PLATFORM_EXPORT void SetTracingController(
|
||||
v8::Platform* platform,
|
||||
v8::platform::tracing::TracingController* tracing_controller);
|
||||
|
||||
/**
|
||||
* Notifies the given platform about the Isolate getting deleted soon. Has to be
|
||||
* called for all Isolates which are deleted - unless we're shutting down the
|
||||
|
@ -313,17 +313,6 @@ class V8_EXPORT Context : public Data {
|
||||
explicit BackupIncumbentScope(Local<Context> backup_incumbent_context);
|
||||
~BackupIncumbentScope();
|
||||
|
||||
/**
|
||||
* Returns address that is comparable with JS stack address. Note that JS
|
||||
* stack may be allocated separately from the native stack. See also
|
||||
* |TryCatch::JSStackComparableAddressPrivate| for details.
|
||||
*/
|
||||
V8_DEPRECATED(
|
||||
"This is private V8 information that should not be exposed in the API.")
|
||||
uintptr_t JSStackComparableAddress() const {
|
||||
return JSStackComparableAddressPrivate();
|
||||
}
|
||||
|
||||
private:
|
||||
friend class internal::Isolate;
|
||||
|
||||
|
@ -124,14 +124,6 @@ class V8_EXPORT EmbedderHeapTracer {
|
||||
*/
|
||||
void SetStackStart(void* stack_start);
|
||||
|
||||
/**
|
||||
* Called by the embedder to notify V8 of an empty execution stack.
|
||||
*/
|
||||
V8_DEPRECATED(
|
||||
"This call only optimized internal caches which V8 is able to figure out "
|
||||
"on its own now.")
|
||||
void NotifyEmptyEmbedderStack();
|
||||
|
||||
/**
|
||||
* Called by v8 to register internal fields of found wrappers.
|
||||
*
|
||||
|
@ -169,13 +169,6 @@ class V8_EXPORT TryCatch {
|
||||
*/
|
||||
void SetCaptureMessage(bool value);
|
||||
|
||||
V8_DEPRECATED(
|
||||
"This is private information that should not be exposed by the API")
|
||||
static void* JSStackComparableAddress(TryCatch* handler) {
|
||||
if (handler == nullptr) return nullptr;
|
||||
return reinterpret_cast<void*>(handler->JSStackComparableAddressPrivate());
|
||||
}
|
||||
|
||||
TryCatch(const TryCatch&) = delete;
|
||||
void operator=(const TryCatch&) = delete;
|
||||
|
||||
|
@ -532,10 +532,6 @@ class V8_EXPORT CFunction {
|
||||
};
|
||||
};
|
||||
|
||||
struct V8_DEPRECATED("Use v8::Local<v8::Value> instead.") ApiObject {
|
||||
uintptr_t address;
|
||||
};
|
||||
|
||||
/**
|
||||
* A struct which may be passed to a fast call callback, like so:
|
||||
* \code
|
||||
@ -660,7 +656,6 @@ struct CTypeInfoTraits {};
|
||||
V(void, kVoid) \
|
||||
V(v8::Local<v8::Value>, kV8Value) \
|
||||
V(v8::Local<v8::Object>, kV8Value) \
|
||||
V(ApiObject, kApiObject) \
|
||||
V(AnyCType, kAny)
|
||||
|
||||
// ApiObject was a temporary solution to wrap the pointer to the v8::Value.
|
||||
|
@ -61,27 +61,6 @@ class ScriptOriginOptions {
|
||||
*/
|
||||
class V8_EXPORT ScriptOrigin {
|
||||
public:
|
||||
V8_DEPRECATED("Use constructor with primitive C++ types")
|
||||
ScriptOrigin(
|
||||
Local<Value> resource_name, Local<Integer> resource_line_offset,
|
||||
Local<Integer> resource_column_offset,
|
||||
Local<Boolean> resource_is_shared_cross_origin = Local<Boolean>(),
|
||||
Local<Integer> script_id = Local<Integer>(),
|
||||
Local<Value> source_map_url = Local<Value>(),
|
||||
Local<Boolean> resource_is_opaque = Local<Boolean>(),
|
||||
Local<Boolean> is_wasm = Local<Boolean>(),
|
||||
Local<Boolean> is_module = Local<Boolean>(),
|
||||
Local<Data> host_defined_options = Local<Data>());
|
||||
V8_DEPRECATED("Use constructor that takes an isolate")
|
||||
explicit ScriptOrigin(Local<Value> resource_name,
|
||||
int resource_line_offset = 0,
|
||||
int resource_column_offset = 0,
|
||||
bool resource_is_shared_cross_origin = false,
|
||||
int script_id = -1,
|
||||
Local<Value> source_map_url = Local<Value>(),
|
||||
bool resource_is_opaque = false, bool is_wasm = false,
|
||||
bool is_module = false,
|
||||
Local<Data> host_defined_options = Local<Data>());
|
||||
V8_INLINE ScriptOrigin(Isolate* isolate, Local<Value> resource_name,
|
||||
int resource_line_offset = 0,
|
||||
int resource_column_offset = 0,
|
||||
@ -104,12 +83,6 @@ class V8_EXPORT ScriptOrigin {
|
||||
}
|
||||
|
||||
V8_INLINE Local<Value> ResourceName() const;
|
||||
V8_DEPRECATED("Use getter with primitive C++ types.")
|
||||
V8_INLINE Local<Integer> ResourceLineOffset() const;
|
||||
V8_DEPRECATED("Use getter with primitive C++ types.")
|
||||
V8_INLINE Local<Integer> ResourceColumnOffset() const;
|
||||
V8_DEPRECATED("Use getter with primitive C++ types.")
|
||||
V8_INLINE Local<Integer> ScriptID() const;
|
||||
V8_INLINE int LineOffset() const;
|
||||
V8_INLINE int ColumnOffset() const;
|
||||
V8_INLINE int ScriptId() const;
|
||||
@ -228,18 +201,6 @@ class V8_EXPORT Message {
|
||||
|
||||
Local<Value> ScriptOrigin::ResourceName() const { return resource_name_; }
|
||||
|
||||
Local<Integer> ScriptOrigin::ResourceLineOffset() const {
|
||||
return v8::Integer::New(isolate_, resource_line_offset_);
|
||||
}
|
||||
|
||||
Local<Integer> ScriptOrigin::ResourceColumnOffset() const {
|
||||
return v8::Integer::New(isolate_, resource_column_offset_);
|
||||
}
|
||||
|
||||
Local<Integer> ScriptOrigin::ScriptID() const {
|
||||
return v8::Integer::New(isolate_, script_id_);
|
||||
}
|
||||
|
||||
Local<Data> ScriptOrigin::GetHostDefinedOptions() const {
|
||||
return host_defined_options_;
|
||||
}
|
||||
|
@ -585,8 +585,6 @@ class V8_EXPORT Symbol : public Name {
|
||||
/**
|
||||
* Returns the description string of the symbol, or undefined if none.
|
||||
*/
|
||||
V8_DEPRECATED("Use Symbol::Description(isolate)")
|
||||
Local<Value> Description() const;
|
||||
Local<Value> Description(Isolate* isolate) const;
|
||||
|
||||
/**
|
||||
|
@ -172,29 +172,6 @@ class V8_EXPORT Module : public Data {
|
||||
*/
|
||||
Local<Value> GetException() const;
|
||||
|
||||
/**
|
||||
* Returns the number of modules requested by this module.
|
||||
*/
|
||||
V8_DEPRECATED("Use Module::GetModuleRequests() and FixedArray::Length().")
|
||||
int GetModuleRequestsLength() const;
|
||||
|
||||
/**
|
||||
* Returns the ith module specifier in this module.
|
||||
* i must be < GetModuleRequestsLength() and >= 0.
|
||||
*/
|
||||
V8_DEPRECATED(
|
||||
"Use Module::GetModuleRequests() and ModuleRequest::GetSpecifier().")
|
||||
Local<String> GetModuleRequest(int i) const;
|
||||
|
||||
/**
|
||||
* Returns the source location (line number and column number) of the ith
|
||||
* module specifier's first occurrence in this module.
|
||||
*/
|
||||
V8_DEPRECATED(
|
||||
"Use Module::GetModuleRequests(), ModuleRequest::GetSourceOffset(), and "
|
||||
"Module::SourceOffsetToLocation().")
|
||||
Location GetModuleRequestLocation(int i) const;
|
||||
|
||||
/**
|
||||
* Returns the ModuleRequests for this module.
|
||||
*/
|
||||
@ -211,9 +188,6 @@ class V8_EXPORT Module : public Data {
|
||||
*/
|
||||
int GetIdentityHash() const;
|
||||
|
||||
using ResolveCallback V8_DEPRECATED("Use ResolveModuleCallback") =
|
||||
MaybeLocal<Module> (*)(Local<Context> context, Local<String> specifier,
|
||||
Local<Module> referrer);
|
||||
using ResolveModuleCallback = MaybeLocal<Module> (*)(
|
||||
Local<Context> context, Local<String> specifier,
|
||||
Local<FixedArray> import_assertions, Local<Module> referrer);
|
||||
@ -225,11 +199,6 @@ class V8_EXPORT Module : public Data {
|
||||
* instantiation. (In the case where the callback throws an exception, that
|
||||
* exception is propagated.)
|
||||
*/
|
||||
V8_DEPRECATED(
|
||||
"Use the version of InstantiateModule that takes a ResolveModuleCallback "
|
||||
"parameter")
|
||||
V8_WARN_UNUSED_RESULT Maybe<bool> InstantiateModule(Local<Context> context,
|
||||
ResolveCallback callback);
|
||||
V8_WARN_UNUSED_RESULT Maybe<bool> InstantiateModule(
|
||||
Local<Context> context, ResolveModuleCallback callback);
|
||||
|
||||
@ -474,18 +443,6 @@ class V8_EXPORT ScriptCompiler {
|
||||
* V8 has parsed the data it received so far.
|
||||
*/
|
||||
virtual size_t GetMoreData(const uint8_t** src) = 0;
|
||||
|
||||
/**
|
||||
* [DEPRECATED]: No longer used, will be removed soon.
|
||||
*/
|
||||
V8_DEPRECATED("Not used")
|
||||
virtual bool SetBookmark() { return false; }
|
||||
|
||||
/**
|
||||
* [DEPRECATED]: No longer used, will be removed soon.
|
||||
*/
|
||||
V8_DEPRECATED("Not used")
|
||||
virtual void ResetToBookmark() {}
|
||||
};
|
||||
|
||||
/**
|
||||
@ -693,7 +650,7 @@ class V8_EXPORT ScriptCompiler {
|
||||
* It is possible to specify multiple context extensions (obj in the above
|
||||
* example).
|
||||
*/
|
||||
V8_DEPRECATE_SOON("Use CompileFunction")
|
||||
V8_DEPRECATED("Use CompileFunction")
|
||||
static V8_WARN_UNUSED_RESULT MaybeLocal<Function> CompileFunctionInContext(
|
||||
Local<Context> context, Source* source, size_t arguments_count,
|
||||
Local<String> arguments[], size_t context_extension_count,
|
||||
|
125
src/api/api.cc
125
src/api/api.cc
@ -193,37 +193,6 @@ static ScriptOrigin GetScriptOriginForScript(i::Isolate* isolate,
|
||||
return origin;
|
||||
}
|
||||
|
||||
ScriptOrigin::ScriptOrigin(
|
||||
Local<Value> resource_name, Local<Integer> line_offset,
|
||||
Local<Integer> column_offset, Local<Boolean> is_shared_cross_origin,
|
||||
Local<Integer> script_id, Local<Value> source_map_url,
|
||||
Local<Boolean> is_opaque, Local<Boolean> is_wasm, Local<Boolean> is_module,
|
||||
Local<Data> host_defined_options)
|
||||
: ScriptOrigin(
|
||||
Isolate::GetCurrent(), resource_name,
|
||||
line_offset.IsEmpty() ? 0 : static_cast<int>(line_offset->Value()),
|
||||
column_offset.IsEmpty() ? 0
|
||||
: static_cast<int>(column_offset->Value()),
|
||||
!is_shared_cross_origin.IsEmpty() && is_shared_cross_origin->IsTrue(),
|
||||
static_cast<int>(script_id.IsEmpty() ? -1 : script_id->Value()),
|
||||
source_map_url, !is_opaque.IsEmpty() && is_opaque->IsTrue(),
|
||||
!is_wasm.IsEmpty() && is_wasm->IsTrue(),
|
||||
!is_module.IsEmpty() && is_module->IsTrue(), host_defined_options) {}
|
||||
|
||||
ScriptOrigin::ScriptOrigin(Local<Value> resource_name, int line_offset,
|
||||
int column_offset, bool is_shared_cross_origin,
|
||||
int script_id, Local<Value> source_map_url,
|
||||
bool is_opaque, bool is_wasm, bool is_module,
|
||||
Local<Data> host_defined_options)
|
||||
: isolate_(Isolate::GetCurrent()),
|
||||
resource_name_(resource_name),
|
||||
resource_line_offset_(line_offset),
|
||||
resource_column_offset_(column_offset),
|
||||
options_(is_shared_cross_origin, is_opaque, is_wasm, is_module),
|
||||
script_id_(script_id),
|
||||
source_map_url_(source_map_url),
|
||||
host_defined_options_(host_defined_options) {}
|
||||
|
||||
Local<PrimitiveArray> ScriptOrigin::HostDefinedOptions() const {
|
||||
// TODO(cbruni, chromium:1244145): remove once migrated to the context.
|
||||
Utils::ApiCheck(!host_defined_options_->IsFixedArray(),
|
||||
@ -2292,56 +2261,6 @@ Local<Value> Module::GetException() const {
|
||||
return ToApiHandle<Value>(i::handle(self->GetException(), isolate));
|
||||
}
|
||||
|
||||
int Module::GetModuleRequestsLength() const {
|
||||
i::Module self = *Utils::OpenHandle(this);
|
||||
if (self.IsSyntheticModule()) return 0;
|
||||
ASSERT_NO_SCRIPT_NO_EXCEPTION(self.GetIsolate());
|
||||
return i::SourceTextModule::cast(self).info().module_requests().length();
|
||||
}
|
||||
|
||||
Local<String> Module::GetModuleRequest(int i) const {
|
||||
Utils::ApiCheck(i >= 0, "v8::Module::GetModuleRequest",
|
||||
"index must be positive");
|
||||
i::Handle<i::Module> self = Utils::OpenHandle(this);
|
||||
Utils::ApiCheck(self->IsSourceTextModule(), "v8::Module::GetModuleRequest",
|
||||
"Expected SourceTextModule");
|
||||
i::Isolate* isolate = self->GetIsolate();
|
||||
ASSERT_NO_SCRIPT_NO_EXCEPTION(isolate);
|
||||
i::Handle<i::FixedArray> module_requests(
|
||||
i::Handle<i::SourceTextModule>::cast(self)->info().module_requests(),
|
||||
isolate);
|
||||
Utils::ApiCheck(i < module_requests->length(), "v8::Module::GetModuleRequest",
|
||||
"index is out of bounds");
|
||||
i::Handle<i::ModuleRequest> module_request(
|
||||
i::ModuleRequest::cast(module_requests->get(i)), isolate);
|
||||
return ToApiHandle<String>(i::handle(module_request->specifier(), isolate));
|
||||
}
|
||||
|
||||
Location Module::GetModuleRequestLocation(int i) const {
|
||||
Utils::ApiCheck(i >= 0, "v8::Module::GetModuleRequest",
|
||||
"index must be positive");
|
||||
i::Handle<i::Module> self = Utils::OpenHandle(this);
|
||||
i::Isolate* isolate = self->GetIsolate();
|
||||
ASSERT_NO_SCRIPT_NO_EXCEPTION(isolate);
|
||||
i::HandleScope scope(isolate);
|
||||
Utils::ApiCheck(self->IsSourceTextModule(),
|
||||
"Module::GetModuleRequestLocation",
|
||||
"Expected SourceTextModule");
|
||||
i::Handle<i::FixedArray> module_requests(
|
||||
i::Handle<i::SourceTextModule>::cast(self)->info().module_requests(),
|
||||
isolate);
|
||||
Utils::ApiCheck(i < module_requests->length(), "v8::Module::GetModuleRequest",
|
||||
"index is out of bounds");
|
||||
i::Handle<i::ModuleRequest> module_request(
|
||||
i::ModuleRequest::cast(module_requests->get(i)), isolate);
|
||||
int position = module_request->position();
|
||||
i::Handle<i::Script> script(
|
||||
i::Handle<i::SourceTextModule>::cast(self)->GetScript(), isolate);
|
||||
i::Script::PositionInfo info;
|
||||
i::Script::GetPositionInfo(script, position, &info, i::Script::WITH_OFFSET);
|
||||
return v8::Location(info.line, info.column);
|
||||
}
|
||||
|
||||
Local<FixedArray> Module::GetModuleRequests() const {
|
||||
i::Handle<i::Module> self = Utils::OpenHandle(this);
|
||||
if (self->IsSyntheticModule()) {
|
||||
@ -2425,19 +2344,6 @@ bool Module::IsSyntheticModule() const {
|
||||
|
||||
int Module::GetIdentityHash() const { return Utils::OpenHandle(this)->hash(); }
|
||||
|
||||
Maybe<bool> Module::InstantiateModule(Local<Context> context,
|
||||
Module::ResolveCallback callback) {
|
||||
auto isolate = reinterpret_cast<i::Isolate*>(context->GetIsolate());
|
||||
ENTER_V8(isolate, context, Module, InstantiateModule, Nothing<bool>(),
|
||||
i::HandleScope);
|
||||
ResolveModuleCallback callback_with_import_assertions = nullptr;
|
||||
has_pending_exception =
|
||||
!i::Module::Instantiate(isolate, Utils::OpenHandle(this), context,
|
||||
callback_with_import_assertions, callback);
|
||||
RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
|
||||
return Just(true);
|
||||
}
|
||||
|
||||
Maybe<bool> Module::InstantiateModule(Local<Context> context,
|
||||
Module::ResolveModuleCallback callback) {
|
||||
auto isolate = reinterpret_cast<i::Isolate*>(context->GetIsolate());
|
||||
@ -3064,6 +2970,7 @@ ScriptOrigin Message::GetScriptOrigin() const {
|
||||
void ScriptOrigin::VerifyHostDefinedOptions() const {
|
||||
// TODO(cbruni, chromium:1244145): Remove checks once we allow arbitrary
|
||||
// host-defined options.
|
||||
USE(isolate_);
|
||||
if (host_defined_options_.IsEmpty()) return;
|
||||
Utils::ApiCheck(host_defined_options_->IsFixedArray(), "ScriptOrigin()",
|
||||
"Host-defined options has to be a PrimitiveArray");
|
||||
@ -5919,28 +5826,6 @@ v8::String::GetExternalOneByteStringResource() const {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Local<Value> Symbol::Description() const {
|
||||
i::Handle<i::Symbol> sym = Utils::OpenHandle(this);
|
||||
|
||||
i::Isolate* isolate;
|
||||
if (!i::GetIsolateFromHeapObject(*sym, &isolate)) {
|
||||
// Symbol is in RO_SPACE, which means that its description is also in
|
||||
// RO_SPACE. Since RO_SPACE objects are immovable we can use the
|
||||
// Handle(Address*) constructor with the address of the description
|
||||
// field in the Symbol object without needing an isolate.
|
||||
DCHECK(!COMPRESS_POINTERS_IN_ISOLATE_CAGE_BOOL);
|
||||
#ifndef V8_COMPRESS_POINTERS_IN_SHARED_CAGE
|
||||
i::Handle<i::HeapObject> ro_description(reinterpret_cast<i::Address*>(
|
||||
sym->GetFieldAddress(i::Symbol::kDescriptionOffset)));
|
||||
return Utils::ToLocal(ro_description);
|
||||
#else
|
||||
isolate = reinterpret_cast<i::Isolate*>(Isolate::GetCurrent());
|
||||
#endif
|
||||
}
|
||||
|
||||
return Description(reinterpret_cast<Isolate*>(isolate));
|
||||
}
|
||||
|
||||
Local<Value> Symbol::Description(Isolate* isolate) const {
|
||||
i::Handle<i::Symbol> sym = Utils::OpenHandle(this);
|
||||
i::Handle<i::Object> description(sym->description(),
|
||||
@ -10319,14 +10204,6 @@ void EmbedderHeapTracer::SetStackStart(void* stack_start) {
|
||||
stack_start);
|
||||
}
|
||||
|
||||
void EmbedderHeapTracer::NotifyEmptyEmbedderStack() {
|
||||
CHECK(isolate_);
|
||||
reinterpret_cast<i::Isolate*>(isolate_)
|
||||
->heap()
|
||||
->local_embedder_heap_tracer()
|
||||
->NotifyEmptyEmbedderStack();
|
||||
}
|
||||
|
||||
void EmbedderHeapTracer::FinalizeTracing() {
|
||||
if (isolate_) {
|
||||
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(isolate_);
|
||||
|
@ -87,13 +87,6 @@ void RunIdleTasks(v8::Platform* platform, v8::Isolate* isolate,
|
||||
idle_time_in_seconds);
|
||||
}
|
||||
|
||||
void SetTracingController(
|
||||
v8::Platform* platform,
|
||||
v8::platform::tracing::TracingController* tracing_controller) {
|
||||
static_cast<DefaultPlatform*>(platform)->SetTracingController(
|
||||
std::unique_ptr<v8::TracingController>(tracing_controller));
|
||||
}
|
||||
|
||||
void NotifyIsolateShutdown(v8::Platform* platform, Isolate* isolate) {
|
||||
static_cast<DefaultPlatform*>(platform)->NotifyIsolateShutdown(isolate);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user