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/assembler.h" |
9 #include "src/compiler/frame-states.h" | 9 #include "src/compiler/frame-states.h" |
10 #include "src/deoptimize-reason.h" | 10 #include "src/deoptimize-reason.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 | 162 |
163 size_t hash_value(RegionObservability); | 163 size_t hash_value(RegionObservability); |
164 | 164 |
165 std::ostream& operator<<(std::ostream&, RegionObservability); | 165 std::ostream& operator<<(std::ostream&, RegionObservability); |
166 | 166 |
167 RegionObservability RegionObservabilityOf(Operator const*) WARN_UNUSED_RESULT; | 167 RegionObservability RegionObservabilityOf(Operator const*) WARN_UNUSED_RESULT; |
168 | 168 |
169 std::ostream& operator<<(std::ostream& os, | 169 std::ostream& operator<<(std::ostream& os, |
170 const ZoneVector<MachineType>* types); | 170 const ZoneVector<MachineType>* types); |
171 | 171 |
| 172 Type* TypeGuardTypeOf(Operator const*) WARN_UNUSED_RESULT; |
| 173 |
172 // Interface for building common operators that can be used at any level of IR, | 174 // Interface for building common operators that can be used at any level of IR, |
173 // including JavaScript, mid-level, and low-level. | 175 // including JavaScript, mid-level, and low-level. |
174 class CommonOperatorBuilder final : public ZoneObject { | 176 class CommonOperatorBuilder final : public ZoneObject { |
175 public: | 177 public: |
176 explicit CommonOperatorBuilder(Zone* zone); | 178 explicit CommonOperatorBuilder(Zone* zone); |
177 | 179 |
178 const Operator* Dead(); | 180 const Operator* Dead(); |
179 const Operator* End(size_t control_input_count); | 181 const Operator* End(size_t control_input_count); |
180 const Operator* Branch(BranchHint = BranchHint::kNone); | 182 const Operator* Branch(BranchHint = BranchHint::kNone); |
181 const Operator* IfTrue(); | 183 const Operator* IfTrue(); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 const Operator* StateValues(int arguments); | 230 const Operator* StateValues(int arguments); |
229 const Operator* ObjectState(int pointer_slots, int id); | 231 const Operator* ObjectState(int pointer_slots, int id); |
230 const Operator* TypedStateValues(const ZoneVector<MachineType>* types); | 232 const Operator* TypedStateValues(const ZoneVector<MachineType>* types); |
231 const Operator* FrameState(BailoutId bailout_id, | 233 const Operator* FrameState(BailoutId bailout_id, |
232 OutputFrameStateCombine state_combine, | 234 OutputFrameStateCombine state_combine, |
233 const FrameStateFunctionInfo* function_info); | 235 const FrameStateFunctionInfo* function_info); |
234 const Operator* Call(const CallDescriptor* descriptor); | 236 const Operator* Call(const CallDescriptor* descriptor); |
235 const Operator* TailCall(const CallDescriptor* descriptor); | 237 const Operator* TailCall(const CallDescriptor* descriptor); |
236 const Operator* Projection(size_t index); | 238 const Operator* Projection(size_t index); |
237 const Operator* Retain(); | 239 const Operator* Retain(); |
| 240 const Operator* TypeGuard(Type* type); |
238 | 241 |
239 // Constructs a new merge or phi operator with the same opcode as {op}, but | 242 // Constructs a new merge or phi operator with the same opcode as {op}, but |
240 // with {size} inputs. | 243 // with {size} inputs. |
241 const Operator* ResizeMergeOrPhi(const Operator* op, int size); | 244 const Operator* ResizeMergeOrPhi(const Operator* op, int size); |
242 | 245 |
243 // Constructs function info for frame state construction. | 246 // Constructs function info for frame state construction. |
244 const FrameStateFunctionInfo* CreateFrameStateFunctionInfo( | 247 const FrameStateFunctionInfo* CreateFrameStateFunctionInfo( |
245 FrameStateType type, int parameter_count, int local_count, | 248 FrameStateType type, int parameter_count, int local_count, |
246 Handle<SharedFunctionInfo> shared_info); | 249 Handle<SharedFunctionInfo> shared_info); |
247 | 250 |
248 private: | 251 private: |
249 Zone* zone() const { return zone_; } | 252 Zone* zone() const { return zone_; } |
250 | 253 |
251 const CommonOperatorGlobalCache& cache_; | 254 const CommonOperatorGlobalCache& cache_; |
252 Zone* const zone_; | 255 Zone* const zone_; |
253 | 256 |
254 DISALLOW_COPY_AND_ASSIGN(CommonOperatorBuilder); | 257 DISALLOW_COPY_AND_ASSIGN(CommonOperatorBuilder); |
255 }; | 258 }; |
256 | 259 |
257 } // namespace compiler | 260 } // namespace compiler |
258 } // namespace internal | 261 } // namespace internal |
259 } // namespace v8 | 262 } // namespace v8 |
260 | 263 |
261 #endif // V8_COMPILER_COMMON_OPERATOR_H_ | 264 #endif // V8_COMPILER_COMMON_OPERATOR_H_ |
OLD | NEW |