OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64_LITHIUM_CODEGEN_ARM64_H_ | 5 #ifndef V8_ARM64_LITHIUM_CODEGEN_ARM64_H_ |
6 #define V8_ARM64_LITHIUM_CODEGEN_ARM64_H_ | 6 #define V8_ARM64_LITHIUM_CODEGEN_ARM64_H_ |
7 | 7 |
8 #include "src/arm64/lithium-arm64.h" | 8 #include "src/arm64/lithium-arm64.h" |
9 | 9 |
10 #include "src/arm64/lithium-gap-resolver-arm64.h" | 10 #include "src/arm64/lithium-gap-resolver-arm64.h" |
11 #include "src/deoptimizer.h" | 11 #include "src/deoptimizer.h" |
12 #include "src/lithium-codegen.h" | 12 #include "src/lithium-codegen.h" |
13 #include "src/safepoint-table.h" | 13 #include "src/safepoint-table.h" |
14 #include "src/scopes.h" | 14 #include "src/scopes.h" |
15 #include "src/utils.h" | 15 #include "src/utils.h" |
16 | 16 |
17 namespace v8 { | 17 namespace v8 { |
18 namespace internal { | 18 namespace internal { |
19 | 19 |
20 // Forward declarations. | 20 // Forward declarations. |
21 class LDeferredCode; | 21 class LDeferredCode; |
22 class SafepointGenerator; | 22 class SafepointGenerator; |
23 class BranchGenerator; | 23 class BranchGenerator; |
24 | 24 |
25 class LCodeGen: public LCodeGenBase { | 25 class LCodeGen: public LCodeGenBase { |
26 public: | 26 public: |
27 LCodeGen(LChunk* chunk, MacroAssembler* assembler, CompilationInfo* info) | 27 LCodeGen(LChunk* chunk, MacroAssembler* assembler, CompilationInfo* info) |
28 : LCodeGenBase(chunk, assembler, info), | 28 : LCodeGenBase(chunk, assembler, info), |
29 deoptimizations_(4, info->zone()), | 29 deoptimizations_(4, info->zone()), |
30 deopt_jump_table_(4, info->zone()), | 30 jump_table_(4, info->zone()), |
31 deoptimization_literals_(8, info->zone()), | 31 deoptimization_literals_(8, info->zone()), |
32 inlined_function_count_(0), | 32 inlined_function_count_(0), |
33 scope_(info->scope()), | 33 scope_(info->scope()), |
34 translations_(info->zone()), | 34 translations_(info->zone()), |
35 deferred_(8, info->zone()), | 35 deferred_(8, info->zone()), |
36 osr_pc_offset_(-1), | 36 osr_pc_offset_(-1), |
37 frame_is_built_(false), | 37 frame_is_built_(false), |
38 safepoints_(info->zone()), | 38 safepoints_(info->zone()), |
39 resolver_(this), | 39 resolver_(this), |
40 expected_safepoint_kind_(Safepoint::kSimple), | 40 expected_safepoint_kind_(Safepoint::kSimple), |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 SmiCheck check_needed); | 206 SmiCheck check_needed); |
207 | 207 |
208 int DefineDeoptimizationLiteral(Handle<Object> literal); | 208 int DefineDeoptimizationLiteral(Handle<Object> literal); |
209 void PopulateDeoptimizationData(Handle<Code> code); | 209 void PopulateDeoptimizationData(Handle<Code> code); |
210 void PopulateDeoptimizationLiteralsWithInlinedFunctions(); | 210 void PopulateDeoptimizationLiteralsWithInlinedFunctions(); |
211 | 211 |
212 MemOperand BuildSeqStringOperand(Register string, | 212 MemOperand BuildSeqStringOperand(Register string, |
213 Register temp, | 213 Register temp, |
214 LOperand* index, | 214 LOperand* index, |
215 String::Encoding encoding); | 215 String::Encoding encoding); |
216 void DeoptimizeBranch(LInstruction* instr, BranchType branch_type, | 216 void DeoptimizeBranch(LInstruction* instr, const char* reason, |
217 Register reg = NoReg, int bit = -1, | 217 BranchType branch_type, Register reg = NoReg, |
| 218 int bit = -1, |
218 Deoptimizer::BailoutType* override_bailout_type = NULL); | 219 Deoptimizer::BailoutType* override_bailout_type = NULL); |
219 void Deoptimize(LInstruction* instr, | 220 void Deoptimize(LInstruction* instr, |
220 Deoptimizer::BailoutType* override_bailout_type = NULL); | 221 Deoptimizer::BailoutType* override_bailout_type = NULL, |
221 void DeoptimizeIf(Condition cond, LInstruction* instr); | 222 const char* reason = NULL); |
222 void DeoptimizeIfZero(Register rt, LInstruction* instr); | 223 void DeoptimizeIf(Condition cond, LInstruction* instr, |
223 void DeoptimizeIfNotZero(Register rt, LInstruction* instr); | 224 const char* reason = NULL); |
224 void DeoptimizeIfNegative(Register rt, LInstruction* instr); | 225 void DeoptimizeIfZero(Register rt, LInstruction* instr, |
225 void DeoptimizeIfSmi(Register rt, LInstruction* instr); | 226 const char* reason = NULL); |
226 void DeoptimizeIfNotSmi(Register rt, LInstruction* instr); | 227 void DeoptimizeIfNotZero(Register rt, LInstruction* instr, |
| 228 const char* reason = NULL); |
| 229 void DeoptimizeIfNegative(Register rt, LInstruction* instr, |
| 230 const char* reason = NULL); |
| 231 void DeoptimizeIfSmi(Register rt, LInstruction* instr, |
| 232 const char* reason = NULL); |
| 233 void DeoptimizeIfNotSmi(Register rt, LInstruction* instr, |
| 234 const char* reason = NULL); |
227 void DeoptimizeIfRoot(Register rt, Heap::RootListIndex index, | 235 void DeoptimizeIfRoot(Register rt, Heap::RootListIndex index, |
228 LInstruction* instr); | 236 LInstruction* instr, const char* reason = NULL); |
229 void DeoptimizeIfNotRoot(Register rt, Heap::RootListIndex index, | 237 void DeoptimizeIfNotRoot(Register rt, Heap::RootListIndex index, |
230 LInstruction* instr); | 238 LInstruction* instr, const char* reason = NULL); |
231 void DeoptimizeIfMinusZero(DoubleRegister input, LInstruction* instr); | 239 void DeoptimizeIfMinusZero(DoubleRegister input, LInstruction* instr, |
232 void DeoptimizeIfBitSet(Register rt, int bit, LInstruction* instr); | 240 const char* reason = NULL); |
233 void DeoptimizeIfBitClear(Register rt, int bit, LInstruction* instr); | 241 void DeoptimizeIfBitSet(Register rt, int bit, LInstruction* instr, |
| 242 const char* reason = NULL); |
| 243 void DeoptimizeIfBitClear(Register rt, int bit, LInstruction* instr, |
| 244 const char* reason = NULL); |
234 | 245 |
235 MemOperand PrepareKeyedExternalArrayOperand(Register key, | 246 MemOperand PrepareKeyedExternalArrayOperand(Register key, |
236 Register base, | 247 Register base, |
237 Register scratch, | 248 Register scratch, |
238 bool key_is_smi, | 249 bool key_is_smi, |
239 bool key_is_constant, | 250 bool key_is_constant, |
240 int constant_key, | 251 int constant_key, |
241 ElementsKind elements_kind, | 252 ElementsKind elements_kind, |
242 int base_offset); | 253 int base_offset); |
243 MemOperand PrepareKeyedArrayOperand(Register base, | 254 MemOperand PrepareKeyedArrayOperand(Register base, |
(...skipping 22 matching lines...) Expand all Loading... |
266 int* object_index_pointer, | 277 int* object_index_pointer, |
267 int* dematerialized_index_pointer); | 278 int* dematerialized_index_pointer); |
268 | 279 |
269 void SaveCallerDoubles(); | 280 void SaveCallerDoubles(); |
270 void RestoreCallerDoubles(); | 281 void RestoreCallerDoubles(); |
271 | 282 |
272 // Code generation steps. Returns true if code generation should continue. | 283 // Code generation steps. Returns true if code generation should continue. |
273 void GenerateBodyInstructionPre(LInstruction* instr) OVERRIDE; | 284 void GenerateBodyInstructionPre(LInstruction* instr) OVERRIDE; |
274 bool GeneratePrologue(); | 285 bool GeneratePrologue(); |
275 bool GenerateDeferredCode(); | 286 bool GenerateDeferredCode(); |
276 bool GenerateDeoptJumpTable(); | 287 bool GenerateJumpTable(); |
277 bool GenerateSafepointTable(); | 288 bool GenerateSafepointTable(); |
278 | 289 |
279 // Generates the custom OSR entrypoint and sets the osr_pc_offset. | 290 // Generates the custom OSR entrypoint and sets the osr_pc_offset. |
280 void GenerateOsrPrologue(); | 291 void GenerateOsrPrologue(); |
281 | 292 |
282 enum SafepointMode { | 293 enum SafepointMode { |
283 RECORD_SIMPLE_SAFEPOINT, | 294 RECORD_SIMPLE_SAFEPOINT, |
284 RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS | 295 RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS |
285 }; | 296 }; |
286 | 297 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 void RecordSafepoint(Safepoint::DeoptMode mode); | 342 void RecordSafepoint(Safepoint::DeoptMode mode); |
332 void RecordSafepointWithRegisters(LPointerMap* pointers, | 343 void RecordSafepointWithRegisters(LPointerMap* pointers, |
333 int arguments, | 344 int arguments, |
334 Safepoint::DeoptMode mode); | 345 Safepoint::DeoptMode mode); |
335 void RecordSafepointWithLazyDeopt(LInstruction* instr, | 346 void RecordSafepointWithLazyDeopt(LInstruction* instr, |
336 SafepointMode safepoint_mode); | 347 SafepointMode safepoint_mode); |
337 | 348 |
338 void EnsureSpaceForLazyDeopt(int space_needed) OVERRIDE; | 349 void EnsureSpaceForLazyDeopt(int space_needed) OVERRIDE; |
339 | 350 |
340 ZoneList<LEnvironment*> deoptimizations_; | 351 ZoneList<LEnvironment*> deoptimizations_; |
341 ZoneList<Deoptimizer::JumpTableEntry*> deopt_jump_table_; | 352 ZoneList<Deoptimizer::JumpTableEntry*> jump_table_; |
342 ZoneList<Handle<Object> > deoptimization_literals_; | 353 ZoneList<Handle<Object> > deoptimization_literals_; |
343 int inlined_function_count_; | 354 int inlined_function_count_; |
344 Scope* const scope_; | 355 Scope* const scope_; |
345 TranslationBuffer translations_; | 356 TranslationBuffer translations_; |
346 ZoneList<LDeferredCode*> deferred_; | 357 ZoneList<LDeferredCode*> deferred_; |
347 int osr_pc_offset_; | 358 int osr_pc_offset_; |
348 bool frame_is_built_; | 359 bool frame_is_built_; |
349 | 360 |
350 // Builder that keeps track of safepoints in the code. The table itself is | 361 // Builder that keeps track of safepoints in the code. The table itself is |
351 // emitted at the end of the generated code. | 362 // emitted at the end of the generated code. |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 | 463 |
453 protected: | 464 protected: |
454 MacroAssembler* masm() const { return codegen_->masm(); } | 465 MacroAssembler* masm() const { return codegen_->masm(); } |
455 | 466 |
456 LCodeGen* codegen_; | 467 LCodeGen* codegen_; |
457 }; | 468 }; |
458 | 469 |
459 } } // namespace v8::internal | 470 } } // namespace v8::internal |
460 | 471 |
461 #endif // V8_ARM64_LITHIUM_CODEGEN_ARM64_H_ | 472 #endif // V8_ARM64_LITHIUM_CODEGEN_ARM64_H_ |
OLD | NEW |