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/compiler/unwinding-info-writer.h" | 10 #include "src/compiler/unwinding-info-writer.h" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 | 118 |
119 CodeGenResult AssembleArchInstruction(Instruction* instr); | 119 CodeGenResult AssembleArchInstruction(Instruction* instr); |
120 void AssembleArchJump(RpoNumber target); | 120 void AssembleArchJump(RpoNumber target); |
121 void AssembleArchBranch(Instruction* instr, BranchInfo* branch); | 121 void AssembleArchBranch(Instruction* instr, BranchInfo* branch); |
122 void AssembleArchBoolean(Instruction* instr, FlagsCondition condition); | 122 void AssembleArchBoolean(Instruction* instr, FlagsCondition condition); |
123 void AssembleArchTrap(Instruction* instr, FlagsCondition condition); | 123 void AssembleArchTrap(Instruction* instr, FlagsCondition condition); |
124 void AssembleArchLookupSwitch(Instruction* instr); | 124 void AssembleArchLookupSwitch(Instruction* instr); |
125 void AssembleArchTableSwitch(Instruction* instr); | 125 void AssembleArchTableSwitch(Instruction* instr); |
126 | 126 |
127 CodeGenResult AssembleDeoptimizerCall(int deoptimization_id, | 127 CodeGenResult AssembleDeoptimizerCall(int deoptimization_id, |
128 Deoptimizer::BailoutType bailout_type, | |
129 SourcePosition pos); | 128 SourcePosition pos); |
130 | 129 |
131 // Generates an architecture-specific, descriptor-specific prologue | 130 // Generates an architecture-specific, descriptor-specific prologue |
132 // to set up a stack frame. | 131 // to set up a stack frame. |
133 void AssembleConstructFrame(); | 132 void AssembleConstructFrame(); |
134 | 133 |
135 // Generates an architecture-specific, descriptor-specific return sequence | 134 // Generates an architecture-specific, descriptor-specific return sequence |
136 // to tear down a stack frame. | 135 // to tear down a stack frame. |
137 void AssembleReturn(InstructionOperand* pop); | 136 void AssembleReturn(InstructionOperand* pop); |
138 | 137 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 | 202 |
204 // =========================================================================== | 203 // =========================================================================== |
205 // ================== Deoptimization table construction. ===================== | 204 // ================== Deoptimization table construction. ===================== |
206 // =========================================================================== | 205 // =========================================================================== |
207 | 206 |
208 void RecordCallPosition(Instruction* instr); | 207 void RecordCallPosition(Instruction* instr); |
209 void PopulateDeoptimizationData(Handle<Code> code); | 208 void PopulateDeoptimizationData(Handle<Code> code); |
210 int DefineDeoptimizationLiteral(Handle<Object> literal); | 209 int DefineDeoptimizationLiteral(Handle<Object> literal); |
211 DeoptimizationEntry const& GetDeoptimizationEntry(Instruction* instr, | 210 DeoptimizationEntry const& GetDeoptimizationEntry(Instruction* instr, |
212 size_t frame_state_offset); | 211 size_t frame_state_offset); |
| 212 DeoptimizeKind GetDeoptimizationKind(int deoptimization_id) const; |
213 DeoptimizeReason GetDeoptimizationReason(int deoptimization_id) const; | 213 DeoptimizeReason GetDeoptimizationReason(int deoptimization_id) const; |
214 int BuildTranslation(Instruction* instr, int pc_offset, | 214 int BuildTranslation(Instruction* instr, int pc_offset, |
215 size_t frame_state_offset, | 215 size_t frame_state_offset, |
216 OutputFrameStateCombine state_combine); | 216 OutputFrameStateCombine state_combine); |
217 void BuildTranslationForFrameStateDescriptor( | 217 void BuildTranslationForFrameStateDescriptor( |
218 FrameStateDescriptor* descriptor, InstructionOperandIterator* iter, | 218 FrameStateDescriptor* descriptor, InstructionOperandIterator* iter, |
219 Translation* translation, OutputFrameStateCombine state_combine); | 219 Translation* translation, OutputFrameStateCombine state_combine); |
220 void TranslateStateValueDescriptor(StateValueDescriptor* desc, | 220 void TranslateStateValueDescriptor(StateValueDescriptor* desc, |
221 StateValueList* nested, | 221 StateValueList* nested, |
222 Translation* translation, | 222 Translation* translation, |
223 InstructionOperandIterator* iter); | 223 InstructionOperandIterator* iter); |
224 void TranslateFrameStateDescriptorOperands(FrameStateDescriptor* desc, | 224 void TranslateFrameStateDescriptorOperands(FrameStateDescriptor* desc, |
225 InstructionOperandIterator* iter, | 225 InstructionOperandIterator* iter, |
226 OutputFrameStateCombine combine, | 226 OutputFrameStateCombine combine, |
227 Translation* translation); | 227 Translation* translation); |
228 void AddTranslationForOperand(Translation* translation, Instruction* instr, | 228 void AddTranslationForOperand(Translation* translation, Instruction* instr, |
229 InstructionOperand* op, MachineType type); | 229 InstructionOperand* op, MachineType type); |
230 void EnsureSpaceForLazyDeopt(); | 230 void EnsureSpaceForLazyDeopt(); |
231 void MarkLazyDeoptSite(); | 231 void MarkLazyDeoptSite(); |
232 | 232 |
233 DeoptimizationExit* AddDeoptimizationExit(Instruction* instr, | 233 DeoptimizationExit* AddDeoptimizationExit(Instruction* instr, |
234 size_t frame_state_offset); | 234 size_t frame_state_offset); |
235 | 235 |
236 // =========================================================================== | 236 // =========================================================================== |
237 | 237 |
238 class DeoptimizationState final : public ZoneObject { | 238 class DeoptimizationState final : public ZoneObject { |
239 public: | 239 public: |
240 DeoptimizationState(BailoutId bailout_id, int translation_id, int pc_offset, | 240 DeoptimizationState(BailoutId bailout_id, int translation_id, int pc_offset, |
241 DeoptimizeReason reason) | 241 DeoptimizeKind kind, DeoptimizeReason reason) |
242 : bailout_id_(bailout_id), | 242 : bailout_id_(bailout_id), |
243 translation_id_(translation_id), | 243 translation_id_(translation_id), |
244 pc_offset_(pc_offset), | 244 pc_offset_(pc_offset), |
| 245 kind_(kind), |
245 reason_(reason) {} | 246 reason_(reason) {} |
246 | 247 |
247 BailoutId bailout_id() const { return bailout_id_; } | 248 BailoutId bailout_id() const { return bailout_id_; } |
248 int translation_id() const { return translation_id_; } | 249 int translation_id() const { return translation_id_; } |
249 int pc_offset() const { return pc_offset_; } | 250 int pc_offset() const { return pc_offset_; } |
| 251 DeoptimizeKind kind() const { return kind_; } |
250 DeoptimizeReason reason() const { return reason_; } | 252 DeoptimizeReason reason() const { return reason_; } |
251 | 253 |
252 private: | 254 private: |
253 BailoutId bailout_id_; | 255 BailoutId bailout_id_; |
254 int translation_id_; | 256 int translation_id_; |
255 int pc_offset_; | 257 int pc_offset_; |
| 258 DeoptimizeKind kind_; |
256 DeoptimizeReason reason_; | 259 DeoptimizeReason reason_; |
257 }; | 260 }; |
258 | 261 |
259 struct HandlerInfo { | 262 struct HandlerInfo { |
260 Label* handler; | 263 Label* handler; |
261 int pc_offset; | 264 int pc_offset; |
262 }; | 265 }; |
263 | 266 |
264 friend class OutOfLineCode; | 267 friend class OutOfLineCode; |
265 | 268 |
(...skipping 21 matching lines...) Expand all Loading... |
287 int osr_pc_offset_; | 290 int osr_pc_offset_; |
288 int optimized_out_literal_id_; | 291 int optimized_out_literal_id_; |
289 SourcePositionTableBuilder source_position_table_builder_; | 292 SourcePositionTableBuilder source_position_table_builder_; |
290 }; | 293 }; |
291 | 294 |
292 } // namespace compiler | 295 } // namespace compiler |
293 } // namespace internal | 296 } // namespace internal |
294 } // namespace v8 | 297 } // namespace v8 |
295 | 298 |
296 #endif // V8_COMPILER_CODE_GENERATOR_H | 299 #endif // V8_COMPILER_CODE_GENERATOR_H |
OLD | NEW |