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/graph-reducer.h b/src/compiler/graph-reducer.h
index e0e4f7a..09a650c 100644
--- a/src/compiler/graph-reducer.h
+++ b/src/compiler/graph-reducer.h
@@ -5,17 +5,13 @@
#ifndef V8_COMPILER_GRAPH_REDUCER_H_
#define V8_COMPILER_GRAPH_REDUCER_H_
+#include "src/compiler/graph.h"
#include "src/zone-containers.h"
namespace v8 {
namespace internal {
namespace compiler {
-// Forward declarations.
-class Graph;
-class Node;
-
-
// Represents the result of trying to reduce a node in the graph.
class Reduction FINAL {
public:
@@ -55,20 +51,42 @@
// Performs an iterative reduction of a node graph.
class GraphReducer FINAL {
public:
- explicit GraphReducer(Graph* graph);
+ GraphReducer(Graph* graph, Zone* zone);
Graph* graph() const { return graph_; }
- void AddReducer(Reducer* reducer) { reducers_.push_back(reducer); }
+ void AddReducer(Reducer* reducer);
// Reduce a single node.
- void ReduceNode(Node* node);
+ void ReduceNode(Node* const);
// Reduce the whole graph.
void ReduceGraph();
private:
+ enum class State : uint8_t;
+ struct NodeState {
+ Node* node;
+ int input_index;
+ };
+
+ // Reduce a single node.
+ Reduction Reduce(Node* const);
+ // Reduce the node on top of the stack.
+ void ReduceTop();
+
+ // Node stack operations.
+ void Pop();
+ void Push(Node* node);
+
+ // Revisit queue operations.
+ bool Recurse(Node* node);
+ void Revisit(Node* node);
+
Graph* graph_;
+ NodeMarker<State> state_;
ZoneVector<Reducer*> reducers_;
+ ZoneStack<Node*> revisit_;
+ ZoneStack<NodeState> stack_;
DISALLOW_COPY_AND_ASSIGN(GraphReducer);
};