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 25 matching lines...) Expand all Loading... |
36 : block_(block), used_(false), bound_(false) {} | 36 : block_(block), used_(false), bound_(false) {} |
37 | 37 |
38 BasicBlock* block_; | 38 BasicBlock* block_; |
39 bool used_; | 39 bool used_; |
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 CallDescriptor* call_descriptor, |
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 ~RawMachineAssembler() override {} | 50 ~RawMachineAssembler() override {} |
51 | 51 |
52 Zone* zone() const { return graph()->zone(); } | 52 Zone* zone() const { return graph()->zone(); } |
53 MachineOperatorBuilder* machine() { return &machine_; } | 53 MachineOperatorBuilder* machine() { return &machine_; } |
54 CommonOperatorBuilder* common() { return &common_; } | 54 CommonOperatorBuilder* common() { return &common_; } |
55 CallDescriptor* call_descriptor() const { return call_descriptor_; } | 55 CallDescriptor* call_descriptor() const { return call_descriptor_; } |
56 size_t parameter_count() const { return machine_sig_->parameter_count(); } | 56 size_t parameter_count() const { return machine_sig()->parameter_count(); } |
57 const MachineSignature* machine_sig() const { return machine_sig_; } | 57 const MachineSignature* machine_sig() const { |
| 58 return call_descriptor_->GetMachineSignature(); |
| 59 } |
58 | 60 |
59 Node* UndefinedConstant() { | 61 Node* UndefinedConstant() { |
60 Unique<HeapObject> unique = Unique<HeapObject>::CreateImmovable( | 62 Unique<HeapObject> unique = Unique<HeapObject>::CreateImmovable( |
61 isolate()->factory()->undefined_value()); | 63 isolate()->factory()->undefined_value()); |
62 return NewNode(common()->HeapConstant(unique)); | 64 return NewNode(common()->HeapConstant(unique)); |
63 } | 65 } |
64 | 66 |
65 // Constants. | 67 // Constants. |
66 Node* PointerConstant(void* value) { | 68 Node* PointerConstant(void* value) { |
67 return IntPtrConstant(reinterpret_cast<intptr_t>(value)); | 69 return IntPtrConstant(reinterpret_cast<intptr_t>(value)); |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 } | 523 } |
522 | 524 |
523 private: | 525 private: |
524 BasicBlock* Use(Label* label); | 526 BasicBlock* Use(Label* label); |
525 BasicBlock* EnsureBlock(Label* label); | 527 BasicBlock* EnsureBlock(Label* label); |
526 BasicBlock* CurrentBlock(); | 528 BasicBlock* CurrentBlock(); |
527 | 529 |
528 Schedule* schedule_; | 530 Schedule* schedule_; |
529 MachineOperatorBuilder machine_; | 531 MachineOperatorBuilder machine_; |
530 CommonOperatorBuilder common_; | 532 CommonOperatorBuilder common_; |
531 const MachineSignature* machine_sig_; | |
532 CallDescriptor* call_descriptor_; | 533 CallDescriptor* call_descriptor_; |
533 Node** parameters_; | 534 Node** parameters_; |
534 BasicBlock* current_block_; | 535 BasicBlock* current_block_; |
535 | 536 |
536 DISALLOW_COPY_AND_ASSIGN(RawMachineAssembler); | 537 DISALLOW_COPY_AND_ASSIGN(RawMachineAssembler); |
537 }; | 538 }; |
538 | 539 |
539 } // namespace compiler | 540 } // namespace compiler |
540 } // namespace internal | 541 } // namespace internal |
541 } // namespace v8 | 542 } // namespace v8 |
542 | 543 |
543 #endif // V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ | 544 #endif // V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ |
OLD | NEW |