| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/compiler/machine-type.h" | 8 #include "src/compiler/machine-type.h" |
| 9 #include "src/unique.h" | 9 #include "src/unique.h" |
| 10 | 10 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 | 155 |
| 156 size_t ProjectionIndexOf(const Operator* const); | 156 size_t ProjectionIndexOf(const Operator* const); |
| 157 | 157 |
| 158 | 158 |
| 159 // Interface for building common operators that can be used at any level of IR, | 159 // Interface for building common operators that can be used at any level of IR, |
| 160 // including JavaScript, mid-level, and low-level. | 160 // including JavaScript, mid-level, and low-level. |
| 161 class CommonOperatorBuilder FINAL : public ZoneObject { | 161 class CommonOperatorBuilder FINAL : public ZoneObject { |
| 162 public: | 162 public: |
| 163 explicit CommonOperatorBuilder(Zone* zone); | 163 explicit CommonOperatorBuilder(Zone* zone); |
| 164 | 164 |
| 165 // Special operator used only in Branches to mark them as always taken, but |
| 166 // still unfoldable. This is required to properly connect non terminating |
| 167 // loops to end (in both the sea of nodes and the CFG). |
| 168 const Operator* Always(); |
| 169 |
| 165 const Operator* Dead(); | 170 const Operator* Dead(); |
| 166 const Operator* End(); | 171 const Operator* End(); |
| 167 const Operator* Branch(BranchHint = BranchHint::kNone); | 172 const Operator* Branch(BranchHint = BranchHint::kNone); |
| 168 const Operator* IfTrue(); | 173 const Operator* IfTrue(); |
| 169 const Operator* IfFalse(); | 174 const Operator* IfFalse(); |
| 170 const Operator* Throw(); | 175 const Operator* Throw(); |
| 171 const Operator* Terminate(int effects); | |
| 172 const Operator* Return(); | 176 const Operator* Return(); |
| 173 | 177 |
| 174 const Operator* Start(int num_formal_parameters); | 178 const Operator* Start(int num_formal_parameters); |
| 175 const Operator* Loop(int control_input_count); | 179 const Operator* Loop(int control_input_count); |
| 176 const Operator* Merge(int control_input_count); | 180 const Operator* Merge(int control_input_count); |
| 177 const Operator* Parameter(int index); | 181 const Operator* Parameter(int index); |
| 178 | 182 |
| 179 const Operator* OsrNormalEntry(); | 183 const Operator* OsrNormalEntry(); |
| 180 const Operator* OsrLoopEntry(); | 184 const Operator* OsrLoopEntry(); |
| 181 const Operator* OsrValue(int index); | 185 const Operator* OsrValue(int index); |
| 182 | 186 |
| 183 const Operator* Int32Constant(int32_t); | 187 const Operator* Int32Constant(int32_t); |
| 184 const Operator* Int64Constant(int64_t); | 188 const Operator* Int64Constant(int64_t); |
| 185 const Operator* Float32Constant(volatile float); | 189 const Operator* Float32Constant(volatile float); |
| 186 const Operator* Float64Constant(volatile double); | 190 const Operator* Float64Constant(volatile double); |
| 187 const Operator* ExternalConstant(const ExternalReference&); | 191 const Operator* ExternalConstant(const ExternalReference&); |
| 188 const Operator* NumberConstant(volatile double); | 192 const Operator* NumberConstant(volatile double); |
| 189 const Operator* HeapConstant(const Unique<HeapObject>&); | 193 const Operator* HeapConstant(const Unique<HeapObject>&); |
| 190 | 194 |
| 191 const Operator* Select(MachineType, BranchHint = BranchHint::kNone); | 195 const Operator* Select(MachineType, BranchHint = BranchHint::kNone); |
| 192 const Operator* Phi(MachineType type, int arguments); | 196 const Operator* Phi(MachineType type, int arguments); |
| 193 const Operator* EffectPhi(int arguments); | 197 const Operator* EffectPhi(int arguments); |
| 198 const Operator* EffectSet(int arguments); |
| 194 const Operator* ValueEffect(int arguments); | 199 const Operator* ValueEffect(int arguments); |
| 195 const Operator* Finish(int arguments); | 200 const Operator* Finish(int arguments); |
| 196 const Operator* StateValues(int arguments); | 201 const Operator* StateValues(int arguments); |
| 197 const Operator* FrameState( | 202 const Operator* FrameState( |
| 198 FrameStateType type, BailoutId bailout_id, | 203 FrameStateType type, BailoutId bailout_id, |
| 199 OutputFrameStateCombine state_combine, | 204 OutputFrameStateCombine state_combine, |
| 200 MaybeHandle<JSFunction> jsfunction = MaybeHandle<JSFunction>()); | 205 MaybeHandle<JSFunction> jsfunction = MaybeHandle<JSFunction>()); |
| 201 const Operator* Call(const CallDescriptor* descriptor); | 206 const Operator* Call(const CallDescriptor* descriptor); |
| 202 const Operator* Projection(size_t index); | 207 const Operator* Projection(size_t index); |
| 203 | 208 |
| 204 // Constructs a new merge or phi operator with the same opcode as {op}, but | 209 // Constructs a new merge or phi operator with the same opcode as {op}, but |
| 205 // with {size} inputs. | 210 // with {size} inputs. |
| 206 const Operator* ResizeMergeOrPhi(const Operator* op, int size); | 211 const Operator* ResizeMergeOrPhi(const Operator* op, int size); |
| 207 | 212 |
| 208 private: | 213 private: |
| 209 Zone* zone() const { return zone_; } | 214 Zone* zone() const { return zone_; } |
| 210 | 215 |
| 211 const CommonOperatorGlobalCache& cache_; | 216 const CommonOperatorGlobalCache& cache_; |
| 212 Zone* const zone_; | 217 Zone* const zone_; |
| 213 | 218 |
| 214 DISALLOW_COPY_AND_ASSIGN(CommonOperatorBuilder); | 219 DISALLOW_COPY_AND_ASSIGN(CommonOperatorBuilder); |
| 215 }; | 220 }; |
| 216 | 221 |
| 217 } // namespace compiler | 222 } // namespace compiler |
| 218 } // namespace internal | 223 } // namespace internal |
| 219 } // namespace v8 | 224 } // namespace v8 |
| 220 | 225 |
| 221 #endif // V8_COMPILER_COMMON_OPERATOR_H_ | 226 #endif // V8_COMPILER_COMMON_OPERATOR_H_ |
| OLD | NEW |