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