summaryrefslogtreecommitdiff
path: root/deps/v8/src/compiler/pipeline-statistics.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/compiler/pipeline-statistics.cc')
-rw-r--r--deps/v8/src/compiler/pipeline-statistics.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/deps/v8/src/compiler/pipeline-statistics.cc b/deps/v8/src/compiler/pipeline-statistics.cc
index b98f837ee9..5b97abe5eb 100644
--- a/deps/v8/src/compiler/pipeline-statistics.cc
+++ b/deps/v8/src/compiler/pipeline-statistics.cc
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <memory>
+
#include "src/compiler.h"
#include "src/compiler/pipeline-statistics.h"
#include "src/compiler/zone-pool.h"
@@ -12,8 +14,8 @@ namespace compiler {
void PipelineStatistics::CommonStats::Begin(
PipelineStatistics* pipeline_stats) {
- DCHECK(scope_.is_empty());
- scope_.Reset(new ZonePool::StatsScope(pipeline_stats->zone_pool_));
+ DCHECK(!scope_);
+ scope_.reset(new ZonePool::StatsScope(pipeline_stats->zone_pool_));
timer_.Start();
outer_zone_initial_size_ = pipeline_stats->OuterZoneSize();
allocated_bytes_at_start_ =
@@ -26,7 +28,7 @@ void PipelineStatistics::CommonStats::Begin(
void PipelineStatistics::CommonStats::End(
PipelineStatistics* pipeline_stats,
CompilationStatistics::BasicStats* diff) {
- DCHECK(!scope_.is_empty());
+ DCHECK(scope_);
diff->function_name_ = pipeline_stats->function_name_;
diff->delta_ = timer_.Elapsed();
size_t outer_zone_diff =
@@ -36,7 +38,7 @@ void PipelineStatistics::CommonStats::End(
diff->max_allocated_bytes_ + allocated_bytes_at_start_;
diff->total_allocated_bytes_ =
outer_zone_diff + scope_->GetTotalAllocatedBytes();
- scope_.Reset(nullptr);
+ scope_.reset();
timer_.Stop();
}
@@ -52,7 +54,7 @@ PipelineStatistics::PipelineStatistics(CompilationInfo* info,
phase_name_(nullptr) {
if (info->has_shared_info()) {
source_size_ = static_cast<size_t>(info->shared_info()->SourceSize());
- base::SmartArrayPointer<char> name =
+ std::unique_ptr<char[]> name =
info->shared_info()->DebugName()->ToCString();
function_name_ = name.get();
}