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/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/compiler/common-operator.h" | 10 #include "src/compiler/common-operator.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 : block_(block), used_(false), bound_(false) {} | 38 : block_(block), used_(false), bound_(false) {} |
39 | 39 |
40 BasicBlock* block_; | 40 BasicBlock* block_; |
41 bool used_; | 41 bool used_; |
42 bool bound_; | 42 bool bound_; |
43 friend class RawMachineAssembler; | 43 friend class RawMachineAssembler; |
44 DISALLOW_COPY_AND_ASSIGN(Label); | 44 DISALLOW_COPY_AND_ASSIGN(Label); |
45 }; | 45 }; |
46 | 46 |
47 RawMachineAssembler(Isolate* isolate, Graph* graph, | 47 RawMachineAssembler(Isolate* isolate, Graph* graph, |
48 MachineSignature* machine_sig, | 48 const MachineSignature* machine_sig, |
49 MachineType word = kMachPtr, | 49 MachineType word = kMachPtr, |
50 MachineOperatorBuilder::Flags flags = | 50 MachineOperatorBuilder::Flags flags = |
51 MachineOperatorBuilder::Flag::kNoFlags); | 51 MachineOperatorBuilder::Flag::kNoFlags); |
52 ~RawMachineAssembler() OVERRIDE {} | 52 ~RawMachineAssembler() OVERRIDE {} |
53 | 53 |
54 Zone* zone() const { return graph()->zone(); } | 54 Zone* zone() const { return graph()->zone(); } |
55 MachineOperatorBuilder* machine() { return &machine_; } | 55 MachineOperatorBuilder* machine() { return &machine_; } |
56 CommonOperatorBuilder* common() { return &common_; } | 56 CommonOperatorBuilder* common() { return &common_; } |
57 CallDescriptor* call_descriptor() const { return call_descriptor_; } | 57 CallDescriptor* call_descriptor() const { return call_descriptor_; } |
58 size_t parameter_count() const { return machine_sig_->parameter_count(); } | 58 size_t parameter_count() const { return machine_sig_->parameter_count(); } |
59 MachineSignature* machine_sig() const { return machine_sig_; } | 59 const MachineSignature* machine_sig() const { return machine_sig_; } |
60 | 60 |
61 Node* UndefinedConstant() { | 61 Node* UndefinedConstant() { |
62 Unique<HeapObject> unique = Unique<HeapObject>::CreateImmovable( | 62 Unique<HeapObject> unique = Unique<HeapObject>::CreateImmovable( |
63 isolate()->factory()->undefined_value()); | 63 isolate()->factory()->undefined_value()); |
64 return NewNode(common()->HeapConstant(unique)); | 64 return NewNode(common()->HeapConstant(unique)); |
65 } | 65 } |
66 | 66 |
67 // Constants. | 67 // Constants. |
68 Node* PointerConstant(void* value) { | 68 Node* PointerConstant(void* value) { |
69 return IntPtrConstant(reinterpret_cast<intptr_t>(value)); | 69 return IntPtrConstant(reinterpret_cast<intptr_t>(value)); |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 } | 441 } |
442 | 442 |
443 private: | 443 private: |
444 BasicBlock* Use(Label* label); | 444 BasicBlock* Use(Label* label); |
445 BasicBlock* EnsureBlock(Label* label); | 445 BasicBlock* EnsureBlock(Label* label); |
446 BasicBlock* CurrentBlock(); | 446 BasicBlock* CurrentBlock(); |
447 | 447 |
448 Schedule* schedule_; | 448 Schedule* schedule_; |
449 MachineOperatorBuilder machine_; | 449 MachineOperatorBuilder machine_; |
450 CommonOperatorBuilder common_; | 450 CommonOperatorBuilder common_; |
451 MachineSignature* machine_sig_; | 451 const MachineSignature* machine_sig_; |
452 CallDescriptor* call_descriptor_; | 452 CallDescriptor* call_descriptor_; |
453 Node** parameters_; | 453 Node** parameters_; |
454 Label exit_label_; | 454 Label exit_label_; |
455 BasicBlock* current_block_; | 455 BasicBlock* current_block_; |
456 | 456 |
457 DISALLOW_COPY_AND_ASSIGN(RawMachineAssembler); | 457 DISALLOW_COPY_AND_ASSIGN(RawMachineAssembler); |
458 }; | 458 }; |
459 | 459 |
460 } // namespace compiler | 460 } // namespace compiler |
461 } // namespace internal | 461 } // namespace internal |
462 } // namespace v8 | 462 } // namespace v8 |
463 | 463 |
464 #endif // V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ | 464 #endif // V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ |
OLD | NEW |