| 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 "src/compiler/gap-resolver.h" | 8 #include "src/compiler/gap-resolver.h" |
| 9 #include "src/compiler/instruction.h" | 9 #include "src/compiler/instruction.h" |
| 10 #include "src/deoptimizer.h" | 10 #include "src/deoptimizer.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 void AssembleInstruction(Instruction* instr); | 62 void AssembleInstruction(Instruction* instr); |
| 63 void AssembleSourcePosition(SourcePositionInstruction* instr); | 63 void AssembleSourcePosition(SourcePositionInstruction* instr); |
| 64 void AssembleGap(GapInstruction* gap); | 64 void AssembleGap(GapInstruction* gap); |
| 65 | 65 |
| 66 // =========================================================================== | 66 // =========================================================================== |
| 67 // ============= Architecture-specific code generation methods. ============== | 67 // ============= Architecture-specific code generation methods. ============== |
| 68 // =========================================================================== | 68 // =========================================================================== |
| 69 | 69 |
| 70 void AssembleArchInstruction(Instruction* instr); | 70 void AssembleArchInstruction(Instruction* instr); |
| 71 void AssembleArchJump(BasicBlock::RpoNumber target); | 71 void AssembleArchJump(BasicBlock::RpoNumber target); |
| 72 void AssembleArchSwitch(Instruction* instr); |
| 72 void AssembleArchBranch(Instruction* instr, BranchInfo* branch); | 73 void AssembleArchBranch(Instruction* instr, BranchInfo* branch); |
| 73 void AssembleArchBoolean(Instruction* instr, FlagsCondition condition); | 74 void AssembleArchBoolean(Instruction* instr, FlagsCondition condition); |
| 74 | 75 |
| 75 void AssembleDeoptimizerCall(int deoptimization_id); | 76 void AssembleDeoptimizerCall(int deoptimization_id); |
| 76 | 77 |
| 77 // Generates an architecture-specific, descriptor-specific prologue | 78 // Generates an architecture-specific, descriptor-specific prologue |
| 78 // to set up a stack frame. | 79 // to set up a stack frame. |
| 79 void AssemblePrologue(); | 80 void AssemblePrologue(); |
| 80 // Generates an architecture-specific, descriptor-specific return sequence | 81 // Generates an architecture-specific, descriptor-specific return sequence |
| 81 // to tear down a stack frame. | 82 // to tear down a stack frame. |
| 82 void AssembleReturn(); | 83 void AssembleReturn(); |
| 83 | 84 |
| 84 // =========================================================================== | 85 // =========================================================================== |
| 85 // ============== Architecture-specific gap resolver methods. ================ | 86 // ============== Architecture-specific gap resolver methods. ================ |
| 86 // =========================================================================== | 87 // =========================================================================== |
| 87 | 88 |
| 88 // Interface used by the gap resolver to emit moves and swaps. | 89 // Interface used by the gap resolver to emit moves and swaps. |
| 89 void AssembleMove(InstructionOperand* source, | 90 void AssembleMove(InstructionOperand* source, |
| 90 InstructionOperand* destination) FINAL; | 91 InstructionOperand* destination) FINAL; |
| 91 void AssembleSwap(InstructionOperand* source, | 92 void AssembleSwap(InstructionOperand* source, |
| 92 InstructionOperand* destination) FINAL; | 93 InstructionOperand* destination) FINAL; |
| 93 | 94 |
| 94 // =========================================================================== | 95 // =========================================================================== |
| 96 // =================== Jump table construction methods. ====================== |
| 97 // =========================================================================== |
| 98 |
| 99 class JumpTable; |
| 100 // Adds a jump table that is emitted after the actual code. Returns label |
| 101 // pointing to the beginning of the table. {targets} is assumed to be static |
| 102 // or zone allocated. |
| 103 Label* AddJumpTable(Label** targets, size_t target_count); |
| 104 // Emits a jump table. |
| 105 void AssembleJumpTable(Label** targets, size_t target_count); |
| 106 |
| 107 // =========================================================================== |
| 95 // Deoptimization table construction | 108 // Deoptimization table construction |
| 96 void AddSafepointAndDeopt(Instruction* instr); | 109 void AddSafepointAndDeopt(Instruction* instr); |
| 97 void PopulateDeoptimizationData(Handle<Code> code); | 110 void PopulateDeoptimizationData(Handle<Code> code); |
| 98 int DefineDeoptimizationLiteral(Handle<Object> literal); | 111 int DefineDeoptimizationLiteral(Handle<Object> literal); |
| 99 FrameStateDescriptor* GetFrameStateDescriptor(Instruction* instr, | 112 FrameStateDescriptor* GetFrameStateDescriptor(Instruction* instr, |
| 100 size_t frame_state_offset); | 113 size_t frame_state_offset); |
| 101 int BuildTranslation(Instruction* instr, int pc_offset, | 114 int BuildTranslation(Instruction* instr, int pc_offset, |
| 102 size_t frame_state_offset, | 115 size_t frame_state_offset, |
| 103 OutputFrameStateCombine state_combine); | 116 OutputFrameStateCombine state_combine); |
| 104 void BuildTranslationForFrameStateDescriptor( | 117 void BuildTranslationForFrameStateDescriptor( |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 Label* const labels_; | 151 Label* const labels_; |
| 139 BasicBlock::RpoNumber current_block_; | 152 BasicBlock::RpoNumber current_block_; |
| 140 SourcePosition current_source_position_; | 153 SourcePosition current_source_position_; |
| 141 MacroAssembler masm_; | 154 MacroAssembler masm_; |
| 142 GapResolver resolver_; | 155 GapResolver resolver_; |
| 143 SafepointTableBuilder safepoints_; | 156 SafepointTableBuilder safepoints_; |
| 144 ZoneDeque<DeoptimizationState*> deoptimization_states_; | 157 ZoneDeque<DeoptimizationState*> deoptimization_states_; |
| 145 ZoneDeque<Handle<Object> > deoptimization_literals_; | 158 ZoneDeque<Handle<Object> > deoptimization_literals_; |
| 146 TranslationBuffer translations_; | 159 TranslationBuffer translations_; |
| 147 int last_lazy_deopt_pc_; | 160 int last_lazy_deopt_pc_; |
| 161 JumpTable* jump_tables_; |
| 148 OutOfLineCode* ools_; | 162 OutOfLineCode* ools_; |
| 149 int osr_pc_offset_; | 163 int osr_pc_offset_; |
| 150 }; | 164 }; |
| 151 | 165 |
| 152 } // namespace compiler | 166 } // namespace compiler |
| 153 } // namespace internal | 167 } // namespace internal |
| 154 } // namespace v8 | 168 } // namespace v8 |
| 155 | 169 |
| 156 #endif // V8_COMPILER_CODE_GENERATOR_H | 170 #endif // V8_COMPILER_CODE_GENERATOR_H |
| OLD | NEW |