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

Side by Side Diff: src/compiler/simplified-operator.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/compiler/operator-properties-inl.h ('k') | src/compiler/verifier.cc » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_SIMPLIFIED_OPERATOR_H_ 5 #ifndef V8_COMPILER_SIMPLIFIED_OPERATOR_H_
6 #define V8_COMPILER_SIMPLIFIED_OPERATOR_H_ 6 #define V8_COMPILER_SIMPLIFIED_OPERATOR_H_
7 7
8 #include "src/compiler/machine-operator.h" 8 #include "src/compiler/machine-operator.h"
9 #include "src/compiler/opcodes.h" 9 #include "src/compiler/opcodes.h"
10 #include "src/zone.h" 10 #include "src/zone.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 static OStream& PrintTo(OStream& os, const ElementAccess& val) { // NOLINT 74 static OStream& PrintTo(OStream& os, const ElementAccess& val) { // NOLINT
75 return os << val.header_size; 75 return os << val.header_size;
76 } 76 }
77 static int HashCode(const ElementAccess& val) { 77 static int HashCode(const ElementAccess& val) {
78 return (val.header_size < 16) | (val.machine_type & 0xffff); 78 return (val.header_size < 16) | (val.machine_type & 0xffff);
79 } 79 }
80 static bool Equals(const ElementAccess& lhs, const ElementAccess& rhs); 80 static bool Equals(const ElementAccess& lhs, const ElementAccess& rhs);
81 }; 81 };
82 82
83 83
84 inline const FieldAccess FieldAccessOf(Operator* op) { 84 inline const FieldAccess FieldAccessOf(const Operator* op) {
85 DCHECK(op->opcode() == IrOpcode::kLoadField || 85 DCHECK(op->opcode() == IrOpcode::kLoadField ||
86 op->opcode() == IrOpcode::kStoreField); 86 op->opcode() == IrOpcode::kStoreField);
87 return static_cast<Operator1<FieldAccess>*>(op)->parameter(); 87 return OpParameter<FieldAccess>(op);
88 } 88 }
89 89
90 90
91 inline const ElementAccess ElementAccessOf(Operator* op) { 91 inline const ElementAccess ElementAccessOf(const Operator* op) {
92 DCHECK(op->opcode() == IrOpcode::kLoadElement || 92 DCHECK(op->opcode() == IrOpcode::kLoadElement ||
93 op->opcode() == IrOpcode::kStoreElement); 93 op->opcode() == IrOpcode::kStoreElement);
94 return static_cast<Operator1<ElementAccess>*>(op)->parameter(); 94 return OpParameter<ElementAccess>(op);
95 } 95 }
96 96
97 97
98 // Interface for building simplified operators, which represent the 98 // Interface for building simplified operators, which represent the
99 // medium-level operations of V8, including adding numbers, allocating objects, 99 // medium-level operations of V8, including adding numbers, allocating objects,
100 // indexing into objects and arrays, etc. 100 // indexing into objects and arrays, etc.
101 // All operators are typed but many are representation independent. 101 // All operators are typed but many are representation independent.
102 102
103 // Number values from JS can be in one of these representations: 103 // Number values from JS can be in one of these representations:
104 // - Tagged: word-sized integer that is either 104 // - Tagged: word-sized integer that is either
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 #undef SIMPLE 181 #undef SIMPLE
182 182
183 private: 183 private:
184 Zone* zone_; 184 Zone* zone_;
185 }; 185 };
186 } 186 }
187 } 187 }
188 } // namespace v8::internal::compiler 188 } // namespace v8::internal::compiler
189 189
190 #endif // V8_COMPILER_SIMPLIFIED_OPERATOR_H_ 190 #endif // V8_COMPILER_SIMPLIFIED_OPERATOR_H_
OLDNEW
« no previous file with comments | « src/compiler/operator-properties-inl.h ('k') | src/compiler/verifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698