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

Side by Side Diff: src/compiler/operator.h

Issue 1309903005: Use correct template parameters when casting RHS of operator comparison. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_OPERATOR_H_ 5 #ifndef V8_COMPILER_OPERATOR_H_
6 #define V8_COMPILER_OPERATOR_H_ 6 #define V8_COMPILER_OPERATOR_H_
7 7
8 #include <ostream> // NOLINT(readability/streams) 8 #include <ostream> // NOLINT(readability/streams)
9 9
10 #include "src/base/flags.h" 10 #include "src/base/flags.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 : Operator(opcode, properties, mnemonic, value_in, effect_in, control_in, 148 : Operator(opcode, properties, mnemonic, value_in, effect_in, control_in,
149 value_out, effect_out, control_out), 149 value_out, effect_out, control_out),
150 parameter_(parameter), 150 parameter_(parameter),
151 pred_(pred), 151 pred_(pred),
152 hash_(hash) {} 152 hash_(hash) {}
153 153
154 T const& parameter() const { return parameter_; } 154 T const& parameter() const { return parameter_; }
155 155
156 bool Equals(const Operator* other) const final { 156 bool Equals(const Operator* other) const final {
157 if (opcode() != other->opcode()) return false; 157 if (opcode() != other->opcode()) return false;
158 const Operator1<T>* that = reinterpret_cast<const Operator1<T>*>(other); 158 auto* that = reinterpret_cast<const Operator1<T, Pred, Hash>*>(other);
159 return this->pred_(this->parameter(), that->parameter()); 159 return this->pred_(this->parameter(), that->parameter());
160 } 160 }
161 size_t HashCode() const final { 161 size_t HashCode() const final {
162 return base::hash_combine(this->opcode(), this->hash_(this->parameter())); 162 return base::hash_combine(this->opcode(), this->hash_(this->parameter()));
163 } 163 }
164 virtual void PrintParameter(std::ostream& os) const { 164 virtual void PrintParameter(std::ostream& os) const {
165 os << "[" << this->parameter() << "]"; 165 os << "[" << this->parameter() << "]";
166 } 166 }
167 167
168 protected: 168 protected:
(...skipping 29 matching lines...) Expand all
198 return reinterpret_cast<const Operator1<double, base::bit_equal_to<double>, 198 return reinterpret_cast<const Operator1<double, base::bit_equal_to<double>,
199 base::bit_hash<double>>*>(op) 199 base::bit_hash<double>>*>(op)
200 ->parameter(); 200 ->parameter();
201 } 201 }
202 202
203 } // namespace compiler 203 } // namespace compiler
204 } // namespace internal 204 } // namespace internal
205 } // namespace v8 205 } // namespace v8
206 206
207 #endif // V8_COMPILER_OPERATOR_H_ 207 #endif // V8_COMPILER_OPERATOR_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698