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

Side by Side Diff: src/compiler/node.h

Issue 658543002: Better typing and type verification (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | src/compiler/node-properties.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_COMPILER_NODE_H_ 5 #ifndef V8_COMPILER_NODE_H_
6 #define V8_COMPILER_NODE_H_ 6 #define V8_COMPILER_NODE_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 13 matching lines...) Expand all
24 class NodeData { 24 class NodeData {
25 public: 25 public:
26 const Operator* op() const { return op_; } 26 const Operator* op() const { return op_; }
27 void set_op(const Operator* op) { op_ = op; } 27 void set_op(const Operator* op) { op_ = op; }
28 28
29 IrOpcode::Value opcode() const { 29 IrOpcode::Value opcode() const {
30 DCHECK(op_->opcode() <= IrOpcode::kLast); 30 DCHECK(op_->opcode() <= IrOpcode::kLast);
31 return static_cast<IrOpcode::Value>(op_->opcode()); 31 return static_cast<IrOpcode::Value>(op_->opcode());
32 } 32 }
33 33
34 Bounds bounds() { return bounds_; }
35
36 protected: 34 protected:
37 const Operator* op_; 35 const Operator* op_;
38 Bounds bounds_; 36 Bounds bounds_;
39 explicit NodeData(Zone* zone) : bounds_(Bounds(Type::None(zone))) {} 37 explicit NodeData(Zone* zone) {}
40 38
41 friend class NodeProperties; 39 friend class NodeProperties;
40 Bounds bounds() { return bounds_; }
42 void set_bounds(Bounds b) { bounds_ = b; } 41 void set_bounds(Bounds b) { bounds_ = b; }
43 }; 42 };
44 43
45 // A Node is the basic primitive of an IR graph. In addition to the members 44 // A Node is the basic primitive of an IR graph. In addition to the members
46 // inherited from Vector, Nodes only contain a mutable Operator that may change 45 // inherited from Vector, Nodes only contain a mutable Operator that may change
47 // during compilation, e.g. during lowering passes. Other information that 46 // during compilation, e.g. during lowering passes. Other information that
48 // needs to be associated with Nodes during compilation must be stored 47 // needs to be associated with Nodes during compilation must be stored
49 // out-of-line indexed by the Node's id. 48 // out-of-line indexed by the Node's id.
50 class Node FINAL : public GenericNode<NodeData, Node> { 49 class Node FINAL : public GenericNode<NodeData, Node> {
51 public: 50 public:
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 template <typename T> 84 template <typename T>
86 static inline const T& OpParameter(const Node* node) { 85 static inline const T& OpParameter(const Node* node) {
87 return OpParameter<T>(node->op()); 86 return OpParameter<T>(node->op());
88 } 87 }
89 88
90 } // namespace compiler 89 } // namespace compiler
91 } // namespace internal 90 } // namespace internal
92 } // namespace v8 91 } // namespace v8
93 92
94 #endif // V8_COMPILER_NODE_H_ 93 #endif // V8_COMPILER_NODE_H_
OLDNEW
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | src/compiler/node-properties.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698