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

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

Issue 1088993003: Replace OVERRIDE->override and FINAL->final since we now require C++11. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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/common-operator-reducer.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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 V(6) \ 187 V(6) \
188 V(7) \ 188 V(7) \
189 V(8) \ 189 V(8) \
190 V(10) \ 190 V(10) \
191 V(11) \ 191 V(11) \
192 V(12) \ 192 V(12) \
193 V(13) \ 193 V(13) \
194 V(14) 194 V(14)
195 195
196 196
197 struct CommonOperatorGlobalCache FINAL { 197 struct CommonOperatorGlobalCache final {
198 #define CACHED(Name, properties, value_input_count, effect_input_count, \ 198 #define CACHED(Name, properties, value_input_count, effect_input_count, \
199 control_input_count, value_output_count, effect_output_count, \ 199 control_input_count, value_output_count, effect_output_count, \
200 control_output_count) \ 200 control_output_count) \
201 struct Name##Operator FINAL : public Operator { \ 201 struct Name##Operator final : public Operator { \
202 Name##Operator() \ 202 Name##Operator() \
203 : Operator(IrOpcode::k##Name, properties, #Name, value_input_count, \ 203 : Operator(IrOpcode::k##Name, properties, #Name, value_input_count, \
204 effect_input_count, control_input_count, \ 204 effect_input_count, control_input_count, \
205 value_output_count, effect_output_count, \ 205 value_output_count, effect_output_count, \
206 control_output_count) {} \ 206 control_output_count) {} \
207 }; \ 207 }; \
208 Name##Operator k##Name##Operator; 208 Name##Operator k##Name##Operator;
209 CACHED_OP_LIST(CACHED) 209 CACHED_OP_LIST(CACHED)
210 #undef CACHED 210 #undef CACHED
211 211
212 template <BranchHint kBranchHint> 212 template <BranchHint kBranchHint>
213 struct BranchOperator FINAL : public Operator1<BranchHint> { 213 struct BranchOperator final : public Operator1<BranchHint> {
214 BranchOperator() 214 BranchOperator()
215 : Operator1<BranchHint>( // -- 215 : Operator1<BranchHint>( // --
216 IrOpcode::kBranch, Operator::kKontrol, // opcode 216 IrOpcode::kBranch, Operator::kKontrol, // opcode
217 "Branch", // name 217 "Branch", // name
218 1, 0, 1, 0, 0, 2, // counts 218 1, 0, 1, 0, 0, 2, // counts
219 kBranchHint) {} // parameter 219 kBranchHint) {} // parameter
220 }; 220 };
221 BranchOperator<BranchHint::kNone> kBranchNoneOperator; 221 BranchOperator<BranchHint::kNone> kBranchNoneOperator;
222 BranchOperator<BranchHint::kTrue> kBranchTrueOperator; 222 BranchOperator<BranchHint::kTrue> kBranchTrueOperator;
223 BranchOperator<BranchHint::kFalse> kBranchFalseOperator; 223 BranchOperator<BranchHint::kFalse> kBranchFalseOperator;
224 224
225 template <int kEffectInputCount> 225 template <int kEffectInputCount>
226 struct EffectPhiOperator FINAL : public Operator { 226 struct EffectPhiOperator final : public Operator {
227 EffectPhiOperator() 227 EffectPhiOperator()
228 : Operator( // -- 228 : Operator( // --
229 IrOpcode::kEffectPhi, Operator::kPure, // opcode 229 IrOpcode::kEffectPhi, Operator::kPure, // opcode
230 "EffectPhi", // name 230 "EffectPhi", // name
231 0, kEffectInputCount, 1, 0, 1, 0) {} // counts 231 0, kEffectInputCount, 1, 0, 1, 0) {} // counts
232 }; 232 };
233 #define CACHED_EFFECT_PHI(input_count) \ 233 #define CACHED_EFFECT_PHI(input_count) \
234 EffectPhiOperator<input_count> kEffectPhi##input_count##Operator; 234 EffectPhiOperator<input_count> kEffectPhi##input_count##Operator;
235 CACHED_EFFECT_PHI_LIST(CACHED_EFFECT_PHI) 235 CACHED_EFFECT_PHI_LIST(CACHED_EFFECT_PHI)
236 #undef CACHED_EFFECT_PHI 236 #undef CACHED_EFFECT_PHI
237 237
238 template <size_t kInputCount> 238 template <size_t kInputCount>
239 struct LoopOperator FINAL : public Operator { 239 struct LoopOperator final : public Operator {
240 LoopOperator() 240 LoopOperator()
241 : Operator( // -- 241 : Operator( // --
242 IrOpcode::kLoop, Operator::kKontrol, // opcode 242 IrOpcode::kLoop, Operator::kKontrol, // opcode
243 "Loop", // name 243 "Loop", // name
244 0, 0, kInputCount, 0, 0, 1) {} // counts 244 0, 0, kInputCount, 0, 0, 1) {} // counts
245 }; 245 };
246 #define CACHED_LOOP(input_count) \ 246 #define CACHED_LOOP(input_count) \
247 LoopOperator<input_count> kLoop##input_count##Operator; 247 LoopOperator<input_count> kLoop##input_count##Operator;
248 CACHED_LOOP_LIST(CACHED_LOOP) 248 CACHED_LOOP_LIST(CACHED_LOOP)
249 #undef CACHED_LOOP 249 #undef CACHED_LOOP
250 250
251 template <size_t kInputCount> 251 template <size_t kInputCount>
252 struct MergeOperator FINAL : public Operator { 252 struct MergeOperator final : public Operator {
253 MergeOperator() 253 MergeOperator()
254 : Operator( // -- 254 : Operator( // --
255 IrOpcode::kMerge, Operator::kKontrol, // opcode 255 IrOpcode::kMerge, Operator::kKontrol, // opcode
256 "Merge", // name 256 "Merge", // name
257 0, 0, kInputCount, 0, 0, 1) {} // counts 257 0, 0, kInputCount, 0, 0, 1) {} // counts
258 }; 258 };
259 #define CACHED_MERGE(input_count) \ 259 #define CACHED_MERGE(input_count) \
260 MergeOperator<input_count> kMerge##input_count##Operator; 260 MergeOperator<input_count> kMerge##input_count##Operator;
261 CACHED_MERGE_LIST(CACHED_MERGE) 261 CACHED_MERGE_LIST(CACHED_MERGE)
262 #undef CACHED_MERGE 262 #undef CACHED_MERGE
263 263
264 template <MachineType kType, int kInputCount> 264 template <MachineType kType, int kInputCount>
265 struct PhiOperator FINAL : public Operator1<MachineType> { 265 struct PhiOperator final : public Operator1<MachineType> {
266 PhiOperator() 266 PhiOperator()
267 : Operator1<MachineType>( //-- 267 : Operator1<MachineType>( //--
268 IrOpcode::kPhi, Operator::kPure, // opcode 268 IrOpcode::kPhi, Operator::kPure, // opcode
269 "Phi", // name 269 "Phi", // name
270 kInputCount, 0, 1, 1, 0, 0, // counts 270 kInputCount, 0, 1, 1, 0, 0, // counts
271 kType) {} // parameter 271 kType) {} // parameter
272 }; 272 };
273 #define CACHED_PHI(type, input_count) \ 273 #define CACHED_PHI(type, input_count) \
274 PhiOperator<type, input_count> kPhi##type##input_count##Operator; 274 PhiOperator<type, input_count> kPhi##type##input_count##Operator;
275 CACHED_PHI_LIST(CACHED_PHI) 275 CACHED_PHI_LIST(CACHED_PHI)
276 #undef CACHED_PHI 276 #undef CACHED_PHI
277 277
278 template <int kIndex> 278 template <int kIndex>
279 struct ParameterOperator FINAL : public Operator1<int> { 279 struct ParameterOperator final : public Operator1<int> {
280 ParameterOperator() 280 ParameterOperator()
281 : Operator1<int>( // -- 281 : Operator1<int>( // --
282 IrOpcode::kParameter, Operator::kPure, // opcode 282 IrOpcode::kParameter, Operator::kPure, // opcode
283 "Parameter", // name 283 "Parameter", // name
284 1, 0, 0, 1, 0, 0, // counts, 284 1, 0, 0, 1, 0, 0, // counts,
285 kIndex) {} // parameter 285 kIndex) {} // parameter
286 }; 286 };
287 #define CACHED_PARAMETER(index) \ 287 #define CACHED_PARAMETER(index) \
288 ParameterOperator<index> kParameter##index##Operator; 288 ParameterOperator<index> kParameter##index##Operator;
289 CACHED_PARAMETER_LIST(CACHED_PARAMETER) 289 CACHED_PARAMETER_LIST(CACHED_PARAMETER)
290 #undef CACHED_PARAMETER 290 #undef CACHED_PARAMETER
291 291
292 template <size_t kIndex> 292 template <size_t kIndex>
293 struct ProjectionOperator FINAL : public Operator1<size_t> { 293 struct ProjectionOperator final : public Operator1<size_t> {
294 ProjectionOperator() 294 ProjectionOperator()
295 : Operator1<size_t>( // -- 295 : Operator1<size_t>( // --
296 IrOpcode::kProjection, // opcode 296 IrOpcode::kProjection, // opcode
297 Operator::kPure, // flags 297 Operator::kPure, // flags
298 "Projection", // name 298 "Projection", // name
299 1, 0, 0, 1, 0, 0, // counts, 299 1, 0, 0, 1, 0, 0, // counts,
300 kIndex) {} // parameter 300 kIndex) {} // parameter
301 }; 301 };
302 #define CACHED_PROJECTION(index) \ 302 #define CACHED_PROJECTION(index) \
303 ProjectionOperator<index> kProjection##index##Operator; 303 ProjectionOperator<index> kProjection##index##Operator;
304 CACHED_PROJECTION_LIST(CACHED_PROJECTION) 304 CACHED_PROJECTION_LIST(CACHED_PROJECTION)
305 #undef CACHED_PROJECTION 305 #undef CACHED_PROJECTION
306 306
307 template <int kInputCount> 307 template <int kInputCount>
308 struct StateValuesOperator FINAL : public Operator { 308 struct StateValuesOperator final : public Operator {
309 StateValuesOperator() 309 StateValuesOperator()
310 : Operator( // -- 310 : Operator( // --
311 IrOpcode::kStateValues, // opcode 311 IrOpcode::kStateValues, // opcode
312 Operator::kPure, // flags 312 Operator::kPure, // flags
313 "StateValues", // name 313 "StateValues", // name
314 kInputCount, 0, 0, 1, 0, 0) {} // counts 314 kInputCount, 0, 0, 1, 0, 0) {} // counts
315 }; 315 };
316 #define CACHED_STATE_VALUES(input_count) \ 316 #define CACHED_STATE_VALUES(input_count) \
317 StateValuesOperator<input_count> kStateValues##input_count##Operator; 317 StateValuesOperator<input_count> kStateValues##input_count##Operator;
318 CACHED_STATE_VALUES_LIST(CACHED_STATE_VALUES) 318 CACHED_STATE_VALUES_LIST(CACHED_STATE_VALUES)
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 OutputFrameStateCombine state_combine, MaybeHandle<JSFunction> jsfunction) { 618 OutputFrameStateCombine state_combine, MaybeHandle<JSFunction> jsfunction) {
619 return new (zone()) Operator1<FrameStateCallInfo>( // -- 619 return new (zone()) Operator1<FrameStateCallInfo>( // --
620 IrOpcode::kFrameState, Operator::kPure, // opcode 620 IrOpcode::kFrameState, Operator::kPure, // opcode
621 "FrameState", // name 621 "FrameState", // name
622 4, 0, 0, 1, 0, 0, // counts 622 4, 0, 0, 1, 0, 0, // counts
623 FrameStateCallInfo(type, bailout_id, state_combine, jsfunction)); 623 FrameStateCallInfo(type, bailout_id, state_combine, jsfunction));
624 } 624 }
625 625
626 626
627 const Operator* CommonOperatorBuilder::Call(const CallDescriptor* descriptor) { 627 const Operator* CommonOperatorBuilder::Call(const CallDescriptor* descriptor) {
628 class CallOperator FINAL : public Operator1<const CallDescriptor*> { 628 class CallOperator final : public Operator1<const CallDescriptor*> {
629 public: 629 public:
630 CallOperator(const CallDescriptor* descriptor, const char* mnemonic) 630 CallOperator(const CallDescriptor* descriptor, const char* mnemonic)
631 : Operator1<const CallDescriptor*>( 631 : Operator1<const CallDescriptor*>(
632 IrOpcode::kCall, descriptor->properties(), mnemonic, 632 IrOpcode::kCall, descriptor->properties(), mnemonic,
633 descriptor->InputCount() + descriptor->FrameStateCount(), 633 descriptor->InputCount() + descriptor->FrameStateCount(),
634 Operator::ZeroIfPure(descriptor->properties()), 634 Operator::ZeroIfPure(descriptor->properties()),
635 Operator::ZeroIfEliminatable(descriptor->properties()), 635 Operator::ZeroIfEliminatable(descriptor->properties()),
636 descriptor->ReturnCount(), 636 descriptor->ReturnCount(),
637 Operator::ZeroIfPure(descriptor->properties()), 637 Operator::ZeroIfPure(descriptor->properties()),
638 Operator::ZeroIfNoThrow(descriptor->properties()), descriptor) {} 638 Operator::ZeroIfNoThrow(descriptor->properties()), descriptor) {}
639 639
640 void PrintParameter(std::ostream& os) const OVERRIDE { 640 void PrintParameter(std::ostream& os) const override {
641 os << "[" << *parameter() << "]"; 641 os << "[" << *parameter() << "]";
642 } 642 }
643 }; 643 };
644 return new (zone()) CallOperator(descriptor, "Call"); 644 return new (zone()) CallOperator(descriptor, "Call");
645 } 645 }
646 646
647 647
648 const Operator* CommonOperatorBuilder::Projection(size_t index) { 648 const Operator* CommonOperatorBuilder::Projection(size_t index) {
649 switch (index) { 649 switch (index) {
650 #define CACHED_PROJECTION(index) \ 650 #define CACHED_PROJECTION(index) \
(...skipping 27 matching lines...) Expand all
678 } else { 678 } else {
679 UNREACHABLE(); 679 UNREACHABLE();
680 return nullptr; 680 return nullptr;
681 } 681 }
682 } 682 }
683 683
684 684
685 } // namespace compiler 685 } // namespace compiler
686 } // namespace internal 686 } // namespace internal
687 } // namespace v8 687 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/common-operator.h ('k') | src/compiler/common-operator-reducer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698