OLD | NEW |
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 #include "src/compiler/machine-operator.h" | 5 #include "src/compiler/machine-operator.h" |
6 | 6 |
7 #include "src/base/lazy-instance.h" | 7 #include "src/base/lazy-instance.h" |
8 #include "src/compiler/opcodes.h" | 8 #include "src/compiler/opcodes.h" |
9 #include "src/compiler/operator.h" | 9 #include "src/compiler/operator.h" |
10 | 10 |
11 namespace v8 { | 11 namespace v8 { |
12 namespace internal { | 12 namespace internal { |
13 namespace compiler { | 13 namespace compiler { |
14 | 14 |
15 OStream& operator<<(OStream& os, const WriteBarrierKind& write_barrier_kind) { | 15 std::ostream& operator<<(std::ostream& os, |
| 16 const WriteBarrierKind& write_barrier_kind) { |
16 switch (write_barrier_kind) { | 17 switch (write_barrier_kind) { |
17 case kNoWriteBarrier: | 18 case kNoWriteBarrier: |
18 return os << "NoWriteBarrier"; | 19 return os << "NoWriteBarrier"; |
19 case kFullWriteBarrier: | 20 case kFullWriteBarrier: |
20 return os << "FullWriteBarrier"; | 21 return os << "FullWriteBarrier"; |
21 } | 22 } |
22 UNREACHABLE(); | 23 UNREACHABLE(); |
23 return os; | 24 return os; |
24 } | 25 } |
25 | 26 |
26 | 27 |
27 OStream& operator<<(OStream& os, const StoreRepresentation& rep) { | 28 std::ostream& operator<<(std::ostream& os, const StoreRepresentation& rep) { |
28 return os << "(" << rep.machine_type() << " : " << rep.write_barrier_kind() | 29 return os << "(" << rep.machine_type() << " : " << rep.write_barrier_kind() |
29 << ")"; | 30 << ")"; |
30 } | 31 } |
31 | 32 |
32 | 33 |
33 template <> | 34 template <> |
34 struct StaticParameterTraits<StoreRepresentation> { | 35 struct StaticParameterTraits<StoreRepresentation> { |
35 static OStream& PrintTo(OStream& os, const StoreRepresentation& rep) { | 36 static std::ostream& PrintTo(std::ostream& os, |
| 37 const StoreRepresentation& rep) { |
36 return os << rep; | 38 return os << rep; |
37 } | 39 } |
38 static int HashCode(const StoreRepresentation& rep) { | 40 static int HashCode(const StoreRepresentation& rep) { |
39 return rep.machine_type() + rep.write_barrier_kind(); | 41 return rep.machine_type() + rep.write_barrier_kind(); |
40 } | 42 } |
41 static bool Equals(const StoreRepresentation& rep1, | 43 static bool Equals(const StoreRepresentation& rep1, |
42 const StoreRepresentation& rep2) { | 44 const StoreRepresentation& rep2) { |
43 return rep1 == rep2; | 45 return rep1 == rep2; |
44 } | 46 } |
45 }; | 47 }; |
46 | 48 |
47 | 49 |
48 template <> | 50 template <> |
49 struct StaticParameterTraits<LoadRepresentation> { | 51 struct StaticParameterTraits<LoadRepresentation> { |
50 static OStream& PrintTo(OStream& os, LoadRepresentation type) { // NOLINT | 52 static std::ostream& PrintTo(std::ostream& os, |
| 53 LoadRepresentation type) { // NOLINT |
51 return os << type; | 54 return os << type; |
52 } | 55 } |
53 static int HashCode(LoadRepresentation type) { return type; } | 56 static int HashCode(LoadRepresentation type) { return type; } |
54 static bool Equals(LoadRepresentation lhs, LoadRepresentation rhs) { | 57 static bool Equals(LoadRepresentation lhs, LoadRepresentation rhs) { |
55 return lhs == rhs; | 58 return lhs == rhs; |
56 } | 59 } |
57 }; | 60 }; |
58 | 61 |
59 | 62 |
60 #define PURE_OP_LIST(V) \ | 63 #define PURE_OP_LIST(V) \ |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 default: | 238 default: |
236 break; | 239 break; |
237 } | 240 } |
238 UNREACHABLE(); | 241 UNREACHABLE(); |
239 return NULL; | 242 return NULL; |
240 } | 243 } |
241 | 244 |
242 } // namespace compiler | 245 } // namespace compiler |
243 } // namespace internal | 246 } // namespace internal |
244 } // namespace v8 | 247 } // namespace v8 |
OLD | NEW |