| 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 "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 #include "src/compiler/types.h" | 10 #include "src/compiler/types.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 op->opcode() == IrOpcode::kStoreBuffer); | 85 op->opcode() == IrOpcode::kStoreBuffer); |
| 86 return OpParameter<BufferAccess>(op); | 86 return OpParameter<BufferAccess>(op); |
| 87 } | 87 } |
| 88 | 88 |
| 89 | 89 |
| 90 bool operator==(FieldAccess const& lhs, FieldAccess const& rhs) { | 90 bool operator==(FieldAccess const& lhs, FieldAccess const& rhs) { |
| 91 // On purpose we don't include the write barrier kind here, as this method is | 91 // On purpose we don't include the write barrier kind here, as this method is |
| 92 // really only relevant for eliminating loads and they don't care about the | 92 // really only relevant for eliminating loads and they don't care about the |
| 93 // write barrier mode. | 93 // write barrier mode. |
| 94 return lhs.base_is_tagged == rhs.base_is_tagged && lhs.offset == rhs.offset && | 94 return lhs.base_is_tagged == rhs.base_is_tagged && lhs.offset == rhs.offset && |
| 95 lhs.map.address() == rhs.map.address() && |
| 95 lhs.machine_type == rhs.machine_type; | 96 lhs.machine_type == rhs.machine_type; |
| 96 } | 97 } |
| 97 | 98 |
| 98 | 99 |
| 99 bool operator!=(FieldAccess const& lhs, FieldAccess const& rhs) { | 100 bool operator!=(FieldAccess const& lhs, FieldAccess const& rhs) { |
| 100 return !(lhs == rhs); | 101 return !(lhs == rhs); |
| 101 } | 102 } |
| 102 | 103 |
| 103 | 104 |
| 104 size_t hash_value(FieldAccess const& access) { | 105 size_t hash_value(FieldAccess const& access) { |
| 105 // On purpose we don't include the write barrier kind here, as this method is | 106 // On purpose we don't include the write barrier kind here, as this method is |
| 106 // really only relevant for eliminating loads and they don't care about the | 107 // really only relevant for eliminating loads and they don't care about the |
| 107 // write barrier mode. | 108 // write barrier mode. |
| 108 return base::hash_combine(access.base_is_tagged, access.offset, | 109 return base::hash_combine(access.base_is_tagged, access.offset, |
| 109 access.machine_type); | 110 access.machine_type); |
| 110 } | 111 } |
| 111 | 112 |
| 112 | 113 |
| 113 std::ostream& operator<<(std::ostream& os, FieldAccess const& access) { | 114 std::ostream& operator<<(std::ostream& os, FieldAccess const& access) { |
| 114 os << "[" << access.base_is_tagged << ", " << access.offset << ", "; | 115 os << "[" << access.base_is_tagged << ", " << access.offset << ", "; |
| 115 #ifdef OBJECT_PRINT | 116 #ifdef OBJECT_PRINT |
| 116 Handle<Name> name; | 117 Handle<Name> name; |
| 117 if (access.name.ToHandle(&name)) { | 118 if (access.name.ToHandle(&name)) { |
| 118 name->Print(os); | 119 name->Print(os); |
| 119 os << ", "; | 120 os << ", "; |
| 120 } | 121 } |
| 122 Handle<Map> map; |
| 123 if (access.map.ToHandle(&map)) { |
| 124 os << Brief(*map) << ", "; |
| 125 } |
| 121 #endif | 126 #endif |
| 122 access.type->PrintTo(os); | 127 access.type->PrintTo(os); |
| 123 os << ", " << access.machine_type << ", " << access.write_barrier_kind << "]"; | 128 os << ", " << access.machine_type << ", " << access.write_barrier_kind << "]"; |
| 124 return os; | 129 return os; |
| 125 } | 130 } |
| 126 | 131 |
| 127 template <> | 132 template <> |
| 128 void Operator1<FieldAccess>::PrintParameter(std::ostream& os, | 133 void Operator1<FieldAccess>::PrintParameter(std::ostream& os, |
| 129 PrintVerbosity verbose) const { | 134 PrintVerbosity verbose) const { |
| 130 if (verbose == PrintVerbosity::kVerbose) { | 135 if (verbose == PrintVerbosity::kVerbose) { |
| (...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 886 Operator::kNoDeopt | Operator::kNoThrow | properties, \ | 891 Operator::kNoDeopt | Operator::kNoThrow | properties, \ |
| 887 #Name, value_input_count, 1, control_input_count, \ | 892 #Name, value_input_count, 1, control_input_count, \ |
| 888 output_count, 1, 0, access); \ | 893 output_count, 1, 0, access); \ |
| 889 } | 894 } |
| 890 ACCESS_OP_LIST(ACCESS) | 895 ACCESS_OP_LIST(ACCESS) |
| 891 #undef ACCESS | 896 #undef ACCESS |
| 892 | 897 |
| 893 } // namespace compiler | 898 } // namespace compiler |
| 894 } // namespace internal | 899 } // namespace internal |
| 895 } // namespace v8 | 900 } // namespace v8 |
| OLD | NEW |