Chromium Code Reviews| 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 149 bool operator!=(FrameStateCallInfo const&, FrameStateCallInfo const&); | 149 bool operator!=(FrameStateCallInfo const&, FrameStateCallInfo const&); |
| 150 | 150 |
| 151 size_t hash_value(FrameStateCallInfo const&); | 151 size_t hash_value(FrameStateCallInfo const&); |
| 152 | 152 |
| 153 std::ostream& operator<<(std::ostream&, FrameStateCallInfo const&); | 153 std::ostream& operator<<(std::ostream&, FrameStateCallInfo const&); |
| 154 | 154 |
| 155 | 155 |
| 156 size_t ProjectionIndexOf(const Operator* const); | 156 size_t ProjectionIndexOf(const Operator* const); |
| 157 | 157 |
| 158 | 158 |
| 159 // The {IrOpcode::kParameter} opcode represents an incoming parameter to the | |
| 160 // function. This class bundles the index and a debug name for such operators. | |
| 161 class ParameterInfo final { | |
| 162 public: | |
| 163 ParameterInfo(int index, const char* debug_name) | |
| 164 : index_(index), debug_name_(debug_name) {} | |
| 165 | |
| 166 int index() const { return index_; } | |
| 167 const char* debug_name() const { return debug_name_; } | |
| 168 | |
| 169 private: | |
| 170 int index_; | |
| 171 const char* debug_name_; | |
| 172 }; | |
| 173 | |
| 174 std::ostream& operator<<(std::ostream&, ParameterInfo const&); | |
| 175 | |
| 176 int ParameterIndexOf(const Operator* const); | |
| 177 const ParameterInfo& ParameterInfoOf(const Operator* const); | |
| 178 | |
|
Benedikt Meurer
2015/04/22 09:47:12
Please add an empty line here.
titzer
2015/04/22 09:50:01
Done.
| |
| 159 // Interface for building common operators that can be used at any level of IR, | 179 // Interface for building common operators that can be used at any level of IR, |
| 160 // including JavaScript, mid-level, and low-level. | 180 // including JavaScript, mid-level, and low-level. |
| 161 class CommonOperatorBuilder final : public ZoneObject { | 181 class CommonOperatorBuilder final : public ZoneObject { |
| 162 public: | 182 public: |
| 163 explicit CommonOperatorBuilder(Zone* zone); | 183 explicit CommonOperatorBuilder(Zone* zone); |
| 164 | 184 |
| 165 // Special operator used only in Branches to mark them as always taken, but | 185 // Special operator used only in Branches to mark them as always taken, but |
| 166 // still unfoldable. This is required to properly connect non terminating | 186 // still unfoldable. This is required to properly connect non terminating |
| 167 // loops to end (in both the sea of nodes and the CFG). | 187 // loops to end (in both the sea of nodes and the CFG). |
| 168 const Operator* Always(); | 188 const Operator* Always(); |
| 169 | 189 |
| 170 const Operator* Dead(); | 190 const Operator* Dead(); |
| 171 const Operator* End(); | 191 const Operator* End(); |
| 172 const Operator* Branch(BranchHint = BranchHint::kNone); | 192 const Operator* Branch(BranchHint = BranchHint::kNone); |
| 173 const Operator* IfTrue(); | 193 const Operator* IfTrue(); |
| 174 const Operator* IfFalse(); | 194 const Operator* IfFalse(); |
| 175 const Operator* IfSuccess(); | 195 const Operator* IfSuccess(); |
| 176 const Operator* IfException(); | 196 const Operator* IfException(); |
| 177 const Operator* Switch(size_t control_output_count); | 197 const Operator* Switch(size_t control_output_count); |
| 178 const Operator* IfValue(int32_t value); | 198 const Operator* IfValue(int32_t value); |
| 179 const Operator* IfDefault(); | 199 const Operator* IfDefault(); |
| 180 const Operator* Throw(); | 200 const Operator* Throw(); |
| 181 const Operator* Deoptimize(); | 201 const Operator* Deoptimize(); |
| 182 const Operator* Return(); | 202 const Operator* Return(); |
| 183 | 203 |
| 184 const Operator* Start(int num_formal_parameters); | 204 const Operator* Start(int num_formal_parameters); |
| 185 const Operator* Loop(int control_input_count); | 205 const Operator* Loop(int control_input_count); |
| 186 const Operator* Merge(int control_input_count); | 206 const Operator* Merge(int control_input_count); |
| 187 const Operator* Parameter(int index); | 207 const Operator* Parameter(int index, const char* debug_name = nullptr); |
| 188 | 208 |
| 189 const Operator* OsrNormalEntry(); | 209 const Operator* OsrNormalEntry(); |
| 190 const Operator* OsrLoopEntry(); | 210 const Operator* OsrLoopEntry(); |
| 191 const Operator* OsrValue(int index); | 211 const Operator* OsrValue(int index); |
| 192 | 212 |
| 193 const Operator* Int32Constant(int32_t); | 213 const Operator* Int32Constant(int32_t); |
| 194 const Operator* Int64Constant(int64_t); | 214 const Operator* Int64Constant(int64_t); |
| 195 const Operator* Float32Constant(volatile float); | 215 const Operator* Float32Constant(volatile float); |
| 196 const Operator* Float64Constant(volatile double); | 216 const Operator* Float64Constant(volatile double); |
| 197 const Operator* ExternalConstant(const ExternalReference&); | 217 const Operator* ExternalConstant(const ExternalReference&); |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 224 Zone* const zone_; | 244 Zone* const zone_; |
| 225 | 245 |
| 226 DISALLOW_COPY_AND_ASSIGN(CommonOperatorBuilder); | 246 DISALLOW_COPY_AND_ASSIGN(CommonOperatorBuilder); |
| 227 }; | 247 }; |
| 228 | 248 |
| 229 } // namespace compiler | 249 } // namespace compiler |
| 230 } // namespace internal | 250 } // namespace internal |
| 231 } // namespace v8 | 251 } // namespace v8 |
| 232 | 252 |
| 233 #endif // V8_COMPILER_COMMON_OPERATOR_H_ | 253 #endif // V8_COMPILER_COMMON_OPERATOR_H_ |
| OLD | NEW |