Update V8 to version 4.1.0.21
This is a cherry-pick of all commits up to and including the
4.1.0.21 cherry-pick in Chromium.
Original commit message:
Version 4.1.0.21 (cherry-pick)
Merged 206e9136bde0f2b5ae8cb77afbb1e7833e5bd412
Unlink pages from the space page list after evacuation.
BUG=430201
LOG=N
R=jkummerow@chromium.org
Review URL: https://codereview.chromium.org/953813002
Cr-Commit-Position: refs/branch-heads/4.1@{#22}
Cr-Branched-From: 2e08d2a7aa9d65d269d8c57aba82eb38a8cb0a18-refs/heads/candidates@{#25353}
---
FPIIM-449
Change-Id: I8c23c7bbb70772b4858fe8a47b64fa97ee0d1f8c
diff --git a/src/compiler/pipeline-statistics.h b/src/compiler/pipeline-statistics.h
new file mode 100644
index 0000000..01cc9de
--- /dev/null
+++ b/src/compiler/pipeline-statistics.h
@@ -0,0 +1,95 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef V8_COMPILER_PIPELINE_STATISTICS_H_
+#define V8_COMPILER_PIPELINE_STATISTICS_H_
+
+#include <string>
+
+#include "src/compilation-statistics.h"
+#include "src/compiler/zone-pool.h"
+
+namespace v8 {
+namespace internal {
+namespace compiler {
+
+class PhaseScope;
+
+class PipelineStatistics : public Malloced {
+ public:
+ PipelineStatistics(CompilationInfo* info, ZonePool* zone_pool);
+ ~PipelineStatistics();
+
+ void BeginPhaseKind(const char* phase_kind_name);
+
+ private:
+ size_t OuterZoneSize() {
+ return static_cast<size_t>(outer_zone_->allocation_size());
+ }
+
+ class CommonStats {
+ public:
+ CommonStats() : outer_zone_initial_size_(0) {}
+
+ void Begin(PipelineStatistics* pipeline_stats);
+ void End(PipelineStatistics* pipeline_stats,
+ CompilationStatistics::BasicStats* diff);
+
+ SmartPointer<ZonePool::StatsScope> scope_;
+ base::ElapsedTimer timer_;
+ size_t outer_zone_initial_size_;
+ size_t allocated_bytes_at_start_;
+ };
+
+ bool InPhaseKind() { return !phase_kind_stats_.scope_.is_empty(); }
+ void EndPhaseKind();
+
+ friend class PhaseScope;
+ bool InPhase() { return !phase_stats_.scope_.is_empty(); }
+ void BeginPhase(const char* name);
+ void EndPhase();
+
+ Isolate* isolate_;
+ Zone* outer_zone_;
+ ZonePool* zone_pool_;
+ CompilationStatistics* compilation_stats_;
+ std::string function_name_;
+
+ // Stats for the entire compilation.
+ CommonStats total_stats_;
+ size_t source_size_;
+
+ // Stats for phase kind.
+ const char* phase_kind_name_;
+ CommonStats phase_kind_stats_;
+
+ // Stats for phase.
+ const char* phase_name_;
+ CommonStats phase_stats_;
+
+ DISALLOW_COPY_AND_ASSIGN(PipelineStatistics);
+};
+
+
+class PhaseScope {
+ public:
+ PhaseScope(PipelineStatistics* pipeline_stats, const char* name)
+ : pipeline_stats_(pipeline_stats) {
+ if (pipeline_stats_ != NULL) pipeline_stats_->BeginPhase(name);
+ }
+ ~PhaseScope() {
+ if (pipeline_stats_ != NULL) pipeline_stats_->EndPhase();
+ }
+
+ private:
+ PipelineStatistics* const pipeline_stats_;
+
+ DISALLOW_COPY_AND_ASSIGN(PhaseScope);
+};
+
+} // namespace compiler
+} // namespace internal
+} // namespace v8
+
+#endif