Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
deps: V8: cherry-pick fa3e37e511ee
Original commit message:

    [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}

Refs: v8/v8@fa3e37e
  • Loading branch information
addaleax authored and targos committed Apr 18, 2020
commit 34b5e8e8e37707aabcce50cfb614d544ee785c3f
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.17',
'v8_embedder_string': '-node.18',

##### V8 defaults for Node.js #####

Expand Down
17 changes: 0 additions & 17 deletions deps/v8/include/v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -6382,11 +6382,6 @@ class V8_EXPORT FunctionTemplate : public Template {
ConstructorBehavior behavior = ConstructorBehavior::kAllow,
SideEffectType side_effect_type = SideEffectType::kHasSideEffect);

/** 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.
*/
Expand Down Expand Up @@ -6674,11 +6669,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);

Expand Down Expand Up @@ -9766,13 +9756,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
Expand Down
34 changes: 0 additions & 34 deletions deps/v8/src/api/api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -631,10 +631,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_);
Expand Down Expand Up @@ -1490,21 +1486,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,
Expand Down Expand Up @@ -1687,21 +1668,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(
Expand Down