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 <iosfwd> | 8 #include <iosfwd> |
9 | 9 |
10 #include "src/handles.h" | 10 #include "src/handles.h" |
11 #include "src/machine-type.h" | 11 #include "src/machine-type.h" |
12 #include "src/objects.h" | 12 #include "src/objects.h" |
13 | 13 |
14 namespace v8 { | 14 namespace v8 { |
15 namespace internal { | 15 namespace internal { |
16 | 16 |
17 // Forward declarations. | 17 // Forward declarations. |
18 class Type; | 18 class Type; |
19 class Zone; | 19 class Zone; |
20 | 20 |
21 | 21 |
22 namespace compiler { | 22 namespace compiler { |
23 | 23 |
24 // Forward declarations. | 24 // Forward declarations. |
25 class Operator; | 25 class Operator; |
26 struct SimplifiedOperatorGlobalCache; | 26 struct SimplifiedOperatorGlobalCache; |
27 | 27 |
28 enum BaseTaggedness : uint8_t { kUntaggedBase, kTaggedBase }; | |
29 | 28 |
30 size_t hash_value(BaseTaggedness); | 29 enum BaseTaggedness { kUntaggedBase, kTaggedBase }; |
31 | 30 |
32 std::ostream& operator<<(std::ostream&, BaseTaggedness); | 31 std::ostream& operator<<(std::ostream&, BaseTaggedness); |
33 | 32 |
34 | 33 |
35 // An access descriptor for loads/stores of array buffers. | 34 // An access descriptor for loads/stores of array buffers. |
36 class BufferAccess final { | 35 class BufferAccess final { |
37 public: | 36 public: |
38 explicit BufferAccess(ExternalArrayType external_array_type) | 37 explicit BufferAccess(ExternalArrayType external_array_type) |
39 : external_array_type_(external_array_type) {} | 38 : external_array_type_(external_array_type) {} |
40 | 39 |
(...skipping 16 matching lines...) Expand all Loading... |
57 | 56 |
58 // An access descriptor for loads/stores of fixed structures like field | 57 // An access descriptor for loads/stores of fixed structures like field |
59 // accesses of heap objects. Accesses from either tagged or untagged base | 58 // accesses of heap objects. Accesses from either tagged or untagged base |
60 // pointers are supported; untagging is done automatically during lowering. | 59 // pointers are supported; untagging is done automatically during lowering. |
61 struct FieldAccess { | 60 struct FieldAccess { |
62 BaseTaggedness base_is_tagged; // specifies if the base pointer is tagged. | 61 BaseTaggedness base_is_tagged; // specifies if the base pointer is tagged. |
63 int offset; // offset of the field, without tag. | 62 int offset; // offset of the field, without tag. |
64 MaybeHandle<Name> name; // debugging only. | 63 MaybeHandle<Name> name; // debugging only. |
65 Type* type; // type of the field. | 64 Type* type; // type of the field. |
66 MachineType machine_type; // machine type of the field. | 65 MachineType machine_type; // machine type of the field. |
67 WriteBarrierKind write_barrier_kind; // write barrier hint. | |
68 | 66 |
69 int tag() const { return base_is_tagged == kTaggedBase ? kHeapObjectTag : 0; } | 67 int tag() const { return base_is_tagged == kTaggedBase ? kHeapObjectTag : 0; } |
70 }; | 68 }; |
71 | 69 |
72 bool operator==(FieldAccess const&, FieldAccess const&); | 70 bool operator==(FieldAccess const&, FieldAccess const&); |
73 bool operator!=(FieldAccess const&, FieldAccess const&); | 71 bool operator!=(FieldAccess const&, FieldAccess const&); |
74 | 72 |
75 size_t hash_value(FieldAccess const&); | 73 size_t hash_value(FieldAccess const&); |
76 | 74 |
77 std::ostream& operator<<(std::ostream&, FieldAccess const&); | 75 std::ostream& operator<<(std::ostream&, FieldAccess const&); |
78 | 76 |
79 FieldAccess const& FieldAccessOf(const Operator* op) WARN_UNUSED_RESULT; | 77 FieldAccess const& FieldAccessOf(const Operator* op) WARN_UNUSED_RESULT; |
80 | 78 |
81 | 79 |
82 // An access descriptor for loads/stores of indexed structures like characters | 80 // An access descriptor for loads/stores of indexed structures like characters |
83 // in strings or off-heap backing stores. Accesses from either tagged or | 81 // in strings or off-heap backing stores. Accesses from either tagged or |
84 // untagged base pointers are supported; untagging is done automatically during | 82 // untagged base pointers are supported; untagging is done automatically during |
85 // lowering. | 83 // lowering. |
86 struct ElementAccess { | 84 struct ElementAccess { |
87 BaseTaggedness base_is_tagged; // specifies if the base pointer is tagged. | 85 BaseTaggedness base_is_tagged; // specifies if the base pointer is tagged. |
88 int header_size; // size of the header, without tag. | 86 int header_size; // size of the header, without tag. |
89 Type* type; // type of the element. | 87 Type* type; // type of the element. |
90 MachineType machine_type; // machine type of the element. | 88 MachineType machine_type; // machine type of the element. |
91 WriteBarrierKind write_barrier_kind; // write barrier hint. | |
92 | 89 |
93 int tag() const { return base_is_tagged == kTaggedBase ? kHeapObjectTag : 0; } | 90 int tag() const { return base_is_tagged == kTaggedBase ? kHeapObjectTag : 0; } |
94 }; | 91 }; |
95 | 92 |
96 bool operator==(ElementAccess const&, ElementAccess const&); | 93 bool operator==(ElementAccess const&, ElementAccess const&); |
97 bool operator!=(ElementAccess const&, ElementAccess const&); | 94 bool operator!=(ElementAccess const&, ElementAccess const&); |
98 | 95 |
99 size_t hash_value(ElementAccess const&); | 96 size_t hash_value(ElementAccess const&); |
100 | 97 |
101 std::ostream& operator<<(std::ostream&, ElementAccess const&); | 98 std::ostream& operator<<(std::ostream&, ElementAccess const&); |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 Zone* const zone_; | 202 Zone* const zone_; |
206 | 203 |
207 DISALLOW_COPY_AND_ASSIGN(SimplifiedOperatorBuilder); | 204 DISALLOW_COPY_AND_ASSIGN(SimplifiedOperatorBuilder); |
208 }; | 205 }; |
209 | 206 |
210 } // namespace compiler | 207 } // namespace compiler |
211 } // namespace internal | 208 } // namespace internal |
212 } // namespace v8 | 209 } // namespace v8 |
213 | 210 |
214 #endif // V8_COMPILER_SIMPLIFIED_OPERATOR_H_ | 211 #endif // V8_COMPILER_SIMPLIFIED_OPERATOR_H_ |
OLD | NEW |