| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/simplified-operator.h" | 5 #include "src/compiler/simplified-operator.h" |
| 6 | 6 |
| 7 #include <ostream> // NOLINT(readability/streams) | 7 #include <ostream> // NOLINT(readability/streams) |
| 8 | 8 |
| 9 #include "src/base/lazy-instance.h" | 9 #include "src/base/lazy-instance.h" |
| 10 #include "src/compiler/opcodes.h" | 10 #include "src/compiler/opcodes.h" |
| 11 #include "src/compiler/operator.h" | 11 #include "src/compiler/operator.h" |
| 12 #include "src/types-inl.h" | 12 #include "src/types-inl.h" |
| 13 | 13 |
| 14 namespace v8 { | 14 namespace v8 { |
| 15 namespace internal { | 15 namespace internal { |
| 16 namespace compiler { | 16 namespace compiler { |
| 17 | 17 |
| 18 std::ostream& operator<<(std::ostream& os, BaseTaggedness base_taggedness) { | 18 std::ostream& operator<<(std::ostream& os, BaseTaggedness base_taggedness) { |
| 19 switch (base_taggedness) { | 19 switch (base_taggedness) { |
| 20 case kUntaggedBase: | 20 case kUntaggedBase: |
| 21 return os << "untagged base"; | 21 return os << "untagged base"; |
| 22 case kTaggedBase: | 22 case kTaggedBase: |
| 23 return os << "tagged base"; | 23 return os << "tagged base"; |
| 24 } | 24 } |
| 25 UNREACHABLE(); | 25 UNREACHABLE(); |
| 26 return os; | 26 return os; |
| 27 } | 27 } |
| 28 | 28 |
| 29 | 29 |
| 30 bool operator==(FieldAccess const& lhs, FieldAccess const& rhs) { |
| 31 return lhs.base_is_tagged == rhs.base_is_tagged && lhs.offset == rhs.offset && |
| 32 lhs.type == rhs.type && lhs.machine_type == rhs.machine_type; |
| 33 } |
| 34 |
| 35 |
| 36 bool operator!=(FieldAccess const& lhs, FieldAccess const& rhs) { |
| 37 return !(lhs == rhs); |
| 38 } |
| 39 |
| 40 |
| 41 std::ostream& operator<<(std::ostream& os, FieldAccess const& access) { |
| 42 os << "[" << access.base_is_tagged << ", " << access.offset << ", "; |
| 43 #ifdef OBJECT_PRINT |
| 44 Handle<Name> name; |
| 45 if (access.name.ToHandle(&name)) { |
| 46 name->Print(os); |
| 47 os << ", "; |
| 48 } |
| 49 #endif |
| 50 access.type->PrintTo(os); |
| 51 os << ", " << access.machine_type << "]"; |
| 52 return os; |
| 53 } |
| 54 |
| 55 |
| 30 std::ostream& operator<<(std::ostream& os, BoundsCheckMode bounds_check_mode) { | 56 std::ostream& operator<<(std::ostream& os, BoundsCheckMode bounds_check_mode) { |
| 31 switch (bounds_check_mode) { | 57 switch (bounds_check_mode) { |
| 32 case kNoBoundsCheck: | 58 case kNoBoundsCheck: |
| 33 return os << "no bounds check"; | 59 return os << "no bounds check"; |
| 34 case kTypedArrayBoundsCheck: | 60 case kTypedArrayBoundsCheck: |
| 35 return os << "ignore out of bounds"; | 61 return os << "ignore out of bounds"; |
| 36 } | 62 } |
| 37 UNREACHABLE(); | 63 UNREACHABLE(); |
| 38 return os; | 64 return os; |
| 39 } | 65 } |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 return new (zone()) \ | 209 return new (zone()) \ |
| 184 Operator1<Type>(IrOpcode::k##Name, Operator::kNoThrow | properties, \ | 210 Operator1<Type>(IrOpcode::k##Name, Operator::kNoThrow | properties, \ |
| 185 input_count, output_count, #Name, access); \ | 211 input_count, output_count, #Name, access); \ |
| 186 } | 212 } |
| 187 ACCESS_OP_LIST(ACCESS) | 213 ACCESS_OP_LIST(ACCESS) |
| 188 #undef ACCESS | 214 #undef ACCESS |
| 189 | 215 |
| 190 } // namespace compiler | 216 } // namespace compiler |
| 191 } // namespace internal | 217 } // namespace internal |
| 192 } // namespace v8 | 218 } // namespace v8 |
| OLD | NEW |