| 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 #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" |
| 11 | 11 |
| 12 namespace v8 { | 12 namespace v8 { |
| 13 namespace internal { | 13 namespace internal { |
| 14 namespace compiler { | 14 namespace compiler { |
| 15 | 15 |
| 16 enum BaseTaggedness { kUntaggedBase, kTaggedBase }; | 16 enum BaseTaggedness { kUntaggedBase, kTaggedBase }; |
| 17 | 17 |
| 18 // An access descriptor for loads/stores of fixed structures like field | 18 // An access descriptor for loads/stores of fixed structures like field |
| 19 // accesses of heap objects. Accesses from either tagged or untagged base | 19 // accesses of heap objects. Accesses from either tagged or untagged base |
| 20 // pointers are supported; untagging is done automatically during lowering. | 20 // pointers are supported; untagging is done automatically during lowering. |
| 21 struct FieldAccess { | 21 struct FieldAccess { |
| 22 BaseTaggedness base_is_tagged; // specifies if the base pointer is tagged. | 22 BaseTaggedness base_is_tagged; // specifies if the base pointer is tagged. |
| 23 int offset; // offset of the field, without tag. | 23 int offset; // offset of the field, without tag. |
| 24 Handle<Name> name; // debugging only. | 24 Handle<Name> name; // debugging only. |
| 25 Type* type; // type of the field. | 25 Type* type; // type of the field. |
| 26 MachineRepresentation representation; // machine representation of field. | 26 MachineType representation; // machine representation of field. |
| 27 | 27 |
| 28 int tag() const { return base_is_tagged == kTaggedBase ? kHeapObjectTag : 0; } | 28 int tag() const { return base_is_tagged == kTaggedBase ? kHeapObjectTag : 0; } |
| 29 }; | 29 }; |
| 30 | 30 |
| 31 | 31 |
| 32 // An access descriptor for loads/stores of indexed structures like characters | 32 // An access descriptor for loads/stores of indexed structures like characters |
| 33 // in strings or off-heap backing stores. Accesses from either tagged or | 33 // in strings or off-heap backing stores. Accesses from either tagged or |
| 34 // untagged base pointers are supported; untagging is done automatically during | 34 // untagged base pointers are supported; untagging is done automatically during |
| 35 // lowering. | 35 // lowering. |
| 36 struct ElementAccess { | 36 struct ElementAccess { |
| 37 BaseTaggedness base_is_tagged; // specifies if the base pointer is tagged. | 37 BaseTaggedness base_is_tagged; // specifies if the base pointer is tagged. |
| 38 int header_size; // size of the header, without tag. | 38 int header_size; // size of the header, without tag. |
| 39 Type* type; // type of the element. | 39 Type* type; // type of the element. |
| 40 MachineRepresentation representation; // machine representation of element. | 40 MachineType representation; // machine representation of element. |
| 41 | 41 |
| 42 int tag() const { return base_is_tagged == kTaggedBase ? kHeapObjectTag : 0; } | 42 int tag() const { return base_is_tagged == kTaggedBase ? kHeapObjectTag : 0; } |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 | 45 |
| 46 // If the accessed object is not a heap object, add this to the header_size. | 46 // If the accessed object is not a heap object, add this to the header_size. |
| 47 static const int kNonHeapObjectHeaderSize = kHeapObjectTag; | 47 static const int kNonHeapObjectHeaderSize = kHeapObjectTag; |
| 48 | 48 |
| 49 | 49 |
| 50 // Specialization for static parameters of type {FieldAccess}. | 50 // Specialization for static parameters of type {FieldAccess}. |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 #undef SIMPLE | 180 #undef SIMPLE |
| 181 | 181 |
| 182 private: | 182 private: |
| 183 Zone* zone_; | 183 Zone* zone_; |
| 184 }; | 184 }; |
| 185 } | 185 } |
| 186 } | 186 } |
| 187 } // namespace v8::internal::compiler | 187 } // namespace v8::internal::compiler |
| 188 | 188 |
| 189 #endif // V8_COMPILER_SIMPLIFIED_OPERATOR_H_ | 189 #endif // V8_COMPILER_SIMPLIFIED_OPERATOR_H_ |
| OLD | NEW |