| 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/base/compiler-specific.h" | 9 #include "src/base/compiler-specific.h" |
| 10 #include "src/compiler/frame-states.h" | 10 #include "src/compiler/frame-states.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 UNREACHABLE(); | 39 UNREACHABLE(); |
| 40 return hint; | 40 return hint; |
| 41 } | 41 } |
| 42 | 42 |
| 43 inline size_t hash_value(BranchHint hint) { return static_cast<size_t>(hint); } | 43 inline size_t hash_value(BranchHint hint) { return static_cast<size_t>(hint); } |
| 44 | 44 |
| 45 V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&, BranchHint); | 45 V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&, BranchHint); |
| 46 | 46 |
| 47 V8_EXPORT_PRIVATE BranchHint BranchHintOf(const Operator* const); | 47 V8_EXPORT_PRIVATE BranchHint BranchHintOf(const Operator* const); |
| 48 | 48 |
| 49 // Deoptimize reason for Deoptimize, DeoptimizeIf and DeoptimizeUnless. | |
| 50 DeoptimizeReason DeoptimizeReasonOf(Operator const* const); | |
| 51 | |
| 52 // Helper function for return nodes, because returns have a hidden value input. | 49 // Helper function for return nodes, because returns have a hidden value input. |
| 53 int ValueInputCountOfReturn(Operator const* const op); | 50 int ValueInputCountOfReturn(Operator const* const op); |
| 54 | 51 |
| 55 // Deoptimize bailout kind. | |
| 56 enum class DeoptimizeKind : uint8_t { kEager, kSoft }; | |
| 57 | |
| 58 size_t hash_value(DeoptimizeKind kind); | |
| 59 | |
| 60 std::ostream& operator<<(std::ostream&, DeoptimizeKind); | |
| 61 | |
| 62 // Parameters for the {Deoptimize} operator. | 52 // Parameters for the {Deoptimize} operator. |
| 63 class DeoptimizeParameters final { | 53 class DeoptimizeParameters final { |
| 64 public: | 54 public: |
| 65 DeoptimizeParameters(DeoptimizeKind kind, DeoptimizeReason reason) | 55 DeoptimizeParameters(DeoptimizeKind kind, DeoptimizeReason reason) |
| 66 : kind_(kind), reason_(reason) {} | 56 : kind_(kind), reason_(reason) {} |
| 67 | 57 |
| 68 DeoptimizeKind kind() const { return kind_; } | 58 DeoptimizeKind kind() const { return kind_; } |
| 69 DeoptimizeReason reason() const { return reason_; } | 59 DeoptimizeReason reason() const { return reason_; } |
| 70 | 60 |
| 71 private: | 61 private: |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 const Operator* Branch(BranchHint = BranchHint::kNone); | 309 const Operator* Branch(BranchHint = BranchHint::kNone); |
| 320 const Operator* IfTrue(); | 310 const Operator* IfTrue(); |
| 321 const Operator* IfFalse(); | 311 const Operator* IfFalse(); |
| 322 const Operator* IfSuccess(); | 312 const Operator* IfSuccess(); |
| 323 const Operator* IfException(); | 313 const Operator* IfException(); |
| 324 const Operator* Switch(size_t control_output_count); | 314 const Operator* Switch(size_t control_output_count); |
| 325 const Operator* IfValue(int32_t value); | 315 const Operator* IfValue(int32_t value); |
| 326 const Operator* IfDefault(); | 316 const Operator* IfDefault(); |
| 327 const Operator* Throw(); | 317 const Operator* Throw(); |
| 328 const Operator* Deoptimize(DeoptimizeKind kind, DeoptimizeReason reason); | 318 const Operator* Deoptimize(DeoptimizeKind kind, DeoptimizeReason reason); |
| 329 const Operator* DeoptimizeIf(DeoptimizeReason reason); | 319 const Operator* DeoptimizeIf(DeoptimizeKind kind, DeoptimizeReason reason); |
| 330 const Operator* DeoptimizeUnless(DeoptimizeReason reason); | 320 const Operator* DeoptimizeUnless(DeoptimizeKind kind, |
| 321 DeoptimizeReason reason); |
| 331 const Operator* TrapIf(int32_t trap_id); | 322 const Operator* TrapIf(int32_t trap_id); |
| 332 const Operator* TrapUnless(int32_t trap_id); | 323 const Operator* TrapUnless(int32_t trap_id); |
| 333 const Operator* Return(int value_input_count = 1); | 324 const Operator* Return(int value_input_count = 1); |
| 334 const Operator* Terminate(); | 325 const Operator* Terminate(); |
| 335 | 326 |
| 336 const Operator* Start(int value_output_count); | 327 const Operator* Start(int value_output_count); |
| 337 const Operator* Loop(int control_input_count); | 328 const Operator* Loop(int control_input_count); |
| 338 const Operator* Merge(int control_input_count); | 329 const Operator* Merge(int control_input_count); |
| 339 const Operator* Parameter(int index, const char* debug_name = nullptr); | 330 const Operator* Parameter(int index, const char* debug_name = nullptr); |
| 340 | 331 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 Zone* const zone_; | 390 Zone* const zone_; |
| 400 | 391 |
| 401 DISALLOW_COPY_AND_ASSIGN(CommonOperatorBuilder); | 392 DISALLOW_COPY_AND_ASSIGN(CommonOperatorBuilder); |
| 402 }; | 393 }; |
| 403 | 394 |
| 404 } // namespace compiler | 395 } // namespace compiler |
| 405 } // namespace internal | 396 } // namespace internal |
| 406 } // namespace v8 | 397 } // namespace v8 |
| 407 | 398 |
| 408 #endif // V8_COMPILER_COMMON_OPERATOR_H_ | 399 #endif // V8_COMPILER_COMMON_OPERATOR_H_ |
| OLD | NEW |