OLD | NEW |
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_OPERATOR_H_ | 5 #ifndef V8_COMPILER_OPERATOR_H_ |
6 #define V8_COMPILER_OPERATOR_H_ | 6 #define V8_COMPILER_OPERATOR_H_ |
7 | 7 |
8 #include <ostream> // NOLINT(readability/streams) | 8 #include <ostream> // NOLINT(readability/streams) |
9 | 9 |
10 #include "src/base/flags.h" | 10 #include "src/base/flags.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 // IR graph. | 23 // IR graph. |
24 // Operators are immutable and describe the statically-known parts of a | 24 // Operators are immutable and describe the statically-known parts of a |
25 // computation. Thus they can be safely shared by many different nodes in the | 25 // computation. Thus they can be safely shared by many different nodes in the |
26 // IR graph, or even globally between graphs. Operators can have "static | 26 // IR graph, or even globally between graphs. Operators can have "static |
27 // parameters" which are compile-time constant parameters to the operator, such | 27 // parameters" which are compile-time constant parameters to the operator, such |
28 // as the name for a named field access, the ID of a runtime function, etc. | 28 // as the name for a named field access, the ID of a runtime function, etc. |
29 // Static parameters are private to the operator and only semantically | 29 // Static parameters are private to the operator and only semantically |
30 // meaningful to the operator itself. | 30 // meaningful to the operator itself. |
31 class Operator : public ZoneObject { | 31 class Operator : public ZoneObject { |
32 public: | 32 public: |
33 typedef uint8_t Opcode; | 33 typedef uint16_t Opcode; |
34 | 34 |
35 // Properties inform the operator-independent optimizer about legal | 35 // Properties inform the operator-independent optimizer about legal |
36 // transformations for nodes that have this operator. | 36 // transformations for nodes that have this operator. |
37 enum Property { | 37 enum Property { |
38 kNoProperties = 0, | 38 kNoProperties = 0, |
39 kReducible = 1 << 0, // Participates in strength reduction. | 39 kReducible = 1 << 0, // Participates in strength reduction. |
40 kCommutative = 1 << 1, // OP(a, b) == OP(b, a) for all inputs. | 40 kCommutative = 1 << 1, // OP(a, b) == OP(b, a) for all inputs. |
41 kAssociative = 1 << 2, // OP(a, OP(b,c)) == OP(OP(a,b), c) for all inputs. | 41 kAssociative = 1 << 2, // OP(a, OP(b,c)) == OP(OP(a,b), c) for all inputs. |
42 kIdempotent = 1 << 3, // OP(a); OP(a) == OP(a). | 42 kIdempotent = 1 << 3, // OP(a); OP(a) == OP(a). |
43 kNoRead = 1 << 4, // Has no scheduling dependency on Effects | 43 kNoRead = 1 << 4, // Has no scheduling dependency on Effects |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 template <> | 223 template <> |
224 struct OpEqualTo<Handle<ScopeInfo>> : public Handle<ScopeInfo>::equal_to {}; | 224 struct OpEqualTo<Handle<ScopeInfo>> : public Handle<ScopeInfo>::equal_to {}; |
225 template <> | 225 template <> |
226 struct OpHash<Handle<ScopeInfo>> : public Handle<ScopeInfo>::hash {}; | 226 struct OpHash<Handle<ScopeInfo>> : public Handle<ScopeInfo>::hash {}; |
227 | 227 |
228 } // namespace compiler | 228 } // namespace compiler |
229 } // namespace internal | 229 } // namespace internal |
230 } // namespace v8 | 230 } // namespace v8 |
231 | 231 |
232 #endif // V8_COMPILER_OPERATOR_H_ | 232 #endif // V8_COMPILER_OPERATOR_H_ |
OLD | NEW |