| 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_CODE_GENERATOR_H_ | 5 #ifndef V8_COMPILER_CODE_GENERATOR_H_ |
| 6 #define V8_COMPILER_CODE_GENERATOR_H_ | 6 #define V8_COMPILER_CODE_GENERATOR_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 | 9 |
| 10 #include "src/compiler/gap-resolver.h" | 10 #include "src/compiler/gap-resolver.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 Schedule* schedule() const { return code()->schedule(); } | 32 Schedule* schedule() const { return code()->schedule(); } |
| 33 | 33 |
| 34 private: | 34 private: |
| 35 MacroAssembler* masm() { return &masm_; } | 35 MacroAssembler* masm() { return &masm_; } |
| 36 GapResolver* resolver() { return &resolver_; } | 36 GapResolver* resolver() { return &resolver_; } |
| 37 SafepointTableBuilder* safepoints() { return &safepoints_; } | 37 SafepointTableBuilder* safepoints() { return &safepoints_; } |
| 38 Zone* zone() const { return code()->zone(); } | 38 Zone* zone() const { return code()->zone(); } |
| 39 | 39 |
| 40 // Checks if {block} will appear directly after {current_block_} when | 40 // Checks if {block} will appear directly after {current_block_} when |
| 41 // assembling code, in which case, a fall-through can be used. | 41 // assembling code, in which case, a fall-through can be used. |
| 42 bool IsNextInAssemblyOrder(const BasicBlock* block) const { | 42 bool IsNextInAssemblyOrder(BasicBlock::RpoNumber block) const { |
| 43 return block->rpo_number() == (current_block_->rpo_number() + 1) && | 43 return current_block_.IsNext(block); |
| 44 block->deferred() == current_block_->deferred(); | |
| 45 } | 44 } |
| 46 | 45 |
| 47 // Record a safepoint with the given pointer map. | 46 // Record a safepoint with the given pointer map. |
| 48 void RecordSafepoint(PointerMap* pointers, Safepoint::Kind kind, | 47 void RecordSafepoint(PointerMap* pointers, Safepoint::Kind kind, |
| 49 int arguments, Safepoint::DeoptMode deopt_mode); | 48 int arguments, Safepoint::DeoptMode deopt_mode); |
| 50 | 49 |
| 51 // Assemble code for the specified instruction. | 50 // Assemble code for the specified instruction. |
| 52 void AssembleInstruction(Instruction* instr); | 51 void AssembleInstruction(Instruction* instr); |
| 53 void AssembleSourcePosition(SourcePositionInstruction* instr); | 52 void AssembleSourcePosition(SourcePositionInstruction* instr); |
| 54 void AssembleGap(GapInstruction* gap); | 53 void AssembleGap(GapInstruction* gap); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 translation_id_(translation_id), | 111 translation_id_(translation_id), |
| 113 pc_offset_(pc_offset) {} | 112 pc_offset_(pc_offset) {} |
| 114 | 113 |
| 115 private: | 114 private: |
| 116 BailoutId bailout_id_; | 115 BailoutId bailout_id_; |
| 117 int translation_id_; | 116 int translation_id_; |
| 118 int pc_offset_; | 117 int pc_offset_; |
| 119 }; | 118 }; |
| 120 | 119 |
| 121 InstructionSequence* code_; | 120 InstructionSequence* code_; |
| 122 BasicBlock* current_block_; | 121 BasicBlock::RpoNumber current_block_; |
| 123 SourcePosition current_source_position_; | 122 SourcePosition current_source_position_; |
| 124 MacroAssembler masm_; | 123 MacroAssembler masm_; |
| 125 GapResolver resolver_; | 124 GapResolver resolver_; |
| 126 SafepointTableBuilder safepoints_; | 125 SafepointTableBuilder safepoints_; |
| 127 ZoneDeque<DeoptimizationState*> deoptimization_states_; | 126 ZoneDeque<DeoptimizationState*> deoptimization_states_; |
| 128 ZoneDeque<Handle<Object> > deoptimization_literals_; | 127 ZoneDeque<Handle<Object> > deoptimization_literals_; |
| 129 TranslationBuffer translations_; | 128 TranslationBuffer translations_; |
| 130 int last_lazy_deopt_pc_; | 129 int last_lazy_deopt_pc_; |
| 131 }; | 130 }; |
| 132 | 131 |
| 133 } // namespace compiler | 132 } // namespace compiler |
| 134 } // namespace internal | 133 } // namespace internal |
| 135 } // namespace v8 | 134 } // namespace v8 |
| 136 | 135 |
| 137 #endif // V8_COMPILER_CODE_GENERATOR_H | 136 #endif // V8_COMPILER_CODE_GENERATOR_H |
| OLD | NEW |