diff options
author | Anna Henningsen <anna@addaleax.net> | 2018-06-30 21:09:21 +0200 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2018-07-15 20:35:32 +0200 |
commit | d2a1408f119181675d9d3f20982ccd863443baad (patch) | |
tree | 035b16589d7ab4b3991425db638bad19f2d12356 /deps/v8/src/api.cc | |
parent | 4a58725c157b775f71ee13c441dac110ec60cf15 (diff) | |
download | android-node-v8-d2a1408f119181675d9d3f20982ccd863443baad.tar.gz android-node-v8-d2a1408f119181675d9d3f20982ccd863443baad.tar.bz2 android-node-v8-d2a1408f119181675d9d3f20982ccd863443baad.zip |
deps: cherry-pick 555c811 from upstream V8
Original commit message:
[api] Switch from `SetBuildEmbedderGraphCallback` to `AddBuildEmbedderGraphCallback`
`SetBuildEmbedderGraphCallback`, unlike `SetWrapperClassInfoProvider`,
assumes a monolithic embedder that can provide all necessary information.
That is not the case for e.g. Node.js, which can e.g. provide multiple Node.js
instances per V8 Isolate, as well as native addons that may allocate resources
on their own.
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Ib53dfde82416dd69934b08623e27d674a483ac2d
Reviewed-on: https://chromium-review.googlesource.com/1082441
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53545}
Refs: https://github.com/v8/v8/commit/555c811c0d44d9aaaccf8e76059ed24537b3f012
PR-URL: https://github.com/nodejs/node/pull/21741
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Diffstat (limited to 'deps/v8/src/api.cc')
-rw-r--r-- | deps/v8/src/api.cc | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/deps/v8/src/api.cc b/deps/v8/src/api.cc index a7f6d00f6f..192ad90f83 100644 --- a/deps/v8/src/api.cc +++ b/deps/v8/src/api.cc @@ -10558,9 +10558,25 @@ void HeapProfiler::SetGetRetainerInfosCallback( } void HeapProfiler::SetBuildEmbedderGraphCallback( - BuildEmbedderGraphCallback callback) { - reinterpret_cast<i::HeapProfiler*>(this)->SetBuildEmbedderGraphCallback( - callback); + LegacyBuildEmbedderGraphCallback callback) { + reinterpret_cast<i::HeapProfiler*>(this)->AddBuildEmbedderGraphCallback( + [](v8::Isolate* isolate, v8::EmbedderGraph* graph, void* data) { + reinterpret_cast<LegacyBuildEmbedderGraphCallback>(data)(isolate, + graph); + }, + reinterpret_cast<void*>(callback)); +} + +void HeapProfiler::AddBuildEmbedderGraphCallback( + BuildEmbedderGraphCallback callback, void* data) { + reinterpret_cast<i::HeapProfiler*>(this)->AddBuildEmbedderGraphCallback( + callback, data); +} + +void HeapProfiler::RemoveBuildEmbedderGraphCallback( + BuildEmbedderGraphCallback callback, void* data) { + reinterpret_cast<i::HeapProfiler*>(this)->RemoveBuildEmbedderGraphCallback( + callback, data); } v8::Testing::StressType internal::Testing::stress_type_ = |