Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(330)

Side by Side Diff: src/compiler/common-operator.cc

Issue 1131853002: [turbofan] Extract frame-states.h from common-operator.h (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/common-operator.h ('k') | src/compiler/frame-states.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "src/compiler/common-operator.h" 5 #include "src/compiler/common-operator.h"
6 6
7 #include "src/assembler.h" 7 #include "src/assembler.h"
8 #include "src/base/lazy-instance.h" 8 #include "src/base/lazy-instance.h"
9 #include "src/compiler/linkage.h" 9 #include "src/compiler/linkage.h"
10 #include "src/compiler/opcodes.h" 10 #include "src/compiler/opcodes.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 return os << p.type() << "|" << p.hint(); 55 return os << p.type() << "|" << p.hint();
56 } 56 }
57 57
58 58
59 SelectParameters const& SelectParametersOf(const Operator* const op) { 59 SelectParameters const& SelectParametersOf(const Operator* const op) {
60 DCHECK_EQ(IrOpcode::kSelect, op->opcode()); 60 DCHECK_EQ(IrOpcode::kSelect, op->opcode());
61 return OpParameter<SelectParameters>(op); 61 return OpParameter<SelectParameters>(op);
62 } 62 }
63 63
64 64
65 size_t hash_value(OutputFrameStateCombine const& sc) {
66 return base::hash_combine(sc.kind_, sc.parameter_);
67 }
68
69
70 std::ostream& operator<<(std::ostream& os, OutputFrameStateCombine const& sc) {
71 switch (sc.kind_) {
72 case OutputFrameStateCombine::kPushOutput:
73 if (sc.parameter_ == 0) return os << "Ignore";
74 return os << "Push(" << sc.parameter_ << ")";
75 case OutputFrameStateCombine::kPokeAt:
76 return os << "PokeAt(" << sc.parameter_ << ")";
77 }
78 UNREACHABLE();
79 return os;
80 }
81
82
83 bool operator==(FrameStateCallInfo const& lhs, FrameStateCallInfo const& rhs) {
84 return lhs.type() == rhs.type() && lhs.bailout_id() == rhs.bailout_id() &&
85 lhs.state_combine() == rhs.state_combine();
86 }
87
88
89 bool operator!=(FrameStateCallInfo const& lhs, FrameStateCallInfo const& rhs) {
90 return !(lhs == rhs);
91 }
92
93
94 size_t hash_value(FrameStateCallInfo const& info) {
95 return base::hash_combine(info.type(), info.bailout_id(),
96 info.state_combine());
97 }
98
99
100 std::ostream& operator<<(std::ostream& os, FrameStateCallInfo const& info) {
101 return os << info.type() << ", " << info.bailout_id() << ", "
102 << info.state_combine();
103 }
104
105
106 size_t ProjectionIndexOf(const Operator* const op) { 65 size_t ProjectionIndexOf(const Operator* const op) {
107 DCHECK_EQ(IrOpcode::kProjection, op->opcode()); 66 DCHECK_EQ(IrOpcode::kProjection, op->opcode());
108 return OpParameter<size_t>(op); 67 return OpParameter<size_t>(op);
109 } 68 }
110 69
111 70
112 int ParameterIndexOf(const Operator* const op) { 71 int ParameterIndexOf(const Operator* const op) {
113 DCHECK_EQ(IrOpcode::kParameter, op->opcode()); 72 DCHECK_EQ(IrOpcode::kParameter, op->opcode());
114 return OpParameter<ParameterInfo>(op).index(); 73 return OpParameter<ParameterInfo>(op).index();
115 } 74 }
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 } else { 690 } else {
732 UNREACHABLE(); 691 UNREACHABLE();
733 return nullptr; 692 return nullptr;
734 } 693 }
735 } 694 }
736 695
737 696
738 } // namespace compiler 697 } // namespace compiler
739 } // namespace internal 698 } // namespace internal
740 } // namespace v8 699 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/common-operator.h ('k') | src/compiler/frame-states.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698