| 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 #ifndef V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ | 5 #ifndef V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ |
| 6 #define V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ | 6 #define V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ |
| 7 | 7 |
| 8 #include "src/assembler.h" |
| 8 #include "src/compiler/common-operator.h" | 9 #include "src/compiler/common-operator.h" |
| 9 #include "src/compiler/graph-builder.h" | 10 #include "src/compiler/graph-builder.h" |
| 10 #include "src/compiler/linkage.h" | 11 #include "src/compiler/linkage.h" |
| 11 #include "src/compiler/machine-operator.h" | 12 #include "src/compiler/machine-operator.h" |
| 12 #include "src/compiler/node.h" | 13 #include "src/compiler/node.h" |
| 13 #include "src/compiler/operator.h" | 14 #include "src/compiler/operator.h" |
| 14 | 15 |
| 15 | |
| 16 namespace v8 { | 16 namespace v8 { |
| 17 namespace internal { | 17 namespace internal { |
| 18 namespace compiler { | 18 namespace compiler { |
| 19 | 19 |
| 20 class BasicBlock; | 20 class BasicBlock; |
| 21 class Schedule; | 21 class Schedule; |
| 22 | 22 |
| 23 | 23 |
| 24 class RawMachineAssembler : public GraphBuilder { | 24 class RawMachineAssembler : public GraphBuilder { |
| 25 public: | 25 public: |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 Node* Phi(MachineType type, Node* n1, Node* n2, Node* n3) { | 504 Node* Phi(MachineType type, Node* n1, Node* n2, Node* n3) { |
| 505 return NewNode(common()->Phi(type, 3), n1, n2, n3); | 505 return NewNode(common()->Phi(type, 3), n1, n2, n3); |
| 506 } | 506 } |
| 507 Node* Phi(MachineType type, Node* n1, Node* n2, Node* n3, Node* n4) { | 507 Node* Phi(MachineType type, Node* n1, Node* n2, Node* n3, Node* n4) { |
| 508 return NewNode(common()->Phi(type, 4), n1, n2, n3, n4); | 508 return NewNode(common()->Phi(type, 4), n1, n2, n3, n4); |
| 509 } | 509 } |
| 510 | 510 |
| 511 // MachineAssembler is invalid after export. | 511 // MachineAssembler is invalid after export. |
| 512 Schedule* Export(); | 512 Schedule* Export(); |
| 513 | 513 |
| 514 Schedule* schedule() { |
| 515 DCHECK(ScheduleValid()); |
| 516 return schedule_; |
| 517 } |
| 518 |
| 519 BasicBlock* CurrentBlock(); |
| 520 |
| 514 protected: | 521 protected: |
| 515 Node* MakeNode(const Operator* op, int input_count, Node** inputs, | 522 Node* MakeNode(const Operator* op, int input_count, Node** inputs, |
| 516 bool incomplete) final; | 523 bool incomplete) final; |
| 517 | 524 |
| 518 bool ScheduleValid() { return schedule_ != NULL; } | 525 bool ScheduleValid() { return schedule_ != NULL; } |
| 519 | 526 |
| 520 Schedule* schedule() { | |
| 521 DCHECK(ScheduleValid()); | |
| 522 return schedule_; | |
| 523 } | |
| 524 | |
| 525 private: | 527 private: |
| 526 BasicBlock* Use(Label* label); | 528 BasicBlock* Use(Label* label); |
| 527 BasicBlock* EnsureBlock(Label* label); | 529 BasicBlock* EnsureBlock(Label* label); |
| 528 BasicBlock* CurrentBlock(); | |
| 529 | 530 |
| 530 Schedule* schedule_; | 531 Schedule* schedule_; |
| 531 MachineOperatorBuilder machine_; | 532 MachineOperatorBuilder machine_; |
| 532 CommonOperatorBuilder common_; | 533 CommonOperatorBuilder common_; |
| 533 CallDescriptor* call_descriptor_; | 534 CallDescriptor* call_descriptor_; |
| 534 Node** parameters_; | 535 Node** parameters_; |
| 535 BasicBlock* current_block_; | 536 BasicBlock* current_block_; |
| 536 | 537 |
| 537 DISALLOW_COPY_AND_ASSIGN(RawMachineAssembler); | 538 DISALLOW_COPY_AND_ASSIGN(RawMachineAssembler); |
| 538 }; | 539 }; |
| 539 | 540 |
| 540 } // namespace compiler | 541 } // namespace compiler |
| 541 } // namespace internal | 542 } // namespace internal |
| 542 } // namespace v8 | 543 } // namespace v8 |
| 543 | 544 |
| 544 #endif // V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ | 545 #endif // V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ |
| OLD | NEW |