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 #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 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 | 485 |
486 | 486 |
487 const Operator* CommonOperatorBuilder::Projection(size_t index) { | 487 const Operator* CommonOperatorBuilder::Projection(size_t index) { |
488 return new (zone()) Operator1<size_t>( // -- | 488 return new (zone()) Operator1<size_t>( // -- |
489 IrOpcode::kProjection, Operator::kPure, // opcode | 489 IrOpcode::kProjection, Operator::kPure, // opcode |
490 "Projection", // name | 490 "Projection", // name |
491 1, 0, 0, 1, 0, 0, // counts | 491 1, 0, 0, 1, 0, 0, // counts |
492 index); // parameter | 492 index); // parameter |
493 } | 493 } |
494 | 494 |
| 495 |
| 496 const Operator* CommonOperatorBuilder::ResizeMergeOrPhi(const Operator* op, |
| 497 int size) { |
| 498 if (op->opcode() == IrOpcode::kPhi) { |
| 499 return Phi(OpParameter<MachineType>(op), size); |
| 500 } else if (op->opcode() == IrOpcode::kEffectPhi) { |
| 501 return EffectPhi(size); |
| 502 } else if (op->opcode() == IrOpcode::kMerge) { |
| 503 return Merge(size); |
| 504 } else if (op->opcode() == IrOpcode::kLoop) { |
| 505 return Loop(size); |
| 506 } else { |
| 507 UNREACHABLE(); |
| 508 return nullptr; |
| 509 } |
| 510 } |
| 511 |
| 512 |
495 } // namespace compiler | 513 } // namespace compiler |
496 } // namespace internal | 514 } // namespace internal |
497 } // namespace v8 | 515 } // namespace v8 |
OLD | NEW |