| 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, |
| 128 SourcePosition pos); | 129 SourcePosition pos); |
| 129 | 130 |
| 130 // Generates an architecture-specific, descriptor-specific prologue | 131 // Generates an architecture-specific, descriptor-specific prologue |
| 131 // to set up a stack frame. | 132 // to set up a stack frame. |
| 132 void AssembleConstructFrame(); | 133 void AssembleConstructFrame(); |
| 133 | 134 |
| 134 // Generates an architecture-specific, descriptor-specific return sequence | 135 // Generates an architecture-specific, descriptor-specific return sequence |
| 135 // to tear down a stack frame. | 136 // to tear down a stack frame. |
| 136 void AssembleReturn(InstructionOperand* pop); | 137 void AssembleReturn(InstructionOperand* pop); |
| 137 | 138 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 | 203 |
| 203 // =========================================================================== | 204 // =========================================================================== |
| 204 // ================== Deoptimization table construction. ===================== | 205 // ================== Deoptimization table construction. ===================== |
| 205 // =========================================================================== | 206 // =========================================================================== |
| 206 | 207 |
| 207 void RecordCallPosition(Instruction* instr); | 208 void RecordCallPosition(Instruction* instr); |
| 208 void PopulateDeoptimizationData(Handle<Code> code); | 209 void PopulateDeoptimizationData(Handle<Code> code); |
| 209 int DefineDeoptimizationLiteral(Handle<Object> literal); | 210 int DefineDeoptimizationLiteral(Handle<Object> literal); |
| 210 DeoptimizationEntry const& GetDeoptimizationEntry(Instruction* instr, | 211 DeoptimizationEntry const& GetDeoptimizationEntry(Instruction* instr, |
| 211 size_t frame_state_offset); | 212 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 DeoptimizeKind kind, DeoptimizeReason reason) | 241 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), | |
| 246 reason_(reason) {} | 245 reason_(reason) {} |
| 247 | 246 |
| 248 BailoutId bailout_id() const { return bailout_id_; } | 247 BailoutId bailout_id() const { return bailout_id_; } |
| 249 int translation_id() const { return translation_id_; } | 248 int translation_id() const { return translation_id_; } |
| 250 int pc_offset() const { return pc_offset_; } | 249 int pc_offset() const { return pc_offset_; } |
| 251 DeoptimizeKind kind() const { return kind_; } | |
| 252 DeoptimizeReason reason() const { return reason_; } | 250 DeoptimizeReason reason() const { return reason_; } |
| 253 | 251 |
| 254 private: | 252 private: |
| 255 BailoutId bailout_id_; | 253 BailoutId bailout_id_; |
| 256 int translation_id_; | 254 int translation_id_; |
| 257 int pc_offset_; | 255 int pc_offset_; |
| 258 DeoptimizeKind kind_; | |
| 259 DeoptimizeReason reason_; | 256 DeoptimizeReason reason_; |
| 260 }; | 257 }; |
| 261 | 258 |
| 262 struct HandlerInfo { | 259 struct HandlerInfo { |
| 263 Label* handler; | 260 Label* handler; |
| 264 int pc_offset; | 261 int pc_offset; |
| 265 }; | 262 }; |
| 266 | 263 |
| 267 friend class OutOfLineCode; | 264 friend class OutOfLineCode; |
| 268 | 265 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 290 int osr_pc_offset_; | 287 int osr_pc_offset_; |
| 291 int optimized_out_literal_id_; | 288 int optimized_out_literal_id_; |
| 292 SourcePositionTableBuilder source_position_table_builder_; | 289 SourcePositionTableBuilder source_position_table_builder_; |
| 293 }; | 290 }; |
| 294 | 291 |
| 295 } // namespace compiler | 292 } // namespace compiler |
| 296 } // namespace internal | 293 } // namespace internal |
| 297 } // namespace v8 | 294 } // namespace v8 |
| 298 | 295 |
| 299 #endif // V8_COMPILER_CODE_GENERATOR_H | 296 #endif // V8_COMPILER_CODE_GENERATOR_H |
| OLD | NEW |