From 97245439a67f682368720b4b8bc7c216c245fd17 Mon Sep 17 00:00:00 2001 From: Peter Marshall Date: Wed, 5 Aug 2020 14:28:15 +0200 Subject: [PATCH] deps: V8: cherry-pick beebee4f80ff MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Original commit message: ``` cpu-profiler: Use Handle version of SourcePositionTableIterator The surrounding code can trigger an allocation through InliningStack which can eventually end up allocating a line ends array. This is fine as-is because the existing iterator code makes a copy of the byte array. It just triggers the no_gc dcheck in debug mode. Fixed: v8:10778 Change-Id: Ic8c502767ec6c3d3b1f5e84df60638bd2fc6be75 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2339102 Auto-Submit: Peter Marshall Commit-Queue: Tobias Tebbi Reviewed-by: Tobias Tebbi Cr-Commit-Position: refs/heads/master@{#69247} ``` Refs: https://github.com/v8/v8/commit/beebee4f80ff2eb91187ef1e8fa00b8ff82a20b3 PR-URL: https://github.com/nodejs/node/pull/37293 Reviewed-By: Jiawen Geng Reviewed-By: Juan José Arboleda Reviewed-By: Richard Lau --- common.gypi | 2 +- deps/v8/src/profiler/profiler-listener.cc | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/common.gypi b/common.gypi index 102f0907745507..a6556a4cb727ac 100644 --- a/common.gypi +++ b/common.gypi @@ -34,7 +34,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.45', + 'v8_embedder_string': '-node.46', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/profiler/profiler-listener.cc b/deps/v8/src/profiler/profiler-listener.cc index b00c1f5cfd7ec2..cf63bd52a42708 100644 --- a/deps/v8/src/profiler/profiler-listener.cc +++ b/deps/v8/src/profiler/profiler-listener.cc @@ -120,7 +120,8 @@ void ProfilerListener::CodeCreateEvent(CodeEventListener::LogEventsAndTags tag, // profiler as is stored on the code object, except that we transform source // positions to line numbers here, because we only care about attributing // ticks to a given line. - for (SourcePositionTableIterator it(abstract_code.source_position_table()); + for (SourcePositionTableIterator it( + handle(abstract_code->source_position_table(), isolate_)); !it.done(); it.Advance()) { int position = it.source_position().ScriptOffset(); int inlining_id = it.source_position().InliningId();