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_COMMON_OPERATOR_H_ | 5 #ifndef V8_COMPILER_COMMON_OPERATOR_H_ |
6 #define V8_COMPILER_COMMON_OPERATOR_H_ | 6 #define V8_COMPILER_COMMON_OPERATOR_H_ |
7 | 7 |
| 8 #include "src/assembler.h" |
8 #include "src/compiler/frame-states.h" | 9 #include "src/compiler/frame-states.h" |
9 #include "src/machine-type.h" | 10 #include "src/machine-type.h" |
10 #include "src/zone-containers.h" | 11 #include "src/zone-containers.h" |
11 | 12 |
12 namespace v8 { | 13 namespace v8 { |
13 namespace internal { | 14 namespace internal { |
14 | 15 |
15 // Forward declarations. | 16 // Forward declarations. |
16 class ExternalReference; | |
17 class Type; | 17 class Type; |
18 | 18 |
19 namespace compiler { | 19 namespace compiler { |
20 | 20 |
21 // Forward declarations. | 21 // Forward declarations. |
22 class CallDescriptor; | 22 class CallDescriptor; |
23 struct CommonOperatorGlobalCache; | 23 struct CommonOperatorGlobalCache; |
24 class Operator; | 24 class Operator; |
25 | 25 |
26 | 26 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 private: | 107 private: |
108 int index_; | 108 int index_; |
109 const char* debug_name_; | 109 const char* debug_name_; |
110 }; | 110 }; |
111 | 111 |
112 std::ostream& operator<<(std::ostream&, ParameterInfo const&); | 112 std::ostream& operator<<(std::ostream&, ParameterInfo const&); |
113 | 113 |
114 int ParameterIndexOf(const Operator* const); | 114 int ParameterIndexOf(const Operator* const); |
115 const ParameterInfo& ParameterInfoOf(const Operator* const); | 115 const ParameterInfo& ParameterInfoOf(const Operator* const); |
116 | 116 |
| 117 class RelocatablePtrConstantInfo final { |
| 118 public: |
| 119 RelocatablePtrConstantInfo(intptr_t value, RelocInfo::Mode rmode) |
| 120 : value_(value), rmode_(rmode) {} |
| 121 |
| 122 intptr_t value() const { return value_; } |
| 123 RelocInfo::Mode rmode() const { return rmode_; } |
| 124 |
| 125 private: |
| 126 intptr_t value_; |
| 127 RelocInfo::Mode rmode_; |
| 128 }; |
| 129 |
| 130 bool operator==(RelocatablePtrConstantInfo const& lhs, |
| 131 RelocatablePtrConstantInfo const& rhs); |
| 132 bool operator!=(RelocatablePtrConstantInfo const& lhs, |
| 133 RelocatablePtrConstantInfo const& rhs); |
| 134 std::ostream& operator<<(std::ostream&, RelocatablePtrConstantInfo const&); |
| 135 size_t hash_value(RelocatablePtrConstantInfo const& p); |
117 | 136 |
118 // Interface for building common operators that can be used at any level of IR, | 137 // Interface for building common operators that can be used at any level of IR, |
119 // including JavaScript, mid-level, and low-level. | 138 // including JavaScript, mid-level, and low-level. |
120 class CommonOperatorBuilder final : public ZoneObject { | 139 class CommonOperatorBuilder final : public ZoneObject { |
121 public: | 140 public: |
122 explicit CommonOperatorBuilder(Zone* zone); | 141 explicit CommonOperatorBuilder(Zone* zone); |
123 | 142 |
124 const Operator* Dead(); | 143 const Operator* Dead(); |
125 const Operator* End(size_t control_input_count); | 144 const Operator* End(size_t control_input_count); |
126 const Operator* Branch(BranchHint = BranchHint::kNone); | 145 const Operator* Branch(BranchHint = BranchHint::kNone); |
(...skipping 21 matching lines...) Expand all Loading... |
148 const Operator* OsrValue(int index); | 167 const Operator* OsrValue(int index); |
149 | 168 |
150 const Operator* Int32Constant(int32_t); | 169 const Operator* Int32Constant(int32_t); |
151 const Operator* Int64Constant(int64_t); | 170 const Operator* Int64Constant(int64_t); |
152 const Operator* Float32Constant(volatile float); | 171 const Operator* Float32Constant(volatile float); |
153 const Operator* Float64Constant(volatile double); | 172 const Operator* Float64Constant(volatile double); |
154 const Operator* ExternalConstant(const ExternalReference&); | 173 const Operator* ExternalConstant(const ExternalReference&); |
155 const Operator* NumberConstant(volatile double); | 174 const Operator* NumberConstant(volatile double); |
156 const Operator* HeapConstant(const Handle<HeapObject>&); | 175 const Operator* HeapConstant(const Handle<HeapObject>&); |
157 | 176 |
| 177 const Operator* RelocatableInt32Constant(int32_t value, |
| 178 RelocInfo::Mode rmode); |
| 179 const Operator* RelocatableInt64Constant(int64_t value, |
| 180 RelocInfo::Mode rmode); |
| 181 |
158 const Operator* Select(MachineRepresentation, BranchHint = BranchHint::kNone); | 182 const Operator* Select(MachineRepresentation, BranchHint = BranchHint::kNone); |
159 const Operator* Phi(MachineRepresentation representation, | 183 const Operator* Phi(MachineRepresentation representation, |
160 int value_input_count); | 184 int value_input_count); |
161 const Operator* EffectPhi(int effect_input_count); | 185 const Operator* EffectPhi(int effect_input_count); |
162 const Operator* EffectSet(int arguments); | 186 const Operator* EffectSet(int arguments); |
163 const Operator* Guard(Type* type); | 187 const Operator* Guard(Type* type); |
164 const Operator* BeginRegion(); | 188 const Operator* BeginRegion(); |
165 const Operator* FinishRegion(); | 189 const Operator* FinishRegion(); |
166 const Operator* StateValues(int arguments); | 190 const Operator* StateValues(int arguments); |
167 const Operator* ObjectState(int pointer_slots, int id); | 191 const Operator* ObjectState(int pointer_slots, int id); |
(...skipping 21 matching lines...) Expand all Loading... |
189 Zone* const zone_; | 213 Zone* const zone_; |
190 | 214 |
191 DISALLOW_COPY_AND_ASSIGN(CommonOperatorBuilder); | 215 DISALLOW_COPY_AND_ASSIGN(CommonOperatorBuilder); |
192 }; | 216 }; |
193 | 217 |
194 } // namespace compiler | 218 } // namespace compiler |
195 } // namespace internal | 219 } // namespace internal |
196 } // namespace v8 | 220 } // namespace v8 |
197 | 221 |
198 #endif // V8_COMPILER_COMMON_OPERATOR_H_ | 222 #endif // V8_COMPILER_COMMON_OPERATOR_H_ |
OLD | NEW |