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-type.h" | 8 #include "src/compiler/machine-type.h" |
9 #include "src/handles.h" | 9 #include "src/handles.h" |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 namespace compiler { | 22 namespace compiler { |
23 | 23 |
24 // Forward declarations. | 24 // Forward declarations. |
25 class Operator; | 25 class Operator; |
26 struct SimplifiedOperatorBuilderImpl; | 26 struct SimplifiedOperatorBuilderImpl; |
27 | 27 |
28 | 28 |
29 enum BaseTaggedness { kUntaggedBase, kTaggedBase }; | 29 enum BaseTaggedness { kUntaggedBase, kTaggedBase }; |
30 | 30 |
31 OStream& operator<<(OStream&, BaseTaggedness); | 31 std::ostream& operator<<(std::ostream&, BaseTaggedness); |
32 | 32 |
33 // An access descriptor for loads/stores of fixed structures like field | 33 // An access descriptor for loads/stores of fixed structures like field |
34 // accesses of heap objects. Accesses from either tagged or untagged base | 34 // accesses of heap objects. Accesses from either tagged or untagged base |
35 // pointers are supported; untagging is done automatically during lowering. | 35 // pointers are supported; untagging is done automatically during lowering. |
36 struct FieldAccess { | 36 struct FieldAccess { |
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 offset; // offset of the field, without tag. | 38 int offset; // offset of the field, without tag. |
39 Handle<Name> name; // debugging only. | 39 Handle<Name> name; // debugging only. |
40 Type* type; // type of the field. | 40 Type* type; // type of the field. |
41 MachineType machine_type; // machine type of the field. | 41 MachineType machine_type; // machine type of the field. |
(...skipping 11 matching lines...) Expand all Loading... |
53 int header_size; // size of the header, without tag. | 53 int header_size; // size of the header, without tag. |
54 Type* type; // type of the element. | 54 Type* type; // type of the element. |
55 MachineType machine_type; // machine type of the element. | 55 MachineType machine_type; // machine type of the element. |
56 | 56 |
57 int tag() const { return base_is_tagged == kTaggedBase ? kHeapObjectTag : 0; } | 57 int tag() const { return base_is_tagged == kTaggedBase ? kHeapObjectTag : 0; } |
58 }; | 58 }; |
59 | 59 |
60 bool operator==(ElementAccess const& lhs, ElementAccess const& rhs); | 60 bool operator==(ElementAccess const& lhs, ElementAccess const& rhs); |
61 bool operator!=(ElementAccess const& lhs, ElementAccess const& rhs); | 61 bool operator!=(ElementAccess const& lhs, ElementAccess const& rhs); |
62 | 62 |
63 OStream& operator<<(OStream&, ElementAccess const&); | 63 std::ostream& operator<<(std::ostream&, ElementAccess const&); |
64 | 64 |
65 | 65 |
66 // If the accessed object is not a heap object, add this to the header_size. | 66 // If the accessed object is not a heap object, add this to the header_size. |
67 static const int kNonHeapObjectHeaderSize = kHeapObjectTag; | 67 static const int kNonHeapObjectHeaderSize = kHeapObjectTag; |
68 | 68 |
69 | 69 |
70 const FieldAccess& FieldAccessOf(const Operator* op) WARN_UNUSED_RESULT; | 70 const FieldAccess& FieldAccessOf(const Operator* op) WARN_UNUSED_RESULT; |
71 const ElementAccess& ElementAccessOf(const Operator* op) WARN_UNUSED_RESULT; | 71 const ElementAccess& ElementAccessOf(const Operator* op) WARN_UNUSED_RESULT; |
72 | 72 |
73 | 73 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 Zone* const zone_; | 143 Zone* const zone_; |
144 | 144 |
145 DISALLOW_COPY_AND_ASSIGN(SimplifiedOperatorBuilder); | 145 DISALLOW_COPY_AND_ASSIGN(SimplifiedOperatorBuilder); |
146 }; | 146 }; |
147 | 147 |
148 } // namespace compiler | 148 } // namespace compiler |
149 } // namespace internal | 149 } // namespace internal |
150 } // namespace v8 | 150 } // namespace v8 |
151 | 151 |
152 #endif // V8_COMPILER_SIMPLIFIED_OPERATOR_H_ | 152 #endif // V8_COMPILER_SIMPLIFIED_OPERATOR_H_ |
OLD | NEW |