diff --git a/common.gypi b/common.gypi index 8b81a0a39dd09d..bb27df43d5cb7c 100644 --- a/common.gypi +++ b/common.gypi @@ -36,7 +36,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.72', + 'v8_embedder_string': '-node.73', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/heap/heap.cc b/deps/v8/src/heap/heap.cc index 5d5eaae0683b74..62033444ed0427 100644 --- a/deps/v8/src/heap/heap.cc +++ b/deps/v8/src/heap/heap.cc @@ -3347,6 +3347,10 @@ void Heap::MakeHeapIterable() { mark_compact_collector()->EnsureSweepingCompleted(); } +void Heap::EnsureSweepingCompleted() { + mark_compact_collector()->EnsureSweepingCompleted(); +} + namespace { double ComputeMutatorUtilizationImpl(double mutator_speed, double gc_speed) { diff --git a/deps/v8/src/heap/heap.h b/deps/v8/src/heap/heap.h index b2105a96badc2f..4ca8c3b201fb03 100644 --- a/deps/v8/src/heap/heap.h +++ b/deps/v8/src/heap/heap.h @@ -1001,6 +1001,8 @@ class Heap { Reservation* reservations, const std::vector& large_objects, const std::vector
& maps); + void EnsureSweepingCompleted(); + IncrementalMarking* incremental_marking() { return incremental_marking_.get(); } diff --git a/deps/v8/src/json/json-parser.cc b/deps/v8/src/json/json-parser.cc index da2f60d3209b4a..2ac4e727e0bdb3 100644 --- a/deps/v8/src/json/json-parser.cc +++ b/deps/v8/src/json/json-parser.cc @@ -633,6 +633,11 @@ Handle JsonParser::BuildJsonObject( DCHECK_EQ(mutable_double_address, end); } #endif + // Before setting the length of mutable_double_buffer back to zero, we + // must ensure that the sweeper is not running or has already swept the + // object's page. Otherwise the GC can add the contents of + // mutable_double_buffer to the free list. + isolate()->heap()->EnsureSweepingCompleted(); mutable_double_buffer->set_length(0); } }