"src/compiler/node-marker.h",
"src/compiler/node-matchers.h",
"src/compiler/node-properties.cc",
- "src/compiler/node-properties-inl.h",
"src/compiler/node-properties.h",
"src/compiler/node.cc",
"src/compiler/node.h",
#include "src/compiler/code-generator-impl.h"
#include "src/compiler/gap-resolver.h"
#include "src/compiler/node-matchers.h"
-#include "src/compiler/node-properties-inl.h"
#include "src/compiler/osr.h"
#include "src/scopes.h"
#include "src/compiler/code-generator-impl.h"
#include "src/compiler/gap-resolver.h"
#include "src/compiler/node-matchers.h"
-#include "src/compiler/node-properties-inl.h"
#include "src/compiler/osr.h"
#include "src/scopes.h"
#include "src/compiler/control-builders.h"
#include "src/compiler/machine-operator.h"
#include "src/compiler/node-matchers.h"
-#include "src/compiler/node-properties-inl.h"
#include "src/compiler/node-properties.h"
+#include "src/compiler/operator-properties.h"
#include "src/full-codegen.h"
#include "src/parser.h"
#include "src/scopes.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/linkage.h"
#include "src/compiler/machine-operator.h"
-#include "src/compiler/node-properties-inl.h"
+#include "src/compiler/node-properties.h"
+#include "src/compiler/operator-properties.h"
namespace v8 {
namespace internal {
#include "src/compiler/js-graph.h"
#include "src/compiler/node-marker.h"
#include "src/compiler/node-matchers.h"
-#include "src/compiler/node-properties-inl.h"
+#include "src/compiler/node-properties.h"
#include "src/zone-containers.h"
namespace v8 {
pop = false; // restart traversing successors of this node.
break;
}
- if (IrOpcode::IsControlOpcode(succ->opcode()) &&
+ if (NodeProperties::IsControl(succ) &&
!marked.IsReachableFromStart(succ)) {
// {succ} is a control node and not yet reached from start.
marked.Push(succ);
// Any control nodes not reachable from start are dead, even loops.
for (size_t i = 0; i < nodes.size(); i++) {
Node* node = nodes[i];
- if (IrOpcode::IsControlOpcode(node->opcode()) &&
+ if (NodeProperties::IsControl(node) &&
!marked.IsReachableFromStart(node)) {
ReplaceNode(node, dead()); // uses will be added to revisit queue.
}
// Gather phis and effect phis to be edited.
ZoneVector<Node*> phis(zone_);
for (Node* const use : node->uses()) {
- if (IrOpcode::IsPhiOpcode(use->opcode())) phis.push_back(use);
+ if (NodeProperties::IsPhi(use)) phis.push_back(use);
}
if (live == 1) {
#include "src/compiler/graph-visualizer.h"
#include "src/compiler/node.h"
#include "src/compiler/node-properties.h"
-#include "src/compiler/node-properties-inl.h"
#include "src/compiler/operator-properties.h"
namespace v8 {
#include "src/compiler/graph.h"
#include "src/compiler/node.h"
#include "src/compiler/node-properties.h"
-#include "src/compiler/node-properties-inl.h"
#include "src/compiler/opcodes.h"
#include "src/compiler/operator.h"
+#include "src/compiler/operator-properties.h"
#include "src/compiler/register-allocator.h"
#include "src/compiler/schedule.h"
#include "src/compiler/scheduler.h"
static bool IsLikelyBackEdge(Node* from, int index, Node* to) {
- if (IrOpcode::IsPhiOpcode(from->opcode())) {
+ if (NodeProperties::IsPhi(from)) {
Node* control = NodeProperties::GetControlInput(from, 0);
return control != NULL && control->opcode() != IrOpcode::kMerge &&
control != to && index != 0;
#include "src/compiler/code-generator-impl.h"
#include "src/compiler/gap-resolver.h"
#include "src/compiler/node-matchers.h"
-#include "src/compiler/node-properties-inl.h"
#include "src/compiler/osr.h"
#include "src/ia32/assembler-ia32.h"
#include "src/ia32/macro-assembler-ia32.h"
#include "src/compiler/instruction-selector-impl.h"
#include "src/compiler/node-matchers.h"
-#include "src/compiler/node-properties-inl.h"
+#include "src/compiler/node-properties.h"
namespace v8 {
namespace internal {
#include "src/compiler/instruction-selector-impl.h"
#include "src/compiler/node-matchers.h"
-#include "src/compiler/node-properties-inl.h"
+#include "src/compiler/node-properties.h"
#include "src/compiler/pipeline.h"
namespace v8 {
#include "src/compiler/js-builtin-reducer.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/node-matchers.h"
-#include "src/compiler/node-properties-inl.h"
+#include "src/compiler/node-properties.h"
#include "src/types.h"
namespace v8 {
#include "src/compiler/common-operator.h"
#include "src/compiler/js-operator.h"
#include "src/compiler/node-matchers.h"
-#include "src/compiler/node-properties-inl.h"
+#include "src/compiler/node-properties.h"
namespace v8 {
namespace internal {
#include "src/compiler/machine-operator.h"
#include "src/compiler/node-aux-data-inl.h"
#include "src/compiler/node-matchers.h"
-#include "src/compiler/node-properties-inl.h"
+#include "src/compiler/node-properties.h"
+#include "src/compiler/operator-properties.h"
#include "src/unique.h"
namespace v8 {
#include "src/code-stubs.h"
#include "src/compiler/js-graph.h"
-#include "src/compiler/node-properties-inl.h"
+#include "src/compiler/node-properties.h"
#include "src/compiler/typer.h"
namespace v8 {
#include "src/compiler/js-operator.h"
#include "src/compiler/node-aux-data-inl.h"
#include "src/compiler/node-matchers.h"
-#include "src/compiler/node-properties-inl.h"
+#include "src/compiler/node-properties.h"
#include "src/compiler/simplified-operator.h"
#include "src/compiler/typer.h"
#include "src/full-codegen.h"
#include "src/compiler/access-builder.h"
#include "src/compiler/js-graph.h"
-#include "src/compiler/node-properties-inl.h"
+#include "src/compiler/node-properties.h"
namespace v8 {
namespace internal {
#include "src/compiler/js-typed-lowering.h"
#include "src/compiler/node-aux-data-inl.h"
#include "src/compiler/node-matchers.h"
-#include "src/compiler/node-properties-inl.h"
+#include "src/compiler/node-properties.h"
+#include "src/compiler/operator-properties.h"
#include "src/types.h"
namespace v8 {
Reduction JSTypedLowering::Reduce(Node* node) {
// Check if the output type is a singleton. In that case we already know the
// result value and can simply replace the node if it's eliminable.
- if (!IrOpcode::IsConstantOpcode(node->opcode()) &&
- NodeProperties::IsTyped(node) &&
+ if (!NodeProperties::IsConstant(node) && NodeProperties::IsTyped(node) &&
node->op()->HasProperty(Operator::kEliminatable)) {
Type* upper = NodeProperties::GetBounds(node).upper;
if (upper->IsConstant()) {
#include "src/compiler/load-elimination.h"
-#include "src/compiler/node-properties-inl.h"
+#include "src/compiler/node-properties.h"
#include "src/compiler/simplified-operator.h"
namespace v8 {
#include "src/compiler/graph.h"
#include "src/compiler/node.h"
#include "src/compiler/node-marker.h"
-#include "src/compiler/node-properties-inl.h"
+#include "src/compiler/node-properties.h"
#include "src/zone.h"
namespace v8 {
if (node->opcode() == IrOpcode::kLoop) {
// found the loop node first.
loop_num = CreateLoopInfo(node);
- } else if (IrOpcode::IsPhiOpcode(node->opcode())) {
+ } else if (NodeProperties::IsPhi(node)) {
// found a phi first.
Node* merge = node->InputAt(node->InputCount() - 1);
if (merge->opcode() == IrOpcode::kLoop) {
// Setup loop mark for phis attached to loop header.
for (Node* use : node->uses()) {
- if (IrOpcode::IsPhiOpcode(use->opcode())) {
+ if (NodeProperties::IsPhi(use)) {
SetBackwardMark(use, loop_num);
loop_tree_->node_to_loop_num_[use->id()] = loop_num;
}
bool IsBackedge(Node* use, Edge& edge) {
if (LoopNum(use) <= 0) return false;
if (edge.index() == kAssumedLoopEntryIndex) return false;
- if (IrOpcode::IsPhiOpcode(use->opcode())) {
+ if (NodeProperties::IsPhi(use)) {
return !NodeProperties::IsControlEdge(edge);
}
return true;
#include "src/compiler/loop-peeling.h"
#include "src/compiler/node.h"
#include "src/compiler/node-marker.h"
-#include "src/compiler/node-properties-inl.h"
+#include "src/compiler/node-properties.h"
#include "src/zone.h"
// Loop peeling is an optimization that copies the body of a loop, creating
if (end != NULL) {
exits.push_back(end);
for (Node* use : end->uses()) {
- if (IrOpcode::IsPhiOpcode(use->opcode())) exits.push_back(use);
+ if (NodeProperties::IsPhi(use)) exits.push_back(use);
}
}
}
#include "src/compiler/code-generator-impl.h"
#include "src/compiler/gap-resolver.h"
#include "src/compiler/node-matchers.h"
-#include "src/compiler/node-properties-inl.h"
#include "src/compiler/osr.h"
#include "src/mips/macro-assembler-mips.h"
#include "src/scopes.h"
#include "src/compiler/code-generator-impl.h"
#include "src/compiler/gap-resolver.h"
#include "src/compiler/node-matchers.h"
-#include "src/compiler/node-properties-inl.h"
#include "src/compiler/osr.h"
#include "src/mips/macro-assembler-mips.h"
#include "src/scopes.h"
+++ /dev/null
-// Copyright 2013 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_NODE_PROPERTIES_INL_H_
-#define V8_COMPILER_NODE_PROPERTIES_INL_H_
-
-#include "src/v8.h"
-
-#include "src/compiler/common-operator.h"
-#include "src/compiler/node-properties.h"
-#include "src/compiler/opcodes.h"
-#include "src/compiler/operator.h"
-#include "src/compiler/operator-properties.h"
-
-namespace v8 {
-namespace internal {
-namespace compiler {
-
-// -----------------------------------------------------------------------------
-// Input layout.
-// Inputs are always arranged in order as follows:
-// 0 [ values, context, effects, control ] node->InputCount()
-
-inline int NodeProperties::FirstValueIndex(Node* node) { return 0; }
-
-inline int NodeProperties::FirstContextIndex(Node* node) {
- return PastValueIndex(node);
-}
-
-inline int NodeProperties::FirstFrameStateIndex(Node* node) {
- return PastContextIndex(node);
-}
-
-inline int NodeProperties::FirstEffectIndex(Node* node) {
- return PastFrameStateIndex(node);
-}
-
-inline int NodeProperties::FirstControlIndex(Node* node) {
- return PastEffectIndex(node);
-}
-
-
-inline int NodeProperties::PastValueIndex(Node* node) {
- return FirstValueIndex(node) + node->op()->ValueInputCount();
-}
-
-inline int NodeProperties::PastContextIndex(Node* node) {
- return FirstContextIndex(node) +
- OperatorProperties::GetContextInputCount(node->op());
-}
-
-inline int NodeProperties::PastFrameStateIndex(Node* node) {
- return FirstFrameStateIndex(node) +
- OperatorProperties::GetFrameStateInputCount(node->op());
-}
-
-inline int NodeProperties::PastEffectIndex(Node* node) {
- return FirstEffectIndex(node) + node->op()->EffectInputCount();
-}
-
-inline int NodeProperties::PastControlIndex(Node* node) {
- return FirstControlIndex(node) + node->op()->ControlInputCount();
-}
-
-
-// -----------------------------------------------------------------------------
-// Input accessors.
-
-inline Node* NodeProperties::GetValueInput(Node* node, int index) {
- DCHECK(0 <= index && index < node->op()->ValueInputCount());
- return node->InputAt(FirstValueIndex(node) + index);
-}
-
-inline Node* NodeProperties::GetContextInput(Node* node) {
- DCHECK(OperatorProperties::HasContextInput(node->op()));
- return node->InputAt(FirstContextIndex(node));
-}
-
-inline Node* NodeProperties::GetFrameStateInput(Node* node) {
- DCHECK(OperatorProperties::HasFrameStateInput(node->op()));
- return node->InputAt(FirstFrameStateIndex(node));
-}
-
-inline Node* NodeProperties::GetEffectInput(Node* node, int index) {
- 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 < node->op()->ControlInputCount());
- return node->InputAt(FirstControlIndex(node) + index);
-}
-
-inline int NodeProperties::GetFrameStateIndex(Node* node) {
- DCHECK(OperatorProperties::HasFrameStateInput(node->op()));
- return FirstFrameStateIndex(node);
-}
-
-// -----------------------------------------------------------------------------
-// Edge kinds.
-
-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;
- int index = edge.index();
- return first <= index && index < first + num;
-}
-
-inline bool NodeProperties::IsValueEdge(Edge edge) {
- Node* node = edge.from();
- return IsInputRange(edge, FirstValueIndex(node),
- node->op()->ValueInputCount());
-}
-
-inline bool NodeProperties::IsContextEdge(Edge edge) {
- Node* node = edge.from();
- return IsInputRange(edge, FirstContextIndex(node),
- OperatorProperties::GetContextInputCount(node->op()));
-}
-
-inline bool NodeProperties::IsEffectEdge(Edge edge) {
- Node* node = edge.from();
- return IsInputRange(edge, FirstEffectIndex(node),
- node->op()->EffectInputCount());
-}
-
-inline bool NodeProperties::IsControlEdge(Edge edge) {
- Node* node = edge.from();
- return IsInputRange(edge, FirstControlIndex(node),
- node->op()->ControlInputCount());
-}
-
-
-// -----------------------------------------------------------------------------
-// Miscellaneous predicates.
-
-inline bool NodeProperties::IsControl(Node* node) {
- return IrOpcode::IsControlOpcode(node->opcode());
-}
-
-
-// -----------------------------------------------------------------------------
-// Miscellaneous mutators.
-
-inline void NodeProperties::ReplaceContextInput(Node* node, Node* context) {
- node->ReplaceInput(FirstContextIndex(node), context);
-}
-
-inline void NodeProperties::ReplaceControlInput(Node* node, Node* control) {
- node->ReplaceInput(FirstControlIndex(node), control);
-}
-
-inline void NodeProperties::ReplaceEffectInput(Node* node, Node* effect,
- int index) {
- DCHECK(index < node->op()->EffectInputCount());
- return node->ReplaceInput(FirstEffectIndex(node) + index, effect);
-}
-
-inline void NodeProperties::ReplaceFrameStateInput(Node* node,
- Node* frame_state) {
- DCHECK(OperatorProperties::HasFrameStateInput(node->op()));
- node->ReplaceInput(FirstFrameStateIndex(node), frame_state);
-}
-
-inline void NodeProperties::RemoveNonValueInputs(Node* node) {
- node->TrimInputCount(node->op()->ValueInputCount());
-}
-
-
-// Replace value uses of {node} with {value} and effect uses of {node} with
-// {effect}. If {effect == NULL}, then use the effect input to {node}.
-inline void NodeProperties::ReplaceWithValue(Node* node, Node* value,
- Node* effect) {
- DCHECK(node->op()->ControlOutputCount() == 0);
- if (effect == NULL && node->op()->EffectInputCount() > 0) {
- effect = NodeProperties::GetEffectInput(node);
- }
-
- // Requires distinguishing between value and effect edges.
- for (Edge edge : node->use_edges()) {
- if (NodeProperties::IsEffectEdge(edge)) {
- DCHECK_NE(NULL, effect);
- edge.UpdateTo(effect);
- } else {
- edge.UpdateTo(value);
- }
- }
-}
-
-
-// -----------------------------------------------------------------------------
-// Type 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;
-}
-
-
-}
-}
-} // namespace v8::internal::compiler
-
-#endif // V8_COMPILER_NODE_PROPERTIES_INL_H_
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "src/compiler/common-operator.h"
#include "src/compiler/node-properties.h"
+#include "src/compiler/common-operator.h"
+#include "src/compiler/operator-properties.h"
+
namespace v8 {
namespace internal {
namespace compiler {
+// static
+int NodeProperties::PastValueIndex(Node* node) {
+ return FirstValueIndex(node) + node->op()->ValueInputCount();
+}
+
+
+// static
+int NodeProperties::PastContextIndex(Node* node) {
+ return FirstContextIndex(node) +
+ OperatorProperties::GetContextInputCount(node->op());
+}
+
+
+// static
+int NodeProperties::PastFrameStateIndex(Node* node) {
+ return FirstFrameStateIndex(node) +
+ OperatorProperties::GetFrameStateInputCount(node->op());
+}
+
+
+// static
+int NodeProperties::PastEffectIndex(Node* node) {
+ return FirstEffectIndex(node) + node->op()->EffectInputCount();
+}
+
+
+// static
+int NodeProperties::PastControlIndex(Node* node) {
+ return FirstControlIndex(node) + node->op()->ControlInputCount();
+}
+
+
+// static
+Node* NodeProperties::GetValueInput(Node* node, int index) {
+ DCHECK(0 <= index && index < node->op()->ValueInputCount());
+ return node->InputAt(FirstValueIndex(node) + index);
+}
+
+
+// static
+Node* NodeProperties::GetContextInput(Node* node) {
+ DCHECK(OperatorProperties::HasContextInput(node->op()));
+ return node->InputAt(FirstContextIndex(node));
+}
+
+
+// static
+Node* NodeProperties::GetFrameStateInput(Node* node) {
+ DCHECK(OperatorProperties::HasFrameStateInput(node->op()));
+ return node->InputAt(FirstFrameStateIndex(node));
+}
+
+
+// static
+Node* NodeProperties::GetEffectInput(Node* node, int index) {
+ DCHECK(0 <= index && index < node->op()->EffectInputCount());
+ return node->InputAt(FirstEffectIndex(node) + index);
+}
+
+
+// static
+Node* NodeProperties::GetControlInput(Node* node, int index) {
+ DCHECK(0 <= index && index < node->op()->ControlInputCount());
+ return node->InputAt(FirstControlIndex(node) + index);
+}
+
+
+// static
+bool NodeProperties::IsValueEdge(Edge edge) {
+ Node* const node = edge.from();
+ return IsInputRange(edge, FirstValueIndex(node),
+ node->op()->ValueInputCount());
+}
+
+
+// static
+bool NodeProperties::IsContextEdge(Edge edge) {
+ Node* const node = edge.from();
+ return IsInputRange(edge, FirstContextIndex(node),
+ OperatorProperties::GetContextInputCount(node->op()));
+}
+
+
+// static
+bool NodeProperties::IsFrameStateEdge(Edge edge) {
+ Node* const node = edge.from();
+ return IsInputRange(edge, FirstFrameStateIndex(node),
+ OperatorProperties::GetFrameStateInputCount(node->op()));
+}
+
+
+// static
+bool NodeProperties::IsEffectEdge(Edge edge) {
+ Node* const node = edge.from();
+ return IsInputRange(edge, FirstEffectIndex(node),
+ node->op()->EffectInputCount());
+}
+
+
+// static
+bool NodeProperties::IsControlEdge(Edge edge) {
+ Node* const node = edge.from();
+ return IsInputRange(edge, FirstControlIndex(node),
+ node->op()->ControlInputCount());
+}
+
+
+// static
+void NodeProperties::ReplaceContextInput(Node* node, Node* context) {
+ node->ReplaceInput(FirstContextIndex(node), context);
+}
+
+
+// static
+void NodeProperties::ReplaceControlInput(Node* node, Node* control) {
+ node->ReplaceInput(FirstControlIndex(node), control);
+}
+
+
+// static
+void NodeProperties::ReplaceEffectInput(Node* node, Node* effect, int index) {
+ DCHECK(index < node->op()->EffectInputCount());
+ return node->ReplaceInput(FirstEffectIndex(node) + index, effect);
+}
+
+
+// static
+void NodeProperties::ReplaceFrameStateInput(Node* node, Node* frame_state) {
+ DCHECK(OperatorProperties::HasFrameStateInput(node->op()));
+ node->ReplaceInput(FirstFrameStateIndex(node), frame_state);
+}
+
+
+// static
+void NodeProperties::RemoveNonValueInputs(Node* node) {
+ node->TrimInputCount(node->op()->ValueInputCount());
+}
+
+
+// static
+void NodeProperties::ReplaceWithValue(Node* node, Node* value, Node* effect) {
+ DCHECK(node->op()->ControlOutputCount() == 0);
+ if (!effect && node->op()->EffectInputCount() > 0) {
+ effect = NodeProperties::GetEffectInput(node);
+ }
+
+ // Requires distinguishing between value and effect edges.
+ for (Edge edge : node->use_edges()) {
+ if (IsEffectEdge(edge)) {
+ DCHECK_NOT_NULL(effect);
+ edge.UpdateTo(effect);
+ } else {
+ edge.UpdateTo(value);
+ }
+ }
+}
+
+
+// static
Node* NodeProperties::FindProjection(Node* node, size_t projection_index) {
for (auto use : node->uses()) {
if (use->opcode() == IrOpcode::kProjection &&
return nullptr;
}
+
+// static
+bool NodeProperties::AllValueInputsAreTyped(Node* node) {
+ int input_count = node->op()->ValueInputCount();
+ for (int index = 0; index < input_count; ++index) {
+ if (!IsTyped(GetValueInput(node, index))) return false;
+ }
+ return true;
+}
+
+
+// static
+bool NodeProperties::IsInputRange(Edge edge, int first, int num) {
+ if (num == 0) return false;
+ int const index = edge.index();
+ return first <= index && index < first + num;
+}
+
} // namespace compiler
} // namespace internal
} // namespace v8
class Operator;
// A facade that simplifies access to the different kinds of inputs to a node.
-class NodeProperties {
+class NodeProperties FINAL {
public:
- static inline Node* GetValueInput(Node* node, int index);
- static inline Node* GetContextInput(Node* node);
- static inline Node* GetFrameStateInput(Node* node);
- static inline Node* GetEffectInput(Node* node, int index = 0);
- static inline Node* GetControlInput(Node* node, int index = 0);
-
- static inline int GetFrameStateIndex(Node* node);
-
- static inline bool IsValueEdge(Edge edge);
- static inline bool IsContextEdge(Edge edge);
- static inline bool IsEffectEdge(Edge edge);
- static inline bool IsControlEdge(Edge edge);
-
- static inline bool IsControl(Node* node);
-
- static inline void ReplaceContextInput(Node* node, Node* context);
- static inline void ReplaceControlInput(Node* node, Node* control);
- static inline void ReplaceEffectInput(Node* node, Node* effect,
- int index = 0);
- static inline void ReplaceFrameStateInput(Node* node, Node* frame_state);
- static inline void RemoveNonValueInputs(Node* node);
- static inline void ReplaceWithValue(Node* node, Node* value,
- Node* effect = nullptr);
+ // ---------------------------------------------------------------------------
+ // Input layout.
+ // Inputs are always arranged in order as follows:
+ // 0 [ values, context, frame state, effects, control ] node->InputCount()
+
+ static int FirstValueIndex(Node* node) { return 0; }
+ static int FirstContextIndex(Node* node) { return PastValueIndex(node); }
+ static int FirstFrameStateIndex(Node* node) { return PastContextIndex(node); }
+ static int FirstEffectIndex(Node* node) { return PastFrameStateIndex(node); }
+ static int FirstControlIndex(Node* node) { return PastEffectIndex(node); }
+ static int PastValueIndex(Node* node);
+ static int PastContextIndex(Node* node);
+ static int PastFrameStateIndex(Node* node);
+ static int PastEffectIndex(Node* node);
+ static int PastControlIndex(Node* node);
+
+
+ // ---------------------------------------------------------------------------
+ // Input accessors.
+
+ static Node* GetValueInput(Node* node, int index);
+ static Node* GetContextInput(Node* node);
+ static Node* GetFrameStateInput(Node* node);
+ static Node* GetEffectInput(Node* node, int index = 0);
+ static Node* GetControlInput(Node* node, int index = 0);
+
+
+ // ---------------------------------------------------------------------------
+ // Edge kinds.
+
+ static bool IsValueEdge(Edge edge);
+ static bool IsContextEdge(Edge edge);
+ static bool IsFrameStateEdge(Edge edge);
+ static bool IsEffectEdge(Edge edge);
+ static bool IsControlEdge(Edge edge);
+
+
+ // ---------------------------------------------------------------------------
+ // Miscellaneous predicates.
+
+ static bool IsCommon(Node* node) {
+ return IrOpcode::IsCommonOpcode(node->opcode());
+ }
+ static bool IsControl(Node* node) {
+ return IrOpcode::IsControlOpcode(node->opcode());
+ }
+ static bool IsConstant(Node* node) {
+ return IrOpcode::IsConstantOpcode(node->opcode());
+ }
+ static bool IsPhi(Node* node) {
+ return IrOpcode::IsPhiOpcode(node->opcode());
+ }
+
+
+ // ---------------------------------------------------------------------------
+ // Miscellaneous mutators.
+
+ static void ReplaceContextInput(Node* node, Node* context);
+ static void ReplaceControlInput(Node* node, Node* control);
+ static void ReplaceEffectInput(Node* node, Node* effect, int index = 0);
+ static void ReplaceFrameStateInput(Node* node, Node* frame_state);
+ static void RemoveNonValueInputs(Node* node);
+
+ // Replace value uses of {node} with {value} and effect uses of {node} with
+ // {effect}. If {effect == NULL}, then use the effect input to {node}.
+ static void ReplaceWithValue(Node* node, Node* value, Node* effect = nullptr);
+
+
+ // ---------------------------------------------------------------------------
+ // Miscellaneous utilities.
static Node* FindProjection(Node* node, size_t projection_index);
- static inline bool IsTyped(Node* node);
- static inline Bounds GetBounds(Node* node);
- static inline void SetBounds(Node* node, Bounds bounds);
- static inline void RemoveBounds(Node* node);
- static inline bool AllValueInputsAreTyped(Node* node);
-
- static inline int FirstValueIndex(Node* node);
- static inline int FirstContextIndex(Node* node);
- static inline int FirstFrameStateIndex(Node* node);
- static inline int FirstEffectIndex(Node* node);
- static inline int FirstControlIndex(Node* node);
- static inline int PastValueIndex(Node* node);
- static inline int PastContextIndex(Node* node);
- static inline int PastFrameStateIndex(Node* node);
- static inline int PastEffectIndex(Node* node);
- static inline int PastControlIndex(Node* node);
+ // ---------------------------------------------------------------------------
+ // Type Bounds.
+
+ static bool IsTyped(Node* node) {
+ Bounds const bounds = node->bounds();
+ DCHECK(!bounds.lower == !bounds.upper);
+ return bounds.upper;
+ }
+ static Bounds GetBounds(Node* node) {
+ DCHECK(IsTyped(node));
+ return node->bounds();
+ }
+ static void SetBounds(Node* node, Bounds bounds) {
+ DCHECK_NOT_NULL(bounds.lower);
+ DCHECK_NOT_NULL(bounds.upper);
+ node->set_bounds(bounds);
+ }
+ static void RemoveBounds(Node* node) { node->set_bounds(Bounds()); }
+ static bool AllValueInputsAreTyped(Node* node);
+
+ private:
static inline bool IsInputRange(Edge edge, int first, int count);
};
#include "src/base/bits.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/machine-operator.h"
-#include "src/compiler/node-properties-inl.h"
#include "src/compiler/simplified-operator.h"
namespace v8 {
#include "src/compiler/node.h"
#include "src/compiler/node-properties.h"
-#include "src/compiler/node-properties-inl.h"
#include "src/ostreams.h"
namespace v8 {
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <deque>
-#include <queue>
-
#include "src/compiler/scheduler.h"
#include "src/bit-vector.h"
+#include "src/compiler/common-operator.h"
#include "src/compiler/control-equivalence.h"
#include "src/compiler/graph.h"
#include "src/compiler/graph-inl.h"
#include "src/compiler/node.h"
#include "src/compiler/node-marker.h"
-#include "src/compiler/node-properties-inl.h"
+#include "src/compiler/node-properties.h"
namespace v8 {
namespace internal {
NodeVector propagation_roots(control_flow_builder_->control_);
for (Node* node : control_flow_builder_->control_) {
for (Node* use : node->uses()) {
- if (IrOpcode::IsPhiOpcode(use->opcode()))
- propagation_roots.push_back(use);
+ if (NodeProperties::IsPhi(use)) propagation_roots.push_back(use);
}
}
if (FLAG_trace_turbo_scheduler) {
#include "src/compiler/diamond.h"
#include "src/compiler/linkage.h"
#include "src/compiler/node-matchers.h"
-#include "src/compiler/node-properties-inl.h"
+#include "src/compiler/node-properties.h"
+#include "src/compiler/operator-properties.h"
#include "src/compiler/representation-change.h"
#include "src/compiler/simplified-lowering.h"
#include "src/compiler/simplified-operator.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/machine-operator.h"
#include "src/compiler/node-matchers.h"
-#include "src/compiler/node-properties-inl.h"
+#include "src/compiler/node-properties.h"
+#include "src/compiler/operator-properties.h"
namespace v8 {
namespace internal {
#include "src/compiler/graph-reducer.h"
#include "src/compiler/js-operator.h"
#include "src/compiler/node.h"
-#include "src/compiler/node-properties-inl.h"
#include "src/compiler/node-properties.h"
#include "src/compiler/simplified-operator.h"
#include "src/compiler/typer.h"
#include "src/bit-vector.h"
#include "src/compiler/all-nodes.h"
+#include "src/compiler/common-operator.h"
#include "src/compiler/graph.h"
#include "src/compiler/node.h"
-#include "src/compiler/node-properties-inl.h"
#include "src/compiler/node-properties.h"
#include "src/compiler/opcodes.h"
#include "src/compiler/operator.h"
+#include "src/compiler/operator-properties.h"
#include "src/compiler/schedule.h"
#include "src/compiler/simplified-operator.h"
#include "src/ostreams.h"
#include "src/compiler/code-generator-impl.h"
#include "src/compiler/gap-resolver.h"
#include "src/compiler/node-matchers.h"
-#include "src/compiler/node-properties-inl.h"
#include "src/compiler/osr.h"
#include "src/scopes.h"
#include "src/x64/assembler-x64.h"
#include "src/compiler/change-lowering.h"
#include "src/compiler/control-builders.h"
#include "src/compiler/js-graph.h"
-#include "src/compiler/node-properties-inl.h"
+#include "src/compiler/node-properties.h"
#include "src/compiler/pipeline.h"
#include "src/compiler/select-lowering.h"
#include "src/compiler/simplified-lowering.h"
#include "src/compiler/control-reducer.h"
#include "src/compiler/graph-inl.h"
#include "src/compiler/js-graph.h"
-#include "src/compiler/node-properties-inl.h"
+#include "src/compiler/node-properties.h"
using namespace v8::internal;
using namespace v8::internal::compiler;
#include "src/assembler.h"
#include "src/compiler/js-graph.h"
-#include "src/compiler/node-properties-inl.h"
+#include "src/compiler/node-properties.h"
#include "src/compiler/typer.h"
#include "src/types.h"
#include "test/cctest/cctest.h"
#include "src/compiler/js-context-specialization.h"
#include "src/compiler/js-operator.h"
#include "src/compiler/node-matchers.h"
-#include "src/compiler/node-properties-inl.h"
+#include "src/compiler/node-properties.h"
#include "src/compiler/source-position.h"
#include "test/cctest/cctest.h"
#include "test/cctest/compiler/function-tester.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/js-typed-lowering.h"
#include "src/compiler/machine-operator.h"
-#include "src/compiler/node-properties-inl.h"
+#include "src/compiler/node-properties.h"
#include "src/compiler/opcodes.h"
+#include "src/compiler/operator-properties.h"
#include "src/compiler/typer.h"
#include "test/cctest/cctest.h"
#include "src/compiler/control-builders.h"
#include "src/compiler/graph-reducer.h"
#include "src/compiler/graph-visualizer.h"
-#include "src/compiler/node-properties-inl.h"
+#include "src/compiler/node-properties.h"
#include "src/compiler/pipeline.h"
#include "src/compiler/representation-change.h"
#include "src/compiler/simplified-lowering.h"
#include "src/codegen.h"
#include "src/compiler/js-operator.h"
-#include "src/compiler/node-properties-inl.h"
+#include "src/compiler/node-properties.h"
#include "src/compiler/typer.h"
#include "test/cctest/cctest.h"
#include "test/cctest/compiler/graph-builder-tester.h"
#include "src/compiler/change-lowering.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/linkage.h"
-#include "src/compiler/node-properties-inl.h"
+#include "src/compiler/node-properties.h"
#include "src/compiler/simplified-operator.h"
#include "test/unittests/compiler/compiler-test-utils.h"
#include "test/unittests/compiler/graph-unittest.h"
#include "src/bit-vector.h"
#include "src/compiler/control-equivalence.h"
#include "src/compiler/graph-visualizer.h"
-#include "src/compiler/node-properties-inl.h"
+#include "src/compiler/node-properties.h"
#include "src/zone-containers.h"
#include "test/unittests/compiler/graph-unittest.h"
#include "test/unittests/compiler/graph-unittest.h"
-#include "src/compiler/node-properties-inl.h"
+#include "src/compiler/node-properties.h"
#include "test/unittests/compiler/node-test-utils.h"
namespace v8 {
#include "src/compiler/js-builtin-reducer.h"
#include "src/compiler/js-graph.h"
-#include "src/compiler/node-properties-inl.h"
+#include "src/compiler/node-properties.h"
#include "src/compiler/typer.h"
#include "test/unittests/compiler/graph-unittest.h"
#include "test/unittests/compiler/node-test-utils.h"
#include "src/compiler/js-operator.h"
#include "src/compiler/js-typed-lowering.h"
#include "src/compiler/machine-operator.h"
-#include "src/compiler/node-properties-inl.h"
+#include "src/compiler/node-properties.h"
#include "test/unittests/compiler/compiler-test-utils.h"
#include "test/unittests/compiler/graph-unittest.h"
#include "test/unittests/compiler/node-test-utils.h"
#include "src/compiler/loop-peeling.h"
#include "src/compiler/machine-operator.h"
#include "src/compiler/node.h"
-#include "src/compiler/node-properties-inl.h"
+#include "src/compiler/node-properties.h"
#include "test/unittests/compiler/compiler-test-utils.h"
#include "test/unittests/compiler/graph-unittest.h"
#include "test/unittests/compiler/node-test-utils.h"
// found in the LICENSE file.
#include "src/compiler/common-operator.h"
-#include "src/compiler/node-properties-inl.h"
+#include "src/compiler/node-properties.h"
#include "test/unittests/test-utils.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "test/unittests/compiler/node-test-utils.h"
#include "src/assembler.h"
-#include "src/compiler/node-properties-inl.h"
+#include "src/compiler/node-properties.h"
#include "src/compiler/simplified-operator.h"
+#include "src/unique.h"
using testing::_;
using testing::MakeMatcher;
#include "src/compiler/access-builder.h"
#include "src/compiler/js-graph.h"
-#include "src/compiler/node-properties-inl.h"
+#include "src/compiler/node-properties.h"
#include "src/compiler/simplified-operator.h"
#include "src/compiler/simplified-operator-reducer.h"
#include "src/conversions.h"
'../../src/compiler/node-marker.cc',
'../../src/compiler/node-marker.h',
'../../src/compiler/node-matchers.h',
- '../../src/compiler/node-properties-inl.h',
'../../src/compiler/node-properties.cc',
'../../src/compiler/node-properties.h',
'../../src/compiler/node.cc',