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/compilation-statistics.h b/src/compilation-statistics.h
new file mode 100644
index 0000000..45ffb9b
--- /dev/null
+++ b/src/compilation-statistics.h
@@ -0,0 +1,86 @@
+// 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_COMPILATION_STATISTICS_H_
+#define V8_COMPILATION_STATISTICS_H_
+
+#include <map>
+#include <string>
+
+#include "src/allocation.h"
+#include "src/base/platform/time.h"
+
+namespace v8 {
+namespace internal {
+
+class CompilationInfo;
+
+class CompilationStatistics FINAL : public Malloced {
+ public:
+  CompilationStatistics() {}
+
+  class BasicStats {
+   public:
+    BasicStats()
+        : total_allocated_bytes_(0),
+          max_allocated_bytes_(0),
+          absolute_max_allocated_bytes_(0) {}
+
+    void Accumulate(const BasicStats& stats);
+
+    base::TimeDelta delta_;
+    size_t total_allocated_bytes_;
+    size_t max_allocated_bytes_;
+    size_t absolute_max_allocated_bytes_;
+    std::string function_name_;
+  };
+
+  void RecordPhaseStats(const char* phase_kind_name, const char* phase_name,
+                        const BasicStats& stats);
+
+  void RecordPhaseKindStats(const char* phase_kind_name,
+                            const BasicStats& stats);
+
+  void RecordTotalStats(size_t source_size, const BasicStats& stats);
+
+ private:
+  class TotalStats : public BasicStats {
+   public:
+    TotalStats() : source_size_(0) {}
+    uint64_t source_size_;
+  };
+
+  class OrderedStats : public BasicStats {
+   public:
+    explicit OrderedStats(size_t insert_order) : insert_order_(insert_order) {}
+    size_t insert_order_;
+  };
+
+  class PhaseStats : public OrderedStats {
+   public:
+    PhaseStats(size_t insert_order, const char* phase_kind_name)
+        : OrderedStats(insert_order), phase_kind_name_(phase_kind_name) {}
+    std::string phase_kind_name_;
+  };
+
+  friend std::ostream& operator<<(std::ostream& os,
+                                  const CompilationStatistics& s);
+
+  typedef OrderedStats PhaseKindStats;
+  typedef std::map<std::string, PhaseKindStats> PhaseKindMap;
+  typedef std::map<std::string, PhaseStats> PhaseMap;
+
+  TotalStats total_stats_;
+  PhaseKindMap phase_kind_map_;
+  PhaseMap phase_map_;
+
+  DISALLOW_COPY_AND_ASSIGN(CompilationStatistics);
+};
+
+std::ostream& operator<<(std::ostream& os, const CompilationStatistics& s);
+
+}  // namespace internal
+}  // namespace v8
+
+#endif