Chromium Code Reviews| 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/compiler/common-operator.h" | 8 #include "src/compiler/common-operator.h" |
| 9 #include "src/compiler/graph-builder.h" | 9 #include "src/compiler/graph-builder.h" |
| 10 #include "src/compiler/linkage.h" | 10 #include "src/compiler/linkage.h" |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 40 bool bound_; | 40 bool bound_; |
| 41 friend class RawMachineAssembler; | 41 friend class RawMachineAssembler; |
| 42 DISALLOW_COPY_AND_ASSIGN(Label); | 42 DISALLOW_COPY_AND_ASSIGN(Label); |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 RawMachineAssembler(Isolate* isolate, Graph* graph, | 45 RawMachineAssembler(Isolate* isolate, Graph* graph, |
| 46 const MachineSignature* machine_sig, | 46 const MachineSignature* machine_sig, |
| 47 MachineType word = kMachPtr, | 47 MachineType word = kMachPtr, |
| 48 MachineOperatorBuilder::Flags flags = | 48 MachineOperatorBuilder::Flags flags = |
| 49 MachineOperatorBuilder::Flag::kNoFlags); | 49 MachineOperatorBuilder::Flag::kNoFlags); |
| 50 | |
| 51 RawMachineAssembler(Isolate* isolate, Graph* graph, | |
| 52 const MachineSignature* machine_sig, MachineType word, | |
| 53 MachineOperatorBuilder::Flags flags, | |
| 54 CallDescriptor* call_descriptor); | |
|
oth
2015/07/15 13:22:01
The two constructors for RawMachineAssembler could
rmcilroy
2015/07/15 16:55:58
The existing constructor passes Linkage::GetSimpli
| |
| 55 | |
| 50 ~RawMachineAssembler() override {} | 56 ~RawMachineAssembler() override {} |
| 51 | 57 |
| 52 Zone* zone() const { return graph()->zone(); } | 58 Zone* zone() const { return graph()->zone(); } |
| 53 MachineOperatorBuilder* machine() { return &machine_; } | 59 MachineOperatorBuilder* machine() { return &machine_; } |
| 54 CommonOperatorBuilder* common() { return &common_; } | 60 CommonOperatorBuilder* common() { return &common_; } |
| 55 CallDescriptor* call_descriptor() const { return call_descriptor_; } | 61 CallDescriptor* call_descriptor() const { return call_descriptor_; } |
| 56 size_t parameter_count() const { return machine_sig_->parameter_count(); } | 62 size_t parameter_count() const { return machine_sig_->parameter_count(); } |
| 57 const MachineSignature* machine_sig() const { return machine_sig_; } | 63 const MachineSignature* machine_sig() const { return machine_sig_; } |
| 58 | 64 |
| 59 Node* UndefinedConstant() { | 65 Node* UndefinedConstant() { |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 502 Node* Phi(MachineType type, Node* n1, Node* n2, Node* n3) { | 508 Node* Phi(MachineType type, Node* n1, Node* n2, Node* n3) { |
| 503 return NewNode(common()->Phi(type, 3), n1, n2, n3); | 509 return NewNode(common()->Phi(type, 3), n1, n2, n3); |
| 504 } | 510 } |
| 505 Node* Phi(MachineType type, Node* n1, Node* n2, Node* n3, Node* n4) { | 511 Node* Phi(MachineType type, Node* n1, Node* n2, Node* n3, Node* n4) { |
| 506 return NewNode(common()->Phi(type, 4), n1, n2, n3, n4); | 512 return NewNode(common()->Phi(type, 4), n1, n2, n3, n4); |
| 507 } | 513 } |
| 508 | 514 |
| 509 // MachineAssembler is invalid after export. | 515 // MachineAssembler is invalid after export. |
| 510 Schedule* Export(); | 516 Schedule* Export(); |
| 511 | 517 |
| 518 Schedule* schedule() { | |
| 519 DCHECK(ScheduleValid()); | |
| 520 return schedule_; | |
| 521 } | |
| 522 | |
| 523 BasicBlock* CurrentBlock(); | |
| 524 | |
| 512 protected: | 525 protected: |
| 513 Node* MakeNode(const Operator* op, int input_count, Node** inputs, | 526 Node* MakeNode(const Operator* op, int input_count, Node** inputs, |
| 514 bool incomplete) final; | 527 bool incomplete) final; |
| 515 | 528 |
| 516 bool ScheduleValid() { return schedule_ != NULL; } | 529 bool ScheduleValid() { return schedule_ != NULL; } |
| 517 | 530 |
| 518 Schedule* schedule() { | |
| 519 DCHECK(ScheduleValid()); | |
| 520 return schedule_; | |
| 521 } | |
| 522 | |
| 523 private: | 531 private: |
| 524 BasicBlock* Use(Label* label); | 532 BasicBlock* Use(Label* label); |
| 525 BasicBlock* EnsureBlock(Label* label); | 533 BasicBlock* EnsureBlock(Label* label); |
| 526 BasicBlock* CurrentBlock(); | |
| 527 | 534 |
| 528 Schedule* schedule_; | 535 Schedule* schedule_; |
| 529 MachineOperatorBuilder machine_; | 536 MachineOperatorBuilder machine_; |
| 530 CommonOperatorBuilder common_; | 537 CommonOperatorBuilder common_; |
| 531 const MachineSignature* machine_sig_; | 538 const MachineSignature* machine_sig_; |
| 532 CallDescriptor* call_descriptor_; | 539 CallDescriptor* call_descriptor_; |
| 533 Node** parameters_; | 540 Node** parameters_; |
| 534 BasicBlock* current_block_; | 541 BasicBlock* current_block_; |
| 535 | 542 |
| 536 DISALLOW_COPY_AND_ASSIGN(RawMachineAssembler); | 543 DISALLOW_COPY_AND_ASSIGN(RawMachineAssembler); |
| 537 }; | 544 }; |
| 538 | 545 |
| 539 } // namespace compiler | 546 } // namespace compiler |
| 540 } // namespace internal | 547 } // namespace internal |
| 541 } // namespace v8 | 548 } // namespace v8 |
| 542 | 549 |
| 543 #endif // V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ | 550 #endif // V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ |
| OLD | NEW |