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/node-properties-inl.h b/src/compiler/node-properties-inl.h
index 3f6d531..0d29614 100644
--- a/src/compiler/node-properties-inl.h
+++ b/src/compiler/node-properties-inl.h
@@ -8,11 +8,9 @@
#include "src/v8.h"
#include "src/compiler/common-operator.h"
-#include "src/compiler/generic-node-inl.h"
#include "src/compiler/node-properties.h"
#include "src/compiler/opcodes.h"
#include "src/compiler/operator.h"
-#include "src/compiler/operator-properties-inl.h"
#include "src/compiler/operator-properties.h"
namespace v8 {
@@ -44,8 +42,7 @@
inline int NodeProperties::PastValueIndex(Node* node) {
- return FirstValueIndex(node) +
- OperatorProperties::GetValueInputCount(node->op());
+ return FirstValueIndex(node) + node->op()->ValueInputCount();
}
inline int NodeProperties::PastContextIndex(Node* node) {
@@ -59,13 +56,11 @@
}
inline int NodeProperties::PastEffectIndex(Node* node) {
- return FirstEffectIndex(node) +
- OperatorProperties::GetEffectInputCount(node->op());
+ return FirstEffectIndex(node) + node->op()->EffectInputCount();
}
inline int NodeProperties::PastControlIndex(Node* node) {
- return FirstControlIndex(node) +
- OperatorProperties::GetControlInputCount(node->op());
+ return FirstControlIndex(node) + node->op()->ControlInputCount();
}
@@ -73,8 +68,7 @@
// Input accessors.
inline Node* NodeProperties::GetValueInput(Node* node, int index) {
- DCHECK(0 <= index &&
- index < OperatorProperties::GetValueInputCount(node->op()));
+ DCHECK(0 <= index && index < node->op()->ValueInputCount());
return node->InputAt(FirstValueIndex(node) + index);
}
@@ -89,14 +83,12 @@
}
inline Node* NodeProperties::GetEffectInput(Node* node, int index) {
- DCHECK(0 <= index &&
- index < OperatorProperties::GetEffectInputCount(node->op()));
+ DCHECK(0 <= index && index < node->op()->EffectInputCount());
return node->InputAt(FirstEffectIndex(node) + index);
}
inline Node* NodeProperties::GetControlInput(Node* node, int index) {
- DCHECK(0 <= index &&
- index < OperatorProperties::GetControlInputCount(node->op()));
+ DCHECK(0 <= index && index < node->op()->ControlInputCount());
return node->InputAt(FirstControlIndex(node) + index);
}
@@ -108,7 +100,7 @@
// -----------------------------------------------------------------------------
// Edge kinds.
-inline bool NodeProperties::IsInputRange(Node::Edge edge, int first, int num) {
+inline bool NodeProperties::IsInputRange(Edge edge, int first, int num) {
// TODO(titzer): edge.index() is linear time;
// edges maybe need to be marked as value/effect/control.
if (num == 0) return false;
@@ -116,28 +108,28 @@
return first <= index && index < first + num;
}
-inline bool NodeProperties::IsValueEdge(Node::Edge edge) {
+inline bool NodeProperties::IsValueEdge(Edge edge) {
Node* node = edge.from();
return IsInputRange(edge, FirstValueIndex(node),
- OperatorProperties::GetValueInputCount(node->op()));
+ node->op()->ValueInputCount());
}
-inline bool NodeProperties::IsContextEdge(Node::Edge edge) {
+inline bool NodeProperties::IsContextEdge(Edge edge) {
Node* node = edge.from();
return IsInputRange(edge, FirstContextIndex(node),
OperatorProperties::GetContextInputCount(node->op()));
}
-inline bool NodeProperties::IsEffectEdge(Node::Edge edge) {
+inline bool NodeProperties::IsEffectEdge(Edge edge) {
Node* node = edge.from();
return IsInputRange(edge, FirstEffectIndex(node),
- OperatorProperties::GetEffectInputCount(node->op()));
+ node->op()->EffectInputCount());
}
-inline bool NodeProperties::IsControlEdge(Node::Edge edge) {
+inline bool NodeProperties::IsControlEdge(Edge edge) {
Node* node = edge.from();
return IsInputRange(edge, FirstControlIndex(node),
- OperatorProperties::GetControlInputCount(node->op()));
+ node->op()->ControlInputCount());
}
@@ -158,7 +150,7 @@
inline void NodeProperties::ReplaceEffectInput(Node* node, Node* effect,
int index) {
- DCHECK(index < OperatorProperties::GetEffectInputCount(node->op()));
+ DCHECK(index < node->op()->EffectInputCount());
return node->ReplaceInput(FirstEffectIndex(node) + index, effect);
}
@@ -169,7 +161,7 @@
}
inline void NodeProperties::RemoveNonValueInputs(Node* node) {
- node->TrimInputCount(OperatorProperties::GetValueInputCount(node->op()));
+ node->TrimInputCount(node->op()->ValueInputCount());
}
@@ -177,19 +169,18 @@
// {effect}. If {effect == NULL}, then use the effect input to {node}.
inline void NodeProperties::ReplaceWithValue(Node* node, Node* value,
Node* effect) {
- DCHECK(!OperatorProperties::HasControlOutput(node->op()));
- if (effect == NULL && OperatorProperties::HasEffectInput(node->op())) {
+ DCHECK(node->op()->ControlOutputCount() == 0);
+ if (effect == NULL && node->op()->EffectInputCount() > 0) {
effect = NodeProperties::GetEffectInput(node);
}
// Requires distinguishing between value and effect edges.
- UseIter iter = node->uses().begin();
- while (iter != node->uses().end()) {
- if (NodeProperties::IsEffectEdge(iter.edge())) {
+ for (Edge edge : node->use_edges()) {
+ if (NodeProperties::IsEffectEdge(edge)) {
DCHECK_NE(NULL, effect);
- iter = iter.UpdateToAndIncrement(effect);
+ edge.UpdateTo(effect);
} else {
- iter = iter.UpdateToAndIncrement(value);
+ edge.UpdateTo(value);
}
}
}
@@ -198,12 +189,35 @@
// -----------------------------------------------------------------------------
// Type Bounds.
-inline Bounds NodeProperties::GetBounds(Node* node) { return node->bounds(); }
+inline bool NodeProperties::IsTyped(Node* node) {
+ Bounds bounds = node->bounds();
+ DCHECK((bounds.lower == NULL) == (bounds.upper == NULL));
+ return bounds.upper != NULL;
+}
+
+inline Bounds NodeProperties::GetBounds(Node* node) {
+ DCHECK(IsTyped(node));
+ return node->bounds();
+}
+
+inline void NodeProperties::RemoveBounds(Node* node) {
+ Bounds empty;
+ node->set_bounds(empty);
+}
inline void NodeProperties::SetBounds(Node* node, Bounds b) {
+ DCHECK(b.lower != NULL && b.upper != NULL);
node->set_bounds(b);
}
+inline bool NodeProperties::AllValueInputsAreTyped(Node* node) {
+ int input_count = node->op()->ValueInputCount();
+ for (int i = 0; i < input_count; ++i) {
+ if (!IsTyped(GetValueInput(node, i))) return false;
+ }
+ return true;
+}
+
}
}