Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1061)

Unified Diff: src/compiler/node-properties-inl.h

Issue 686213002: Inline trivial OperatorProperties methods. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/node.cc ('k') | src/compiler/operator-properties.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/node-properties-inl.h
diff --git a/src/compiler/node-properties-inl.h b/src/compiler/node-properties-inl.h
index 78baf4d142bb96e1542739f530319769624d7b57..541c302e708e734471b854df290ce988bdcb4ac8 100644
--- a/src/compiler/node-properties-inl.h
+++ b/src/compiler/node-properties-inl.h
@@ -44,8 +44,7 @@ inline int NodeProperties::FirstControlIndex(Node* node) {
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 +58,11 @@ inline int NodeProperties::PastFrameStateIndex(Node* node) {
}
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 +70,7 @@ inline int NodeProperties::PastControlIndex(Node* node) {
// 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 +85,12 @@ inline Node* NodeProperties::GetFrameStateInput(Node* node) {
}
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);
}
@@ -119,7 +113,7 @@ inline bool NodeProperties::IsInputRange(Node::Edge edge, int first, int num) {
inline bool NodeProperties::IsValueEdge(Node::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) {
@@ -131,13 +125,13 @@ inline bool NodeProperties::IsContextEdge(Node::Edge edge) {
inline bool NodeProperties::IsEffectEdge(Node::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) {
Node* node = edge.from();
return IsInputRange(edge, FirstControlIndex(node),
- OperatorProperties::GetControlInputCount(node->op()));
+ node->op()->ControlInputCount());
}
@@ -158,7 +152,7 @@ inline void NodeProperties::ReplaceControlInput(Node* node, Node* control) {
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 +163,7 @@ inline void NodeProperties::ReplaceFrameStateInput(Node* node,
}
inline void NodeProperties::RemoveNonValueInputs(Node* node) {
- node->TrimInputCount(OperatorProperties::GetValueInputCount(node->op()));
+ node->TrimInputCount(node->op()->ValueInputCount());
}
@@ -177,8 +171,8 @@ inline void NodeProperties::RemoveNonValueInputs(Node* node) {
// {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);
}
@@ -215,7 +209,7 @@ inline void NodeProperties::SetBounds(Node* node, Bounds b) {
}
inline bool NodeProperties::AllValueInputsAreTyped(Node* node) {
- int input_count = OperatorProperties::GetValueInputCount(node->op());
+ int input_count = node->op()->ValueInputCount();
for (int i = 0; i < input_count; ++i) {
if (!IsTyped(GetValueInput(node, i))) return false;
}
« no previous file with comments | « src/compiler/node.cc ('k') | src/compiler/operator-properties.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698