Chromium Code Reviews| 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 15 matching lines...) Expand all Loading... | |
| 26 InstructionSequence* code, CompilationInfo* info); | 26 InstructionSequence* code, CompilationInfo* info); |
| 27 | 27 |
| 28 // Generate native code. | 28 // Generate native code. |
| 29 Handle<Code> GenerateCode(); | 29 Handle<Code> GenerateCode(); |
| 30 | 30 |
| 31 InstructionSequence* code() const { return code_; } | 31 InstructionSequence* code() const { return code_; } |
| 32 Frame* frame() const { return frame_; } | 32 Frame* frame() const { return frame_; } |
| 33 Isolate* isolate() const { return zone()->isolate(); } | 33 Isolate* isolate() const { return zone()->isolate(); } |
| 34 Linkage* linkage() const { return linkage_; } | 34 Linkage* linkage() const { return linkage_; } |
| 35 | 35 |
| 36 Label* GetLabel(BasicBlock::RpoNumber rpo) { return &labels_[rpo.ToSize()]; } | |
| 37 | |
| 36 private: | 38 private: |
| 37 MacroAssembler* masm() { return &masm_; } | 39 MacroAssembler* masm() { return &masm_; } |
| 38 GapResolver* resolver() { return &resolver_; } | 40 GapResolver* resolver() { return &resolver_; } |
| 39 SafepointTableBuilder* safepoints() { return &safepoints_; } | 41 SafepointTableBuilder* safepoints() { return &safepoints_; } |
| 40 Zone* zone() const { return code()->zone(); } | 42 Zone* zone() const { return code()->zone(); } |
| 41 CompilationInfo* info() const { return info_; } | 43 CompilationInfo* info() const { return info_; } |
| 42 | 44 |
| 43 // Checks if {block} will appear directly after {current_block_} when | 45 // Checks if {block} will appear directly after {current_block_} when |
| 44 // assembling code, in which case, a fall-through can be used. | 46 // assembling code, in which case, a fall-through can be used. |
| 45 bool IsNextInAssemblyOrder(BasicBlock::RpoNumber block) const; | 47 bool IsNextInAssemblyOrder(BasicBlock::RpoNumber block) const; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 111 : bailout_id_(bailout_id), | 113 : bailout_id_(bailout_id), |
| 112 translation_id_(translation_id), | 114 translation_id_(translation_id), |
| 113 pc_offset_(pc_offset) {} | 115 pc_offset_(pc_offset) {} |
| 114 | 116 |
| 115 private: | 117 private: |
| 116 BailoutId bailout_id_; | 118 BailoutId bailout_id_; |
| 117 int translation_id_; | 119 int translation_id_; |
| 118 int pc_offset_; | 120 int pc_offset_; |
| 119 }; | 121 }; |
| 120 | 122 |
| 123 // TODO(dcarney): zone allocate so these are accounted for. | |
| 124 typedef std::vector<Label> Labels; | |
|
Benedikt Meurer
2014/11/06 12:53:31
Nit: ZoneVector<Label>
dcarney
2014/11/06 13:07:56
no can do - Label is BASE_EMBEDDED
| |
| 125 | |
| 121 Frame* const frame_; | 126 Frame* const frame_; |
| 122 Linkage* const linkage_; | 127 Linkage* const linkage_; |
| 123 InstructionSequence* const code_; | 128 InstructionSequence* const code_; |
| 124 CompilationInfo* const info_; | 129 CompilationInfo* const info_; |
| 130 Labels labels_; | |
| 125 BasicBlock::RpoNumber current_block_; | 131 BasicBlock::RpoNumber current_block_; |
| 126 SourcePosition current_source_position_; | 132 SourcePosition current_source_position_; |
| 127 MacroAssembler masm_; | 133 MacroAssembler masm_; |
| 128 GapResolver resolver_; | 134 GapResolver resolver_; |
| 129 SafepointTableBuilder safepoints_; | 135 SafepointTableBuilder safepoints_; |
| 130 ZoneDeque<DeoptimizationState*> deoptimization_states_; | 136 ZoneDeque<DeoptimizationState*> deoptimization_states_; |
| 131 ZoneDeque<Handle<Object> > deoptimization_literals_; | 137 ZoneDeque<Handle<Object> > deoptimization_literals_; |
| 132 TranslationBuffer translations_; | 138 TranslationBuffer translations_; |
| 133 int last_lazy_deopt_pc_; | 139 int last_lazy_deopt_pc_; |
| 134 }; | 140 }; |
| 135 | 141 |
| 136 } // namespace compiler | 142 } // namespace compiler |
| 137 } // namespace internal | 143 } // namespace internal |
| 138 } // namespace v8 | 144 } // namespace v8 |
| 139 | 145 |
| 140 #endif // V8_COMPILER_CODE_GENERATOR_H | 146 #endif // V8_COMPILER_CODE_GENERATOR_H |
| OLD | NEW |