Index: src/compiler/node.h |
diff --git a/src/compiler/node.h b/src/compiler/node.h |
index 9c2572ea7cf571bbbd382435036ac3250409b0f6..d8a44939f389d322e0a0708d05d767aaabe102f0 100644 |
--- a/src/compiler/node.h |
+++ b/src/compiler/node.h |
@@ -23,8 +23,8 @@ namespace compiler { |
class NodeData { |
public: |
- Operator* op() const { return op_; } |
- void set_op(Operator* op) { op_ = op; } |
+ const Operator* op() const { return op_; } |
+ void set_op(const Operator* op) { op_ = op; } |
IrOpcode::Value opcode() const { |
DCHECK(op_->opcode() <= IrOpcode::kLast); |
@@ -34,7 +34,7 @@ class NodeData { |
Bounds bounds() { return bounds_; } |
protected: |
- Operator* op_; |
+ const Operator* op_; |
Bounds bounds_; |
explicit NodeData(Zone* zone) : bounds_(Bounds(Type::None(zone))) {} |
@@ -47,12 +47,12 @@ class NodeData { |
// during compilation, e.g. during lowering passes. Other information that |
// needs to be associated with Nodes during compilation must be stored |
// out-of-line indexed by the Node's id. |
-class Node : public GenericNode<NodeData, Node> { |
+class Node FINAL : public GenericNode<NodeData, Node> { |
public: |
Node(GenericGraphBase* graph, int input_count) |
: GenericNode<NodeData, Node>(graph, input_count) {} |
- void Initialize(Operator* op) { set_op(op); } |
+ void Initialize(const Operator* op) { set_op(op); } |
void Kill(); |
void CollectProjections(ZoneVector<Node*>* projections); |
@@ -78,20 +78,14 @@ typedef NodeVectorVector::reverse_iterator NodeVectorVectorRIter; |
typedef Node::Uses::iterator UseIter; |
typedef Node::Inputs::iterator InputIter; |
-// Helper to extract parameters from Operator1<*> operator. |
-template <typename T> |
-static inline T OpParameter(Operator* op) { |
- return reinterpret_cast<Operator1<T>*>(op)->parameter(); |
-} |
- |
- |
// Helper to extract parameters from Operator1<*> nodes. |
template <typename T> |
-static inline T OpParameter(Node* node) { |
+static inline T OpParameter(const Node* node) { |
return OpParameter<T>(node->op()); |
} |
-} |
-} |
-} // namespace v8::internal::compiler |
+ |
+} // namespace compiler |
+} // namespace internal |
+} // namespace v8 |
#endif // V8_COMPILER_NODE_H_ |