diff --git a/deps/v8/src/profiler/sampling-heap-profiler.h b/deps/v8/src/profiler/sampling-heap-profiler.h index 07840244ce5e91..3a347dd54ea5c4 100644 --- a/deps/v8/src/profiler/sampling-heap-profiler.h +++ b/deps/v8/src/profiler/sampling-heap-profiler.h @@ -172,8 +172,11 @@ class SamplingAllocationObserver : public AllocationObserver { void Step(int bytes_allocated, Address soon_object, size_t size) override { USE(heap_); DCHECK(heap_->gc_state() == Heap::NOT_IN_GC); - DCHECK(soon_object); - profiler_->SampleObject(soon_object, size); + if (soon_object) { + // TODO(ofrobots): it would be better to sample the next object rather + // than skipping this sample epoch if soon_object happens to be null. + profiler_->SampleObject(soon_object, size); + } } intptr_t GetNextStepSize() override { return GetNextSampleInterval(rate_); }