Skip to content

Commit c1729b0

Browse files
ofrobotsjasnell
authored andcommitted
deps: upgrade to V8 5.0.71.35
Pick up the latest bug fix from the V8 5.0 branch. Original commit message: V8-Commit: v8/v8@c1d51c7c Version 5.0.71.35 (cherry-pick) Merged 2837cb387 disallow left-trim fast path when sampling heap profiler is active R=hablich@chromium.org, hpayer@chromium.org BUG=v8:4937 Review URL: https://codereview.chromium.org/1918453002 . PR-URL: #6372 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
1 parent c43b182 commit c1729b0

File tree

4 files changed

+30
-1
lines changed

4 files changed

+30
-1
lines changed

deps/v8/include/v8-version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define V8_MAJOR_VERSION 5
1212
#define V8_MINOR_VERSION 0
1313
#define V8_BUILD_NUMBER 71
14-
#define V8_PATCH_LEVEL 34
14+
#define V8_PATCH_LEVEL 35
1515

1616
// Use 1 for candidates and 0 otherwise.
1717
// (Boolean macro values are not supported by all preprocessors.)

deps/v8/src/heap/heap.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3069,6 +3069,9 @@ void Heap::CreateFillerObjectAt(Address addr, int size) {
30693069
bool Heap::CanMoveObjectStart(HeapObject* object) {
30703070
if (!FLAG_move_object_start) return false;
30713071

3072+
// Sampling heap profiler may have a reference to the object.
3073+
if (isolate()->heap_profiler()->is_sampling_allocations()) return false;
3074+
30723075
Address address = object->address();
30733076

30743077
if (lo_space()->Contains(object)) return false;

deps/v8/src/profiler/heap-profiler.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class HeapProfiler {
3232

3333
bool StartSamplingHeapProfiler(uint64_t sample_interval, int stack_depth);
3434
void StopSamplingHeapProfiler();
35+
bool is_sampling_allocations() { return !sampling_heap_profiler_.is_empty(); }
3536
AllocationProfile* GetAllocationProfile();
3637

3738
void StartHeapObjectsTracking(bool track_allocations);

deps/v8/test/cctest/test-heap-profiler.cc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3010,3 +3010,28 @@ TEST(SamplingHeapProfilerApiAllocation) {
30103010

30113011
heap_profiler->StopSamplingHeapProfiler();
30123012
}
3013+
3014+
TEST(SamplingHeapProfilerLeftTrimming) {
3015+
v8::HandleScope scope(v8::Isolate::GetCurrent());
3016+
LocalContext env;
3017+
v8::HeapProfiler* heap_profiler = env->GetIsolate()->GetHeapProfiler();
3018+
3019+
// Suppress randomness to avoid flakiness in tests.
3020+
v8::internal::FLAG_sampling_heap_profiler_suppress_randomness = true;
3021+
3022+
heap_profiler->StartSamplingHeapProfiler(64);
3023+
3024+
CompileRun(
3025+
"for (var j = 0; j < 500; ++j) {\n"
3026+
" var a = [];\n"
3027+
" for (var i = 0; i < 5; ++i)\n"
3028+
" a[i] = i;\n"
3029+
" for (var i = 0; i < 3; ++i)\n"
3030+
" a.shift();\n"
3031+
"}\n");
3032+
3033+
CcTest::heap()->CollectGarbage(v8::internal::NEW_SPACE);
3034+
// Should not crash.
3035+
3036+
heap_profiler->StopSamplingHeapProfiler();
3037+
}

0 commit comments

Comments
 (0)