| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 current_block_(-1), | 53 current_block_(-1), |
| 54 current_instruction_(-1), | 54 current_instruction_(-1), |
| 55 instructions_(chunk->instructions()), | 55 instructions_(chunk->instructions()), |
| 56 deoptimizations_(4), | 56 deoptimizations_(4), |
| 57 deoptimization_literals_(8), | 57 deoptimization_literals_(8), |
| 58 inlined_function_count_(0), | 58 inlined_function_count_(0), |
| 59 scope_(chunk->graph()->info()->scope()), | 59 scope_(chunk->graph()->info()->scope()), |
| 60 status_(UNUSED), | 60 status_(UNUSED), |
| 61 deferred_(8), | 61 deferred_(8), |
| 62 osr_pc_offset_(-1), | 62 osr_pc_offset_(-1), |
| 63 deoptimization_reloc_size(), |
| 63 resolver_(this) { | 64 resolver_(this) { |
| 64 PopulateDeoptimizationLiteralsWithInlinedFunctions(); | 65 PopulateDeoptimizationLiteralsWithInlinedFunctions(); |
| 65 } | 66 } |
| 66 | 67 |
| 67 // Simple accessors. | 68 // Simple accessors. |
| 68 MacroAssembler* masm() const { return masm_; } | 69 MacroAssembler* masm() const { return masm_; } |
| 69 | 70 |
| 70 // Support for converting LOperands to assembler types. | 71 // Support for converting LOperands to assembler types. |
| 71 Operand ToOperand(LOperand* op) const; | 72 Operand ToOperand(LOperand* op) const; |
| 72 Register ToRegister(LOperand* op) const; | 73 Register ToRegister(LOperand* op) const; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 95 void DoDeferredStringCharCodeAt(LStringCharCodeAt* instr); | 96 void DoDeferredStringCharCodeAt(LStringCharCodeAt* instr); |
| 96 void DoDeferredLInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr, | 97 void DoDeferredLInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr, |
| 97 Label* map_check); | 98 Label* map_check); |
| 98 | 99 |
| 99 // Parallel move support. | 100 // Parallel move support. |
| 100 void DoParallelMove(LParallelMove* move); | 101 void DoParallelMove(LParallelMove* move); |
| 101 | 102 |
| 102 // Emit frame translation commands for an environment. | 103 // Emit frame translation commands for an environment. |
| 103 void WriteTranslation(LEnvironment* environment, Translation* translation); | 104 void WriteTranslation(LEnvironment* environment, Translation* translation); |
| 104 | 105 |
| 106 void EnsureRelocSpaceForDeoptimization(); |
| 107 |
| 105 // Declare methods that deal with the individual node types. | 108 // Declare methods that deal with the individual node types. |
| 106 #define DECLARE_DO(type) void Do##type(L##type* node); | 109 #define DECLARE_DO(type) void Do##type(L##type* node); |
| 107 LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) | 110 LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) |
| 108 #undef DECLARE_DO | 111 #undef DECLARE_DO |
| 109 | 112 |
| 110 private: | 113 private: |
| 111 enum Status { | 114 enum Status { |
| 112 UNUSED, | 115 UNUSED, |
| 113 GENERATING, | 116 GENERATING, |
| 114 DONE, | 117 DONE, |
| (...skipping 29 matching lines...) Expand all Loading... |
| 144 void Abort(const char* format, ...); | 147 void Abort(const char* format, ...); |
| 145 void Comment(const char* format, ...); | 148 void Comment(const char* format, ...); |
| 146 | 149 |
| 147 void AddDeferredCode(LDeferredCode* code) { deferred_.Add(code); } | 150 void AddDeferredCode(LDeferredCode* code) { deferred_.Add(code); } |
| 148 | 151 |
| 149 // Code generation passes. Returns true if code generation should | 152 // Code generation passes. Returns true if code generation should |
| 150 // continue. | 153 // continue. |
| 151 bool GeneratePrologue(); | 154 bool GeneratePrologue(); |
| 152 bool GenerateBody(); | 155 bool GenerateBody(); |
| 153 bool GenerateDeferredCode(); | 156 bool GenerateDeferredCode(); |
| 157 // Pad the reloc info to ensure that we have enough space to patch during |
| 158 // deoptimization. |
| 159 bool GenerateRelocPadding(); |
| 154 bool GenerateSafepointTable(); | 160 bool GenerateSafepointTable(); |
| 155 | 161 |
| 156 void CallCode(Handle<Code> code, RelocInfo::Mode mode, LInstruction* instr, | 162 void CallCode(Handle<Code> code, RelocInfo::Mode mode, LInstruction* instr, |
| 157 bool adjusted = true); | 163 bool adjusted = true); |
| 158 void CallRuntime(Runtime::Function* fun, int argc, LInstruction* instr, | 164 void CallRuntime(Runtime::Function* fun, int argc, LInstruction* instr, |
| 159 bool adjusted = true); | 165 bool adjusted = true); |
| 160 void CallRuntime(Runtime::FunctionId id, int argc, LInstruction* instr, | 166 void CallRuntime(Runtime::FunctionId id, int argc, LInstruction* instr, |
| 161 bool adjusted = true) { | 167 bool adjusted = true) { |
| 162 Runtime::Function* function = Runtime::FunctionForId(id); | 168 Runtime::Function* function = Runtime::FunctionForId(id); |
| 163 CallRuntime(function, argc, instr, adjusted); | 169 CallRuntime(function, argc, instr, adjusted); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 const ZoneList<LInstruction*>* instructions_; | 250 const ZoneList<LInstruction*>* instructions_; |
| 245 ZoneList<LEnvironment*> deoptimizations_; | 251 ZoneList<LEnvironment*> deoptimizations_; |
| 246 ZoneList<Handle<Object> > deoptimization_literals_; | 252 ZoneList<Handle<Object> > deoptimization_literals_; |
| 247 int inlined_function_count_; | 253 int inlined_function_count_; |
| 248 Scope* const scope_; | 254 Scope* const scope_; |
| 249 Status status_; | 255 Status status_; |
| 250 TranslationBuffer translations_; | 256 TranslationBuffer translations_; |
| 251 ZoneList<LDeferredCode*> deferred_; | 257 ZoneList<LDeferredCode*> deferred_; |
| 252 int osr_pc_offset_; | 258 int osr_pc_offset_; |
| 253 | 259 |
| 260 struct DeoptimizationRelocSize { |
| 261 int min_size; |
| 262 int last_pc_offset; |
| 263 }; |
| 264 |
| 265 DeoptimizationRelocSize deoptimization_reloc_size; |
| 266 |
| 254 // Builder that keeps track of safepoints in the code. The table | 267 // Builder that keeps track of safepoints in the code. The table |
| 255 // itself is emitted at the end of the generated code. | 268 // itself is emitted at the end of the generated code. |
| 256 SafepointTableBuilder safepoints_; | 269 SafepointTableBuilder safepoints_; |
| 257 | 270 |
| 258 // Compiler from a set of parallel moves to a sequential list of moves. | 271 // Compiler from a set of parallel moves to a sequential list of moves. |
| 259 LGapResolver resolver_; | 272 LGapResolver resolver_; |
| 260 | 273 |
| 261 friend class LDeferredCode; | 274 friend class LDeferredCode; |
| 262 friend class LEnvironment; | 275 friend class LEnvironment; |
| 263 friend class SafepointGenerator; | 276 friend class SafepointGenerator; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 286 private: | 299 private: |
| 287 LCodeGen* codegen_; | 300 LCodeGen* codegen_; |
| 288 Label entry_; | 301 Label entry_; |
| 289 Label exit_; | 302 Label exit_; |
| 290 Label* external_exit_; | 303 Label* external_exit_; |
| 291 }; | 304 }; |
| 292 | 305 |
| 293 } } // namespace v8::internal | 306 } } // namespace v8::internal |
| 294 | 307 |
| 295 #endif // V8_IA32_LITHIUM_CODEGEN_IA32_H_ | 308 #endif // V8_IA32_LITHIUM_CODEGEN_IA32_H_ |
| OLD | NEW |