From 8629a319f1476da385954da6f5a90be4ac9520dd Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Thu, 16 Apr 2020 17:46:07 +0200 Subject: [PATCH 01/19] deps: V8: cherry-pick 4b1447e4bb0e MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Original commit message: Improve V8 GC logic for external memory The logic for V8 GC normally only takes the external memory growth since last mark-compact into account. Unfortunately, the amount of external memory recorded at the end of MC is often too high. The reason is that it might take a while for the external memory associated with the GCed objects to be released (e.g. V8 itself post a task to release external memory for ArrayBuffer backing stores). In a worst case scenario GC is driven only by external memory and none of the external memory is released by the end of the MC. Then each MC will record the external memory at its highest point and the GC logic will allow the external memory to grow a bit higher each time which can lead to excessive memory use. This patch improves the situation a bit by calculating the growth from the lowest external memory seen since the last MC. That way the growth calculation will be offset from a level presumably closer to the intended one (to what it would have been if the external memory associated with the GCed objects was released during the MC). Now, this fix is not perfect because it can be thrown off by external memory growth occurring before the lingering memory is released. However, it seems to work rather well in practice (e.g. when playing MSE video on YT). Bug: v8:10185 Change-Id: Ifcdd87eb45f3ae4a99d2aeec667c3ae4ca9a52b6 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2042711 Reviewed-by: Ulan Degenbaev Reviewed-by: Dominik Inführ Reviewed-by: Jakob Gruber Commit-Queue: Dominik Inführ Cr-Commit-Position: refs/heads/master@{#66193} Refs: https://github.com/v8/v8/commit/4b1447e4bb0e306c40214026342858664a13b551 --- common.gypi | 2 +- deps/v8/include/v8-internal.h | 4 ++-- deps/v8/include/v8.h | 27 +++++++++++++-------------- deps/v8/src/execution/isolate-data.h | 9 +++++---- deps/v8/src/execution/isolate.cc | 6 +++--- deps/v8/src/heap/heap-inl.h | 13 ++++++++++--- deps/v8/src/heap/heap.cc | 10 +++++----- 7 files changed, 39 insertions(+), 32 deletions(-) diff --git a/common.gypi b/common.gypi index fb364b55f5e63e..b23898301a4898 100644 --- a/common.gypi +++ b/common.gypi @@ -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.12', + 'v8_embedder_string': '-node.13', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/include/v8-internal.h b/deps/v8/include/v8-internal.h index e4d698e6ce7e4c..876408ebba98f9 100644 --- a/deps/v8/include/v8-internal.h +++ b/deps/v8/include/v8-internal.h @@ -160,10 +160,10 @@ class Internals { kNumIsolateDataSlots * kApiSystemPointerSize; static const int kExternalMemoryLimitOffset = kExternalMemoryOffset + kApiInt64Size; - static const int kExternalMemoryAtLastMarkCompactOffset = + static const int kExternalMemoryLowSinceMarkCompactOffset = kExternalMemoryLimitOffset + kApiInt64Size; static const int kIsolateFastCCallCallerFpOffset = - kExternalMemoryAtLastMarkCompactOffset + kApiInt64Size; + kExternalMemoryLowSinceMarkCompactOffset + kApiInt64Size; static const int kIsolateFastCCallCallerPcOffset = kIsolateFastCCallCallerFpOffset + kApiSystemPointerSize; static const int kIsolateStackGuardOffset = diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h index 54bc4f08359125..13724930103db1 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -11854,9 +11854,9 @@ int64_t Isolate::AdjustAmountOfExternalAllocatedMemory( reinterpret_cast(this) + I::kExternalMemoryOffset); int64_t* external_memory_limit = reinterpret_cast( reinterpret_cast(this) + I::kExternalMemoryLimitOffset); - int64_t* external_memory_at_last_mc = + int64_t* external_memory_low_since_mc = reinterpret_cast(reinterpret_cast(this) + - I::kExternalMemoryAtLastMarkCompactOffset); + I::kExternalMemoryLowSinceMarkCompactOffset); // Embedders are weird: we see both over- and underflows here. Perform the // addition with unsigned types to avoid undefined behavior. @@ -11865,23 +11865,22 @@ int64_t Isolate::AdjustAmountOfExternalAllocatedMemory( static_cast(*external_memory)); *external_memory = amount; - int64_t allocation_diff_since_last_mc = - static_cast(static_cast(*external_memory) - - static_cast(*external_memory_at_last_mc)); + if (amount < *external_memory_low_since_mc) { + *external_memory_low_since_mc = amount; + *external_memory_limit = amount + I::kExternalAllocationSoftLimit; + } + + if (change_in_bytes <= 0) return *external_memory; + + int64_t allocation_diff_since_last_mc = static_cast( + static_cast(*external_memory) - + static_cast(*external_memory_low_since_mc)); // Only check memory pressure and potentially trigger GC if the amount of // external memory increased. if (allocation_diff_since_last_mc > kMemoryReducerActivationLimit) { CheckMemoryPressure(); } - - if (change_in_bytes < 0) { - const int64_t lower_limit = - static_cast(static_cast(*external_memory_limit) + - static_cast(change_in_bytes)); - if (lower_limit > I::kExternalAllocationSoftLimit) { - *external_memory_limit = lower_limit; - } - } else if (change_in_bytes > 0 && amount > *external_memory_limit) { + if (amount > *external_memory_limit) { ReportExternalAllocationLimitReached(); } return *external_memory; diff --git a/deps/v8/src/execution/isolate-data.h b/deps/v8/src/execution/isolate-data.h index f402296ab54c22..c30c6eb80d3bc3 100644 --- a/deps/v8/src/execution/isolate-data.h +++ b/deps/v8/src/execution/isolate-data.h @@ -117,7 +117,7 @@ class IsolateData final { V(kEmbedderDataOffset, Internals::kNumIsolateDataSlots* kSystemPointerSize) \ V(kExternalMemoryOffset, kInt64Size) \ V(kExternalMemoryLlimitOffset, kInt64Size) \ - V(kExternalMemoryAtLastMarkCompactOffset, kInt64Size) \ + V(kExternalMemoryLowSinceMarkCompactOffset, kInt64Size) \ V(kFastCCallCallerFPOffset, kSystemPointerSize) \ V(kFastCCallCallerPCOffset, kSystemPointerSize) \ V(kStackGuardOffset, StackGuard::kSizeInBytes) \ @@ -151,7 +151,7 @@ class IsolateData final { int64_t external_memory_limit_ = kExternalAllocationSoftLimit; // Caches the amount of external memory registered at the last MC. - int64_t external_memory_at_last_mark_compact_ = 0; + int64_t external_memory_low_since_mark_compact_ = 0; // Stores the state of the caller for TurboAssembler::CallCFunction so that // the sampling CPU profiler can iterate the stack during such calls. These @@ -220,8 +220,9 @@ void IsolateData::AssertPredictableLayout() { kExternalMemoryOffset); STATIC_ASSERT(offsetof(IsolateData, external_memory_limit_) == kExternalMemoryLlimitOffset); - STATIC_ASSERT(offsetof(IsolateData, external_memory_at_last_mark_compact_) == - kExternalMemoryAtLastMarkCompactOffset); + STATIC_ASSERT( + offsetof(IsolateData, external_memory_low_since_mark_compact_) == + kExternalMemoryLowSinceMarkCompactOffset); STATIC_ASSERT(offsetof(IsolateData, fast_c_call_caller_fp_) == kFastCCallCallerFPOffset); STATIC_ASSERT(offsetof(IsolateData, fast_c_call_caller_pc_) == diff --git a/deps/v8/src/execution/isolate.cc b/deps/v8/src/execution/isolate.cc index 3da8963c53fb32..1bedc20822c08c 100644 --- a/deps/v8/src/execution/isolate.cc +++ b/deps/v8/src/execution/isolate.cc @@ -2900,10 +2900,10 @@ void Isolate::CheckIsolateLayout() { CHECK_EQ(static_cast( OFFSET_OF(Isolate, isolate_data_.external_memory_limit_)), Internals::kExternalMemoryLimitOffset); - CHECK_EQ(Internals::kExternalMemoryAtLastMarkCompactOffset % 8, 0); + CHECK_EQ(Internals::kExternalMemoryLowSinceMarkCompactOffset % 8, 0); CHECK_EQ(static_cast(OFFSET_OF( - Isolate, isolate_data_.external_memory_at_last_mark_compact_)), - Internals::kExternalMemoryAtLastMarkCompactOffset); + Isolate, isolate_data_.external_memory_low_since_mark_compact_)), + Internals::kExternalMemoryLowSinceMarkCompactOffset); } void Isolate::ClearSerializerData() { diff --git a/deps/v8/src/heap/heap-inl.h b/deps/v8/src/heap/heap-inl.h index 0e5230f1e05d22..0da0b35d392d8a 100644 --- a/deps/v8/src/heap/heap-inl.h +++ b/deps/v8/src/heap/heap-inl.h @@ -65,7 +65,14 @@ int64_t Heap::external_memory() { } void Heap::update_external_memory(int64_t delta) { - isolate()->isolate_data()->external_memory_ += delta; + const int64_t amount = isolate()->isolate_data()->external_memory_ + delta; + isolate()->isolate_data()->external_memory_ = amount; + if (amount < + isolate()->isolate_data()->external_memory_low_since_mark_compact_) { + isolate()->isolate_data()->external_memory_low_since_mark_compact_ = amount; + isolate()->isolate_data()->external_memory_limit_ = + amount + kExternalAllocationSoftLimit; + } } void Heap::update_external_memory_concurrently_freed(uintptr_t freed) { @@ -73,8 +80,8 @@ void Heap::update_external_memory_concurrently_freed(uintptr_t freed) { } void Heap::account_external_memory_concurrently_freed() { - isolate()->isolate_data()->external_memory_ -= - external_memory_concurrently_freed_; + update_external_memory( + -static_cast(external_memory_concurrently_freed_)); external_memory_concurrently_freed_ = 0; } diff --git a/deps/v8/src/heap/heap.cc b/deps/v8/src/heap/heap.cc index 28ff2e970d15a4..7e11c8626027d9 100644 --- a/deps/v8/src/heap/heap.cc +++ b/deps/v8/src/heap/heap.cc @@ -1452,7 +1452,7 @@ void Heap::ReportExternalMemoryPressure() { kGCCallbackFlagSynchronousPhantomCallbackProcessing | kGCCallbackFlagCollectAllExternalMemory); if (isolate()->isolate_data()->external_memory_ > - (isolate()->isolate_data()->external_memory_at_last_mark_compact_ + + (isolate()->isolate_data()->external_memory_low_since_mark_compact_ + external_memory_hard_limit())) { CollectAllGarbage( kReduceMemoryFootprintMask, @@ -2143,7 +2143,7 @@ void Heap::RecomputeLimits(GarbageCollector collector) { if (collector == MARK_COMPACTOR) { // Register the amount of external allocated memory. - isolate()->isolate_data()->external_memory_at_last_mark_compact_ = + isolate()->isolate_data()->external_memory_low_since_mark_compact_ = isolate()->isolate_data()->external_memory_; isolate()->isolate_data()->external_memory_limit_ = isolate()->isolate_data()->external_memory_ + @@ -4743,12 +4743,12 @@ size_t Heap::GlobalSizeOfObjects() { uint64_t Heap::PromotedExternalMemorySize() { IsolateData* isolate_data = isolate()->isolate_data(); if (isolate_data->external_memory_ <= - isolate_data->external_memory_at_last_mark_compact_) { + isolate_data->external_memory_low_since_mark_compact_) { return 0; } return static_cast( isolate_data->external_memory_ - - isolate_data->external_memory_at_last_mark_compact_); + isolate_data->external_memory_low_since_mark_compact_); } bool Heap::AllocationLimitOvershotByLargeMargin() { @@ -4871,7 +4871,7 @@ Heap::IncrementalMarkingLimit Heap::IncrementalMarkingLimitReached() { double gained_since_last_gc = PromotedSinceLastGC() + (isolate()->isolate_data()->external_memory_ - - isolate()->isolate_data()->external_memory_at_last_mark_compact_); + isolate()->isolate_data()->external_memory_low_since_mark_compact_); double size_before_gc = OldGenerationObjectsAndPromotedExternalMemorySize() - gained_since_last_gc; From 25f8c9dfc7ea2715ba4b6e095fd6d2928af0d27a Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Thu, 16 Apr 2020 17:47:07 +0200 Subject: [PATCH 02/19] deps: V8: cherry-pick 2db93c023379 Original commit message: [api] Add embedder-vs-V8 build configuration compatibility check v8::V8::Initialize() will fail with meaningful error upon build configuration mismatch. Bug: v8:10041 Change-Id: Ic69ba68ef1764b356beef0f204fe58b45bae3c49 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2144953 Commit-Queue: Igor Sheludko Reviewed-by: Ulan Degenbaev Cr-Commit-Position: refs/heads/master@{#67116} Refs: https://github.com/v8/v8/commit/2db93c0233790b2cfb9e80fa1fa89dee18c7109f --- common.gypi | 2 +- deps/v8/include/v8-internal.h | 4 ++++ deps/v8/include/v8.h | 18 +++++++++++++++++- deps/v8/src/api/api.cc | 20 +++++++++++++++++++- 4 files changed, 41 insertions(+), 3 deletions(-) diff --git a/common.gypi b/common.gypi index b23898301a4898..4dfbdfac061887 100644 --- a/common.gypi +++ b/common.gypi @@ -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.13', + 'v8_embedder_string': '-node.14', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/include/v8-internal.h b/deps/v8/include/v8-internal.h index 876408ebba98f9..52ee403f526d06 100644 --- a/deps/v8/include/v8-internal.h +++ b/deps/v8/include/v8-internal.h @@ -106,6 +106,10 @@ const int kApiTaggedSize = kApiInt32Size; const int kApiTaggedSize = kApiSystemPointerSize; #endif +constexpr bool PointerCompressionIsEnabled() { + return kApiTaggedSize != kApiSystemPointerSize; +} + #ifdef V8_31BIT_SMIS_ON_64BIT_ARCH using PlatformSmiTagging = SmiTagging; #else diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h index 13724930103db1..9a58ef8720c4b4 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -9530,7 +9530,12 @@ class V8_EXPORT V8 { * Initializes V8. This function needs to be called before the first Isolate * is created. It always returns true. */ - static bool Initialize(); + V8_INLINE static bool Initialize() { + const int kBuildConfiguration = + (internal::PointerCompressionIsEnabled() ? kPointerCompression : 0) | + (internal::SmiValuesAre31Bits() ? k31BitSmis : 0); + return Initialize(kBuildConfiguration); + } /** * Allows the host application to provide a callback which can be used @@ -9664,6 +9669,17 @@ class V8_EXPORT V8 { private: V8(); + enum BuildConfigurationFeatures { + kPointerCompression = 1 << 0, + k31BitSmis = 1 << 1, + }; + + /** + * Checks that the embedder build configuration is compatible with + * the V8 binary and if so initializes V8. + */ + static bool Initialize(int build_config); + static internal::Address* GlobalizeReference(internal::Isolate* isolate, internal::Address* handle); static internal::Address* GlobalizeTracedReference(internal::Isolate* isolate, diff --git a/deps/v8/src/api/api.cc b/deps/v8/src/api/api.cc index 7fe974de24e8db..dac9e97b1ba121 100644 --- a/deps/v8/src/api/api.cc +++ b/deps/v8/src/api/api.cc @@ -5652,7 +5652,25 @@ void v8::V8::InitializePlatform(Platform* platform) { void v8::V8::ShutdownPlatform() { i::V8::ShutdownPlatform(); } -bool v8::V8::Initialize() { +bool v8::V8::Initialize(const int build_config) { + const bool kEmbedderPointerCompression = + (build_config & kPointerCompression) != 0; + if (kEmbedderPointerCompression != COMPRESS_POINTERS_BOOL) { + FATAL( + "Embedder-vs-V8 build configuration mismatch. On embedder side " + "pointer compression is %s while on V8 side it's %s.", + kEmbedderPointerCompression ? "ENABLED" : "DISABLED", + COMPRESS_POINTERS_BOOL ? "ENABLED" : "DISABLED"); + } + + const int kEmbedderSmiValueSize = (build_config & k31BitSmis) ? 31 : 32; + if (kEmbedderSmiValueSize != internal::kSmiValueSize) { + FATAL( + "Embedder-vs-V8 build configuration mismatch. On embedder side " + "Smi value size is %d while on V8 side it's %d.", + kEmbedderSmiValueSize, internal::kSmiValueSize); + } + i::V8::Initialize(); return true; } From d7d25df62bf49b678dbbd3eb4ee3c3aae6513b5d Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Thu, 16 Apr 2020 17:51:12 +0200 Subject: [PATCH 03/19] deps: V8: backport 844fe8f7d965 Original commit message: Make StringBuffer::string return a StringView instead of a reference. A StringView is pretty light, so this should be similar to how absl::string_view is typically used, e.g. see the guidance here: https://github.com/abseil/abseil-cpp/blob/master/absl/strings/string_view.h I suspect this reasoning holds even though StringView (defined just above StringBuffer in v8-inspector.h) carries an additional bool. This yields a small simplification of the StringBuffer implementations. Change-Id: I03f850049afe2327913070838f39649fcdfa6fa8 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2045110 Commit-Queue: Yang Guo Reviewed-by: Yang Guo Cr-Commit-Position: refs/heads/master@{#66858} (Neighbouring-line conflicts were resolved while backporting.) Refs: https://github.com/v8/v8/commit/844fe8f7d965fcb305bd1b71fe6b34628fc4d1fd --- common.gypi | 2 +- deps/v8/include/v8-inspector.h | 56 +++++++++---------- deps/v8/src/inspector/string-util.cc | 23 ++++---- deps/v8/src/inspector/v8-inspector-impl.cc | 16 +++--- deps/v8/src/inspector/v8-inspector-impl.h | 16 +++--- .../inspector/v8-inspector-session-impl.cc | 35 ++++++------ .../src/inspector/v8-inspector-session-impl.h | 31 +++++----- deps/v8/src/inspector/v8-stack-trace-impl.cc | 2 +- deps/v8/test/inspector/isolate-data.cc | 9 +-- 9 files changed, 93 insertions(+), 97 deletions(-) diff --git a/common.gypi b/common.gypi index 4dfbdfac061887..f5f3a9cdcf882b 100644 --- a/common.gypi +++ b/common.gypi @@ -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.14', + 'v8_embedder_string': '-node.15', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/include/v8-inspector.h b/deps/v8/include/v8-inspector.h index b9a48665338782..56723521fba7d4 100644 --- a/deps/v8/include/v8-inspector.h +++ b/deps/v8/include/v8-inspector.h @@ -65,15 +65,15 @@ class V8_EXPORT StringView { class V8_EXPORT StringBuffer { public: virtual ~StringBuffer() = default; - virtual const StringView& string() = 0; + virtual StringView string() const = 0; // This method copies contents. - static std::unique_ptr create(const StringView&); + static std::unique_ptr create(StringView); }; class V8_EXPORT V8ContextInfo { public: V8ContextInfo(v8::Local context, int contextGroupId, - const StringView& humanReadableName) + StringView humanReadableName) : context(context), contextGroupId(contextGroupId), humanReadableName(humanReadableName), @@ -132,37 +132,36 @@ class V8_EXPORT V8InspectorSession { virtual void addInspectedObject(std::unique_ptr) = 0; // Dispatching protocol messages. - static bool canDispatchMethod(const StringView& method); - virtual void dispatchProtocolMessage(const StringView& message) = 0; + static bool canDispatchMethod(StringView method); + virtual void dispatchProtocolMessage(StringView message) = 0; virtual std::vector state() = 0; virtual std::vector> supportedDomains() = 0; // Debugger actions. - virtual void schedulePauseOnNextStatement(const StringView& breakReason, - const StringView& breakDetails) = 0; + virtual void schedulePauseOnNextStatement(StringView breakReason, + StringView breakDetails) = 0; virtual void cancelPauseOnNextStatement() = 0; - virtual void breakProgram(const StringView& breakReason, - const StringView& breakDetails) = 0; + virtual void breakProgram(StringView breakReason, + StringView breakDetails) = 0; virtual void setSkipAllPauses(bool) = 0; virtual void resume() = 0; virtual void stepOver() = 0; virtual std::vector> - searchInTextByLines(const StringView& text, const StringView& query, - bool caseSensitive, bool isRegex) = 0; + searchInTextByLines(StringView text, StringView query, bool caseSensitive, + bool isRegex) = 0; // Remote objects. virtual std::unique_ptr wrapObject( - v8::Local, v8::Local, const StringView& groupName, + v8::Local, v8::Local, StringView groupName, bool generatePreview) = 0; virtual bool unwrapObject(std::unique_ptr* error, - const StringView& objectId, v8::Local*, + StringView objectId, v8::Local*, v8::Local*, std::unique_ptr* objectGroup) = 0; - virtual void releaseObjectGroup(const StringView&) = 0; - virtual void triggerPreciseCoverageDeltaUpdate( - const StringView& occassion) = 0; + virtual void releaseObjectGroup(StringView) = 0; + virtual void triggerPreciseCoverageDeltaUpdate(StringView occassion) = 0; }; class V8_EXPORT V8InspectorClient { @@ -240,7 +239,7 @@ struct V8_EXPORT V8StackTraceId { V8StackTraceId(uintptr_t id, const std::pair debugger_id); V8StackTraceId(uintptr_t id, const std::pair debugger_id, bool should_pause); - explicit V8StackTraceId(const StringView&); + explicit V8StackTraceId(StringView); V8StackTraceId& operator=(const V8StackTraceId&) = default; V8StackTraceId& operator=(V8StackTraceId&&) noexcept = default; ~V8StackTraceId() = default; @@ -265,26 +264,26 @@ class V8_EXPORT V8Inspector { virtual void idleFinished() = 0; // Async stack traces instrumentation. - virtual void asyncTaskScheduled(const StringView& taskName, void* task, + virtual void asyncTaskScheduled(StringView taskName, void* task, bool recurring) = 0; virtual void asyncTaskCanceled(void* task) = 0; virtual void asyncTaskStarted(void* task) = 0; virtual void asyncTaskFinished(void* task) = 0; virtual void allAsyncTasksCanceled() = 0; - virtual V8StackTraceId storeCurrentStackTrace( - const StringView& description) = 0; + virtual V8StackTraceId storeCurrentStackTrace(StringView description) = 0; virtual void externalAsyncTaskStarted(const V8StackTraceId& parent) = 0; virtual void externalAsyncTaskFinished(const V8StackTraceId& parent) = 0; // Exceptions instrumentation. - virtual unsigned exceptionThrown( - v8::Local, const StringView& message, - v8::Local exception, const StringView& detailedMessage, - const StringView& url, unsigned lineNumber, unsigned columnNumber, - std::unique_ptr, int scriptId) = 0; + virtual unsigned exceptionThrown(v8::Local, StringView message, + v8::Local exception, + StringView detailedMessage, StringView url, + unsigned lineNumber, unsigned columnNumber, + std::unique_ptr, + int scriptId) = 0; virtual void exceptionRevoked(v8::Local, unsigned exceptionId, - const StringView& message) = 0; + StringView message) = 0; // Connection. class V8_EXPORT Channel { @@ -295,8 +294,9 @@ class V8_EXPORT V8Inspector { virtual void sendNotification(std::unique_ptr message) = 0; virtual void flushProtocolNotifications() = 0; }; - virtual std::unique_ptr connect( - int contextGroupId, Channel*, const StringView& state) = 0; + virtual std::unique_ptr connect(int contextGroupId, + Channel*, + StringView state) = 0; // API methods. virtual std::unique_ptr createStackTrace( diff --git a/deps/v8/src/inspector/string-util.cc b/deps/v8/src/inspector/string-util.cc index e37b59b1c89d5c..b04814f0bd6b78 100644 --- a/deps/v8/src/inspector/string-util.cc +++ b/deps/v8/src/inspector/string-util.cc @@ -129,41 +129,38 @@ namespace { // default-constructed StringView instance. class EmptyStringBuffer : public StringBuffer { public: - const StringView& string() override { return string_; } - - private: - StringView string_; + StringView string() const override { return StringView(); } }; // Contains LATIN1 text data or CBOR encoded binary data in a vector. class StringBuffer8 : public StringBuffer { public: - explicit StringBuffer8(std::vector data) - : data_(std::move(data)), string_(data_.data(), data_.size()) {} + explicit StringBuffer8(std::vector data) : data_(std::move(data)) {} - const StringView& string() override { return string_; } + StringView string() const override { + return StringView(data_.data(), data_.size()); + } private: std::vector data_; - StringView string_; }; // Contains a 16 bit string (String16). class StringBuffer16 : public StringBuffer { public: - explicit StringBuffer16(String16 data) - : data_(std::move(data)), string_(data_.characters16(), data_.length()) {} + explicit StringBuffer16(String16 data) : data_(std::move(data)) {} - const StringView& string() override { return string_; } + StringView string() const override { + return StringView(data_.characters16(), data_.length()); + } private: String16 data_; - StringView string_; }; } // namespace // static -std::unique_ptr StringBuffer::create(const StringView& string) { +std::unique_ptr StringBuffer::create(StringView string) { if (string.length() == 0) return std::make_unique(); if (string.is8Bit()) { return std::make_unique(std::vector( diff --git a/deps/v8/src/inspector/v8-inspector-impl.cc b/deps/v8/src/inspector/v8-inspector-impl.cc index c767dbf09dc5b3..17aaf16bea1ba1 100644 --- a/deps/v8/src/inspector/v8-inspector-impl.cc +++ b/deps/v8/src/inspector/v8-inspector-impl.cc @@ -155,8 +155,7 @@ std::unique_ptr V8InspectorImpl::createStackTrace( } std::unique_ptr V8InspectorImpl::connect( - int contextGroupId, V8Inspector::Channel* channel, - const StringView& state) { + int contextGroupId, V8Inspector::Channel* channel, StringView state) { int sessionId = ++m_lastSessionId; std::unique_ptr session = V8InspectorSessionImpl::create(this, contextGroupId, sessionId, channel, @@ -256,9 +255,9 @@ void V8InspectorImpl::idleStarted() { m_isolate->SetIdle(true); } void V8InspectorImpl::idleFinished() { m_isolate->SetIdle(false); } unsigned V8InspectorImpl::exceptionThrown( - v8::Local context, const StringView& message, - v8::Local exception, const StringView& detailedMessage, - const StringView& url, unsigned lineNumber, unsigned columnNumber, + v8::Local context, StringView message, + v8::Local exception, StringView detailedMessage, StringView url, + unsigned lineNumber, unsigned columnNumber, std::unique_ptr stackTrace, int scriptId) { int groupId = contextGroupId(context); if (!groupId || m_muteExceptionsMap[groupId]) return 0; @@ -277,7 +276,7 @@ unsigned V8InspectorImpl::exceptionThrown( void V8InspectorImpl::exceptionRevoked(v8::Local context, unsigned exceptionId, - const StringView& message) { + StringView message) { int groupId = contextGroupId(context); if (!groupId) return; @@ -292,8 +291,7 @@ std::unique_ptr V8InspectorImpl::captureStackTrace( return m_debugger->captureStackTrace(fullStack); } -V8StackTraceId V8InspectorImpl::storeCurrentStackTrace( - const StringView& description) { +V8StackTraceId V8InspectorImpl::storeCurrentStackTrace(StringView description) { return m_debugger->storeCurrentStackTrace(description); } @@ -305,7 +303,7 @@ void V8InspectorImpl::externalAsyncTaskFinished(const V8StackTraceId& parent) { m_debugger->externalAsyncTaskFinished(parent); } -void V8InspectorImpl::asyncTaskScheduled(const StringView& taskName, void* task, +void V8InspectorImpl::asyncTaskScheduled(StringView taskName, void* task, bool recurring) { if (!task) return; m_debugger->asyncTaskScheduled(taskName, task, recurring); diff --git a/deps/v8/src/inspector/v8-inspector-impl.h b/deps/v8/src/inspector/v8-inspector-impl.h index dce3db52bd481d..43e33699535419 100644 --- a/deps/v8/src/inspector/v8-inspector-impl.h +++ b/deps/v8/src/inspector/v8-inspector-impl.h @@ -77,7 +77,7 @@ class V8InspectorImpl : public V8Inspector { // V8Inspector implementation. std::unique_ptr connect(int contextGroupId, V8Inspector::Channel*, - const StringView& state) override; + StringView state) override; void contextCreated(const V8ContextInfo&) override; void contextDestroyed(v8::Local) override; v8::MaybeLocal contextById(int contextId) override; @@ -85,25 +85,25 @@ class V8InspectorImpl : public V8Inspector { void resetContextGroup(int contextGroupId) override; void idleStarted() override; void idleFinished() override; - unsigned exceptionThrown(v8::Local, const StringView& message, + unsigned exceptionThrown(v8::Local, StringView message, v8::Local exception, - const StringView& detailedMessage, - const StringView& url, unsigned lineNumber, - unsigned columnNumber, std::unique_ptr, + StringView detailedMessage, StringView url, + unsigned lineNumber, unsigned columnNumber, + std::unique_ptr, int scriptId) override; void exceptionRevoked(v8::Local, unsigned exceptionId, - const StringView& message) override; + StringView message) override; std::unique_ptr createStackTrace( v8::Local) override; std::unique_ptr captureStackTrace(bool fullStack) override; - void asyncTaskScheduled(const StringView& taskName, void* task, + void asyncTaskScheduled(StringView taskName, void* task, bool recurring) override; void asyncTaskCanceled(void* task) override; void asyncTaskStarted(void* task) override; void asyncTaskFinished(void* task) override; void allAsyncTasksCanceled() override; - V8StackTraceId storeCurrentStackTrace(const StringView& description) override; + V8StackTraceId storeCurrentStackTrace(StringView description) override; void externalAsyncTaskStarted(const V8StackTraceId& parent) override; void externalAsyncTaskFinished(const V8StackTraceId& parent) override; diff --git a/deps/v8/src/inspector/v8-inspector-session-impl.cc b/deps/v8/src/inspector/v8-inspector-session-impl.cc index 45881a45966151..021f77322ac156 100644 --- a/deps/v8/src/inspector/v8-inspector-session-impl.cc +++ b/deps/v8/src/inspector/v8-inspector-session-impl.cc @@ -32,12 +32,12 @@ using v8_crdtp::cbor::CheckCBORMessage; using v8_crdtp::json::ConvertCBORToJSON; using v8_crdtp::json::ConvertJSONToCBOR; -bool IsCBORMessage(const StringView& msg) { +bool IsCBORMessage(StringView msg) { return msg.is8Bit() && msg.length() >= 2 && msg.characters8()[0] == 0xd8 && msg.characters8()[1] == 0x5a; } -Status ConvertToCBOR(const StringView& state, std::vector* cbor) { +Status ConvertToCBOR(StringView state, std::vector* cbor) { return state.is8Bit() ? ConvertJSONToCBOR( span(state.characters8(), state.length()), cbor) @@ -45,7 +45,7 @@ Status ConvertToCBOR(const StringView& state, std::vector* cbor) { span(state.characters16(), state.length()), cbor); } -std::unique_ptr ParseState(const StringView& state) { +std::unique_ptr ParseState(StringView state) { std::vector converted; span cbor; if (IsCBORMessage(state)) @@ -62,7 +62,7 @@ std::unique_ptr ParseState(const StringView& state) { } // namespace // static -bool V8InspectorSession::canDispatchMethod(const StringView& method) { +bool V8InspectorSession::canDispatchMethod(StringView method) { return stringViewStartsWith(method, protocol::Runtime::Metainfo::commandPrefix) || stringViewStartsWith(method, @@ -84,7 +84,7 @@ int V8ContextInfo::executionContextId(v8::Local context) { std::unique_ptr V8InspectorSessionImpl::create( V8InspectorImpl* inspector, int contextGroupId, int sessionId, - V8Inspector::Channel* channel, const StringView& state) { + V8Inspector::Channel* channel, StringView state) { return std::unique_ptr(new V8InspectorSessionImpl( inspector, contextGroupId, sessionId, channel, state)); } @@ -93,7 +93,7 @@ V8InspectorSessionImpl::V8InspectorSessionImpl(V8InspectorImpl* inspector, int contextGroupId, int sessionId, V8Inspector::Channel* channel, - const StringView& savedState) + StringView savedState) : m_contextGroupId(contextGroupId), m_sessionId(sessionId), m_inspector(inspector), @@ -239,7 +239,7 @@ Response V8InspectorSessionImpl::findInjectedScript( return findInjectedScript(objectId->contextId(), injectedScript); } -void V8InspectorSessionImpl::releaseObjectGroup(const StringView& objectGroup) { +void V8InspectorSessionImpl::releaseObjectGroup(StringView objectGroup) { releaseObjectGroup(toString16(objectGroup)); } @@ -253,7 +253,7 @@ void V8InspectorSessionImpl::releaseObjectGroup(const String16& objectGroup) { } bool V8InspectorSessionImpl::unwrapObject( - std::unique_ptr* error, const StringView& objectId, + std::unique_ptr* error, StringView objectId, v8::Local* object, v8::Local* context, std::unique_ptr* objectGroup) { String16 objectGroupString; @@ -288,8 +288,7 @@ Response V8InspectorSessionImpl::unwrapObject(const String16& objectId, std::unique_ptr V8InspectorSessionImpl::wrapObject(v8::Local context, v8::Local value, - const StringView& groupName, - bool generatePreview) { + StringView groupName, bool generatePreview) { return wrapObject(context, value, toString16(groupName), generatePreview); } @@ -336,8 +335,7 @@ void V8InspectorSessionImpl::reportAllContexts(V8RuntimeAgentImpl* agent) { }); } -void V8InspectorSessionImpl::dispatchProtocolMessage( - const StringView& message) { +void V8InspectorSessionImpl::dispatchProtocolMessage(StringView message) { using v8_crdtp::span; using v8_crdtp::SpanFrom; span cbor; @@ -425,7 +423,9 @@ V8InspectorSession::Inspectable* V8InspectorSessionImpl::inspectedObject( } void V8InspectorSessionImpl::schedulePauseOnNextStatement( - const StringView& breakReason, const StringView& breakDetails) { + StringView breakReason, StringView breakDetails) { + std::vector cbor; + ConvertToCBOR(breakDetails, &cbor); m_debuggerAgent->schedulePauseOnNextStatement( toString16(breakReason), protocol::DictionaryValue::cast( @@ -436,8 +436,8 @@ void V8InspectorSessionImpl::cancelPauseOnNextStatement() { m_debuggerAgent->cancelPauseOnNextStatement(); } -void V8InspectorSessionImpl::breakProgram(const StringView& breakReason, - const StringView& breakDetails) { +void V8InspectorSessionImpl::breakProgram(StringView breakReason, + StringView breakDetails) { m_debuggerAgent->breakProgram( toString16(breakReason), protocol::DictionaryValue::cast( @@ -453,8 +453,7 @@ void V8InspectorSessionImpl::resume() { m_debuggerAgent->resume(); } void V8InspectorSessionImpl::stepOver() { m_debuggerAgent->stepOver(); } std::vector> -V8InspectorSessionImpl::searchInTextByLines(const StringView& text, - const StringView& query, +V8InspectorSessionImpl::searchInTextByLines(StringView text, StringView query, bool caseSensitive, bool isRegex) { // TODO(dgozman): search may operate on StringView and avoid copying |text|. std::vector> matches = @@ -467,7 +466,7 @@ V8InspectorSessionImpl::searchInTextByLines(const StringView& text, } void V8InspectorSessionImpl::triggerPreciseCoverageDeltaUpdate( - const StringView& occassion) { + StringView occassion) { m_profilerAgent->triggerPreciseCoverageDeltaUpdate(toString16(occassion)); } diff --git a/deps/v8/src/inspector/v8-inspector-session-impl.h b/deps/v8/src/inspector/v8-inspector-session-impl.h index 31b822c47d5729..1bdde14f0511b0 100644 --- a/deps/v8/src/inspector/v8-inspector-session-impl.h +++ b/deps/v8/src/inspector/v8-inspector-session-impl.h @@ -32,9 +32,11 @@ using protocol::Response; class V8InspectorSessionImpl : public V8InspectorSession, public protocol::FrontendChannel { public: - static std::unique_ptr create( - V8InspectorImpl*, int contextGroupId, int sessionId, - V8Inspector::Channel*, const StringView& state); + static std::unique_ptr create(V8InspectorImpl*, + int contextGroupId, + int sessionId, + V8Inspector::Channel*, + StringView state); ~V8InspectorSessionImpl() override; V8InspectorImpl* inspector() const { return m_inspector; } @@ -64,39 +66,38 @@ class V8InspectorSessionImpl : public V8InspectorSession, void releaseObjectGroup(const String16& objectGroup); // V8InspectorSession implementation. - void dispatchProtocolMessage(const StringView& message) override; + void dispatchProtocolMessage(StringView message) override; std::vector state() override; std::vector> supportedDomains() override; void addInspectedObject( std::unique_ptr) override; - void schedulePauseOnNextStatement(const StringView& breakReason, - const StringView& breakDetails) override; + void schedulePauseOnNextStatement(StringView breakReason, + StringView breakDetails) override; void cancelPauseOnNextStatement() override; - void breakProgram(const StringView& breakReason, - const StringView& breakDetails) override; + void breakProgram(StringView breakReason, StringView breakDetails) override; void setSkipAllPauses(bool) override; void resume() override; void stepOver() override; std::vector> - searchInTextByLines(const StringView& text, const StringView& query, - bool caseSensitive, bool isRegex) override; - void releaseObjectGroup(const StringView& objectGroup) override; - bool unwrapObject(std::unique_ptr*, const StringView& objectId, + searchInTextByLines(StringView text, StringView query, bool caseSensitive, + bool isRegex) override; + void releaseObjectGroup(StringView objectGroup) override; + bool unwrapObject(std::unique_ptr*, StringView objectId, v8::Local*, v8::Local*, std::unique_ptr* objectGroup) override; std::unique_ptr wrapObject( - v8::Local, v8::Local, const StringView& groupName, + v8::Local, v8::Local, StringView groupName, bool generatePreview) override; V8InspectorSession::Inspectable* inspectedObject(unsigned num); static const unsigned kInspectedObjectBufferSize = 5; - void triggerPreciseCoverageDeltaUpdate(const StringView& occassion) override; + void triggerPreciseCoverageDeltaUpdate(StringView occassion) override; private: V8InspectorSessionImpl(V8InspectorImpl*, int contextGroupId, int sessionId, - V8Inspector::Channel*, const StringView& state); + V8Inspector::Channel*, StringView state); protocol::DictionaryValue* agentState(const String16& name); // protocol::FrontendChannel implementation. diff --git a/deps/v8/src/inspector/v8-stack-trace-impl.cc b/deps/v8/src/inspector/v8-stack-trace-impl.cc index 639ba46592f88f..b7f5b708831b04 100644 --- a/deps/v8/src/inspector/v8-stack-trace-impl.cc +++ b/deps/v8/src/inspector/v8-stack-trace-impl.cc @@ -124,7 +124,7 @@ V8StackTraceId::V8StackTraceId(uintptr_t id, bool should_pause) : id(id), debugger_id(debugger_id), should_pause(should_pause) {} -V8StackTraceId::V8StackTraceId(const StringView& json) +V8StackTraceId::V8StackTraceId(StringView json) : id(0), debugger_id(V8DebuggerId().pair()) { auto dict = protocol::DictionaryValue::cast(protocol::StringUtil::parseJSON(json)); diff --git a/deps/v8/test/inspector/isolate-data.cc b/deps/v8/test/inspector/isolate-data.cc index 8011007e3480d3..99ce4bc3cc731e 100644 --- a/deps/v8/test/inspector/isolate-data.cc +++ b/deps/v8/test/inspector/isolate-data.cc @@ -461,13 +461,14 @@ namespace { class StringBufferImpl : public v8_inspector::StringBuffer { public: StringBufferImpl(v8::Isolate* isolate, v8::Local string) - : data_(ToVector(isolate, string)), - view_(data_.begin(), data_.length()) {} - const v8_inspector::StringView& string() override { return view_; } + : data_(ToVector(isolate, string)) {} + + v8_inspector::StringView string() const override { + return v8_inspector::StringView(data_.begin(), data_.length()); + } private: v8::internal::Vector data_; - v8_inspector::StringView view_; }; } // anonymous namespace From 5ad3b54b24b1f7bd03e902fc6126941f12ef6ab8 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Thu, 16 Apr 2020 17:58:55 +0200 Subject: [PATCH 04/19] deps: V8: cherry-pick 94723c197199 Original commit message: api: Remove deprecated TracedReference::SetFinalizationCallback method TracedReference is supposed to be as light-weight as possible without destructor or other callbacks, essentially just representing a plain managed reference. Change-Id: Iae52cf7460e3623f1fb7d183757ecd39b2431369 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2033173 Auto-Submit: Michael Lippautz Reviewed-by: Ulan Degenbaev Commit-Queue: Michael Lippautz Cr-Commit-Position: refs/heads/master@{#66106} Refs: https://github.com/v8/v8/commit/94723c19719961a15b1f5546ec02fd3e916e1c0d --- common.gypi | 2 +- deps/v8/include/v8.h | 27 --------------------------- 2 files changed, 1 insertion(+), 28 deletions(-) diff --git a/common.gypi b/common.gypi index f5f3a9cdcf882b..831dad8b42bb7e 100644 --- a/common.gypi +++ b/common.gypi @@ -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.15', + 'v8_embedder_string': '-node.16', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h index 9a58ef8720c4b4..147f049a99a3cc 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -1128,17 +1128,11 @@ class TracedReference : public TracedReferenceBase { /** * Copy assignment operator initializing TracedGlobal from an existing one. - * - * Note: Prohibited when |other| has a finalization callback set through - * |SetFinalizationCallback|. */ V8_INLINE TracedReference& operator=(const TracedReference& rhs); /** * Copy assignment operator initializing TracedGlobal from an existing one. - * - * Note: Prohibited when |other| has a finalization callback set through - * |SetFinalizationCallback|. */ template V8_INLINE TracedReference& operator=(const TracedReference& rhs); @@ -1155,20 +1149,6 @@ class TracedReference : public TracedReferenceBase { return reinterpret_cast&>( const_cast&>(*this)); } - - /** - * Adds a finalization callback to the handle. The type of this callback is - * similar to WeakCallbackType::kInternalFields, i.e., it will pass the - * parameter and the first two internal fields of the object. - * - * The callback is then supposed to reset the handle in the callback. No - * further V8 API may be called in this callback. In case additional work - * involving V8 needs to be done, a second callback can be scheduled using - * WeakCallbackInfo::SetSecondPassCallback. - */ - V8_DEPRECATED("Use TracedGlobal<> if callbacks are required.") - V8_INLINE void SetFinalizationCallback( - void* parameter, WeakCallbackInfo::Callback callback); }; /** @@ -10953,13 +10933,6 @@ void TracedGlobal::SetFinalizationCallback( reinterpret_cast(this->val_), parameter, callback); } -template -void TracedReference::SetFinalizationCallback( - void* parameter, typename WeakCallbackInfo::Callback callback) { - V8::SetFinalizationCallbackTraced( - reinterpret_cast(this->val_), parameter, callback); -} - template ReturnValue::ReturnValue(internal::Address* slot) : value_(slot) {} From 1bbdc48c3c6fa65cbf639de5d65750a21854719e Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Thu, 16 Apr 2020 18:03:55 +0200 Subject: [PATCH 05/19] deps: V8: cherry-pick f0057afc2fb6 Original commit message: [api] Remove deprecated and non-functional method The functionality was not used since a long time, and was hence removed for the 8.1 branch, and the method was deprecated. This CL removed the deprecated method completely. R=adamk@chromium.org Bug: v8:10155 Change-Id: Iae299d64decb7230d38c2fda8d269a7b0387bb0d Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2033169 Reviewed-by: Adam Klein Commit-Queue: Clemens Backes Cr-Commit-Position: refs/heads/master@{#66167} Refs: https://github.com/v8/v8/commit/f0057afc2fb629e9625bb43df9fcdff06cbf6bf9 --- common.gypi | 2 +- deps/v8/include/v8.h | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/common.gypi b/common.gypi index 831dad8b42bb7e..4251bc17d9d7e6 100644 --- a/common.gypi +++ b/common.gypi @@ -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.16', + 'v8_embedder_string': '-node.17', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h index 147f049a99a3cc..c030b359966148 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -2446,14 +2446,6 @@ class V8_EXPORT ValueDeserializer { */ void SetSupportsLegacyWireFormat(bool supports_legacy_wire_format); - /** - * Expect inline wasm in the data stream (rather than in-memory transfer) - */ - V8_DEPRECATED( - "Wasm module serialization is only supported via explicit methods, e.g. " - "CompiledWasmModule::Serialize()") - void SetExpectInlineWasm(bool allow_inline_wasm) {} - /** * Reads the underlying wire format version. Likely mostly to be useful to * legacy code reading old wire format versions. Must be called after From 34b5e8e8e37707aabcce50cfb614d544ee785c3f Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Thu, 16 Apr 2020 18:04:25 +0200 Subject: [PATCH 06/19] 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 Commit-Queue: Toon Verwaest Reviewed-by: Toon Verwaest Cr-Commit-Position: refs/heads/master@{#67169} Refs: https://github.com/v8/v8/commit/fa3e37e511ee242e8fa0ca09f5425dea4d7cecff --- common.gypi | 2 +- deps/v8/include/v8.h | 17 ----------------- deps/v8/src/api/api.cc | 34 ---------------------------------- 3 files changed, 1 insertion(+), 52 deletions(-) diff --git a/common.gypi b/common.gypi index 4251bc17d9d7e6..9bc099c6667385 100644 --- a/common.gypi +++ b/common.gypi @@ -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 ##### diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h index c030b359966148..95f37ccc27b318 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -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 FromSnapshot(Isolate* isolate, - size_t index); - /** * Creates a function template backed/cached by a private property. */ @@ -6674,11 +6669,6 @@ class V8_EXPORT ObjectTemplate : public Template { Isolate* isolate, Local constructor = Local()); - /** Get a template included in the snapshot by index. */ - V8_DEPRECATED("Use v8::Isolate::GetDataFromSnapshotOnce instead") - static MaybeLocal FromSnapshot(Isolate* isolate, - size_t index); - /** Creates a new instance of this template.*/ V8_WARN_UNUSED_RESULT MaybeLocal NewInstance(Local context); @@ -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