[api] remove deprecated snapshot APIs
R=verwaest@chromium.org Fixed: v8:7463 Change-Id: I3d0127865ad0430d38124c3ad8ed3bc63ba4e6d3 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2149421 Auto-Submit: Yang Guo <yangguo@chromium.org> Commit-Queue: Toon Verwaest <verwaest@chromium.org> Reviewed-by: Toon Verwaest <verwaest@chromium.org> Cr-Commit-Position: refs/heads/master@{#67169}
This commit is contained in:
parent
8d368f09ac
commit
fa3e37e511
17
include/v8.h
17
include/v8.h
@ -6449,11 +6449,6 @@ class V8_EXPORT FunctionTemplate : public Template {
|
||||
SideEffectType side_effect_type = SideEffectType::kHasSideEffect,
|
||||
const CFunction* c_function = nullptr);
|
||||
|
||||
/** Get a template included in the snapshot by index. */
|
||||
V8_DEPRECATED("Use v8::Isolate::GetDataFromSnapshotOnce instead")
|
||||
static MaybeLocal<FunctionTemplate> FromSnapshot(Isolate* isolate,
|
||||
size_t index);
|
||||
|
||||
/**
|
||||
* Creates a function template backed/cached by a private property.
|
||||
*/
|
||||
@ -6743,11 +6738,6 @@ class V8_EXPORT ObjectTemplate : public Template {
|
||||
Isolate* isolate,
|
||||
Local<FunctionTemplate> constructor = Local<FunctionTemplate>());
|
||||
|
||||
/** Get a template included in the snapshot by index. */
|
||||
V8_DEPRECATED("Use v8::Isolate::GetDataFromSnapshotOnce instead")
|
||||
static MaybeLocal<ObjectTemplate> FromSnapshot(Isolate* isolate,
|
||||
size_t index);
|
||||
|
||||
/** Creates a new instance of this template.*/
|
||||
V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(Local<Context> context);
|
||||
|
||||
@ -9899,13 +9889,6 @@ class V8_EXPORT SnapshotCreator {
|
||||
SerializeInternalFieldsCallback callback =
|
||||
SerializeInternalFieldsCallback());
|
||||
|
||||
/**
|
||||
* Add a template to be included in the snapshot blob.
|
||||
* \returns the index of the template in the snapshot blob.
|
||||
*/
|
||||
V8_DEPRECATED("use AddData instead")
|
||||
size_t AddTemplate(Local<Template> template_obj);
|
||||
|
||||
/**
|
||||
* Attach arbitrary V8::Data to the context snapshot, which can be retrieved
|
||||
* via Context::GetDataFromSnapshot after deserialization. This data does not
|
||||
|
@ -659,10 +659,6 @@ size_t SnapshotCreator::AddContext(Local<Context> context,
|
||||
return index;
|
||||
}
|
||||
|
||||
size_t SnapshotCreator::AddTemplate(Local<Template> template_obj) {
|
||||
return AddData(template_obj);
|
||||
}
|
||||
|
||||
size_t SnapshotCreator::AddData(i::Address object) {
|
||||
DCHECK_NE(object, i::kNullAddress);
|
||||
SnapshotCreatorData* data = SnapshotCreatorData::cast(data_);
|
||||
@ -1523,21 +1519,6 @@ Local<FunctionTemplate> FunctionTemplate::New(
|
||||
return templ;
|
||||
}
|
||||
|
||||
MaybeLocal<FunctionTemplate> FunctionTemplate::FromSnapshot(Isolate* isolate,
|
||||
size_t index) {
|
||||
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
|
||||
i::FixedArray serialized_objects = i_isolate->heap()->serialized_objects();
|
||||
int int_index = static_cast<int>(index);
|
||||
if (int_index < serialized_objects.length()) {
|
||||
i::Object info = serialized_objects.get(int_index);
|
||||
if (info.IsFunctionTemplateInfo()) {
|
||||
return Utils::ToLocal(i::Handle<i::FunctionTemplateInfo>(
|
||||
i::FunctionTemplateInfo::cast(info), i_isolate));
|
||||
}
|
||||
}
|
||||
return Local<FunctionTemplate>();
|
||||
}
|
||||
|
||||
Local<FunctionTemplate> FunctionTemplate::NewWithCache(
|
||||
Isolate* isolate, FunctionCallback callback, Local<Private> cache_property,
|
||||
Local<Value> data, Local<Signature> signature, int length,
|
||||
@ -1731,21 +1712,6 @@ Local<ObjectTemplate> ObjectTemplate::New(
|
||||
return ObjectTemplateNew(isolate, constructor, false);
|
||||
}
|
||||
|
||||
MaybeLocal<ObjectTemplate> ObjectTemplate::FromSnapshot(Isolate* isolate,
|
||||
size_t index) {
|
||||
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
|
||||
i::FixedArray serialized_objects = i_isolate->heap()->serialized_objects();
|
||||
int int_index = static_cast<int>(index);
|
||||
if (int_index < serialized_objects.length()) {
|
||||
i::Object info = serialized_objects.get(int_index);
|
||||
if (info.IsObjectTemplateInfo()) {
|
||||
return Utils::ToLocal(i::Handle<i::ObjectTemplateInfo>(
|
||||
i::ObjectTemplateInfo::cast(info), i_isolate));
|
||||
}
|
||||
}
|
||||
return Local<ObjectTemplate>();
|
||||
}
|
||||
|
||||
// Ensure that the object template has a constructor. If no
|
||||
// constructor is available we create one.
|
||||
static i::Handle<i::FunctionTemplateInfo> EnsureConstructor(
|
||||
|
Loading…
Reference in New Issue
Block a user