| 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.h" | 9 #include "src/compiler/graph.h" |
| 10 #include "src/compiler/linkage.h" | 10 #include "src/compiler/linkage.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 // In order to create a schedule on-the-fly, the assembler keeps track of basic | 27 // In order to create a schedule on-the-fly, the assembler keeps track of basic |
| 28 // blocks by having one current basic block being populated and by referencing | 28 // blocks by having one current basic block being populated and by referencing |
| 29 // other basic blocks through the use of labels. | 29 // other basic blocks through the use of labels. |
| 30 class RawMachineAssembler { | 30 class RawMachineAssembler { |
| 31 public: | 31 public: |
| 32 class Label { | 32 class Label { |
| 33 public: | 33 public: |
| 34 Label() : block_(NULL), used_(false), bound_(false) {} | 34 Label() : block_(NULL), used_(false), bound_(false) {} |
| 35 ~Label() { DCHECK(bound_ || !used_); } | 35 ~Label() { DCHECK(bound_ || !used_); } |
| 36 | 36 |
| 37 BasicBlock* block() { return block_; } | |
| 38 | |
| 39 private: | 37 private: |
| 40 // Private constructor for exit label. | |
| 41 explicit Label(BasicBlock* block) | |
| 42 : block_(block), used_(false), bound_(false) {} | |
| 43 | |
| 44 BasicBlock* block_; | 38 BasicBlock* block_; |
| 45 bool used_; | 39 bool used_; |
| 46 bool bound_; | 40 bool bound_; |
| 47 friend class RawMachineAssembler; | 41 friend class RawMachineAssembler; |
| 48 DISALLOW_COPY_AND_ASSIGN(Label); | 42 DISALLOW_COPY_AND_ASSIGN(Label); |
| 49 }; | 43 }; |
| 50 | 44 |
| 51 RawMachineAssembler(Isolate* isolate, Graph* graph, | 45 RawMachineAssembler(Isolate* isolate, Graph* graph, |
| 52 CallDescriptor* call_descriptor, | 46 CallDescriptor* call_descriptor, |
| 53 MachineType word = kMachPtr, | 47 MachineType word = kMachPtr, |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 BasicBlock* current_block_; | 585 BasicBlock* current_block_; |
| 592 | 586 |
| 593 DISALLOW_COPY_AND_ASSIGN(RawMachineAssembler); | 587 DISALLOW_COPY_AND_ASSIGN(RawMachineAssembler); |
| 594 }; | 588 }; |
| 595 | 589 |
| 596 } // namespace compiler | 590 } // namespace compiler |
| 597 } // namespace internal | 591 } // namespace internal |
| 598 } // namespace v8 | 592 } // namespace v8 |
| 599 | 593 |
| 600 #endif // V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ | 594 #endif // V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ |
| OLD | NEW |