| 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 11 matching lines...) Expand all Loading... |
| 22 class BasicBlock; | 22 class BasicBlock; |
| 23 class Schedule; | 23 class Schedule; |
| 24 | 24 |
| 25 | 25 |
| 26 class RawMachineAssembler : public GraphBuilder, | 26 class RawMachineAssembler : public GraphBuilder, |
| 27 public MachineNodeFactory<RawMachineAssembler> { | 27 public MachineNodeFactory<RawMachineAssembler> { |
| 28 public: | 28 public: |
| 29 class Label { | 29 class Label { |
| 30 public: | 30 public: |
| 31 Label() : block_(NULL), used_(false), bound_(false) {} | 31 Label() : block_(NULL), used_(false), bound_(false) {} |
| 32 ~Label() { ASSERT(bound_ || !used_); } | 32 ~Label() { DCHECK(bound_ || !used_); } |
| 33 | 33 |
| 34 BasicBlock* block() { return block_; } | 34 BasicBlock* block() { return block_; } |
| 35 | 35 |
| 36 private: | 36 private: |
| 37 // Private constructor for exit label. | 37 // Private constructor for exit label. |
| 38 explicit Label(BasicBlock* block) | 38 explicit Label(BasicBlock* block) |
| 39 : block_(block), used_(false), bound_(false) {} | 39 : block_(block), used_(false), bound_(false) {} |
| 40 | 40 |
| 41 BasicBlock* block_; | 41 BasicBlock* block_; |
| 42 bool used_; | 42 bool used_; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 return NewNode(common()->Phi(4), n1, n2, n3, n4); | 90 return NewNode(common()->Phi(4), n1, n2, n3, n4); |
| 91 } | 91 } |
| 92 | 92 |
| 93 // MachineAssembler is invalid after export. | 93 // MachineAssembler is invalid after export. |
| 94 Schedule* Export(); | 94 Schedule* Export(); |
| 95 | 95 |
| 96 protected: | 96 protected: |
| 97 virtual Node* MakeNode(Operator* op, int input_count, Node** inputs); | 97 virtual Node* MakeNode(Operator* op, int input_count, Node** inputs); |
| 98 | 98 |
| 99 Schedule* schedule() { | 99 Schedule* schedule() { |
| 100 ASSERT(ScheduleValid()); | 100 DCHECK(ScheduleValid()); |
| 101 return schedule_; | 101 return schedule_; |
| 102 } | 102 } |
| 103 | 103 |
| 104 private: | 104 private: |
| 105 bool ScheduleValid() { return schedule_ != NULL; } | 105 bool ScheduleValid() { return schedule_ != NULL; } |
| 106 | 106 |
| 107 BasicBlock* Use(Label* label); | 107 BasicBlock* Use(Label* label); |
| 108 BasicBlock* EnsureBlock(Label* label); | 108 BasicBlock* EnsureBlock(Label* label); |
| 109 BasicBlock* CurrentBlock(); | 109 BasicBlock* CurrentBlock(); |
| 110 | 110 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 121 BasicBlock* current_block_; | 121 BasicBlock* current_block_; |
| 122 | 122 |
| 123 DISALLOW_COPY_AND_ASSIGN(RawMachineAssembler); | 123 DISALLOW_COPY_AND_ASSIGN(RawMachineAssembler); |
| 124 }; | 124 }; |
| 125 | 125 |
| 126 } // namespace compiler | 126 } // namespace compiler |
| 127 } // namespace internal | 127 } // namespace internal |
| 128 } // namespace v8 | 128 } // namespace v8 |
| 129 | 129 |
| 130 #endif // V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ | 130 #endif // V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ |
| OLD | NEW |