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

Unified Diff: src/compiler/node.h

Issue 539933002: [turbofan] Make sure Operator is really immutable. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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/js-inlining.cc ('k') | src/compiler/node-matchers.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « src/compiler/js-inlining.cc ('k') | src/compiler/node-matchers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698