OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "src/base/functional.h" |
| 6 #include "src/compiler/frame-states.h" |
| 7 |
| 8 namespace v8 { |
| 9 namespace internal { |
| 10 namespace compiler { |
| 11 |
| 12 size_t hash_value(OutputFrameStateCombine const& sc) { |
| 13 return base::hash_combine(sc.kind_, sc.parameter_); |
| 14 } |
| 15 |
| 16 |
| 17 std::ostream& operator<<(std::ostream& os, OutputFrameStateCombine const& sc) { |
| 18 switch (sc.kind_) { |
| 19 case OutputFrameStateCombine::kPushOutput: |
| 20 if (sc.parameter_ == 0) return os << "Ignore"; |
| 21 return os << "Push(" << sc.parameter_ << ")"; |
| 22 case OutputFrameStateCombine::kPokeAt: |
| 23 return os << "PokeAt(" << sc.parameter_ << ")"; |
| 24 } |
| 25 UNREACHABLE(); |
| 26 return os; |
| 27 } |
| 28 |
| 29 |
| 30 bool operator==(FrameStateCallInfo const& lhs, FrameStateCallInfo const& rhs) { |
| 31 return lhs.type() == rhs.type() && lhs.bailout_id() == rhs.bailout_id() && |
| 32 lhs.state_combine() == rhs.state_combine(); |
| 33 } |
| 34 |
| 35 |
| 36 bool operator!=(FrameStateCallInfo const& lhs, FrameStateCallInfo const& rhs) { |
| 37 return !(lhs == rhs); |
| 38 } |
| 39 |
| 40 |
| 41 size_t hash_value(FrameStateCallInfo const& info) { |
| 42 return base::hash_combine(info.type(), info.bailout_id(), |
| 43 info.state_combine()); |
| 44 } |
| 45 |
| 46 |
| 47 std::ostream& operator<<(std::ostream& os, FrameStateCallInfo const& info) { |
| 48 return os << info.type() << ", " << info.bailout_id() << ", " |
| 49 << info.state_combine(); |
| 50 } |
| 51 } |
| 52 } |
| 53 } |
OLD | NEW |