OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_CRANKSHAFT_X87_LITHIUM_CODEGEN_X87_H_ | 5 #ifndef V8_CRANKSHAFT_X87_LITHIUM_CODEGEN_X87_H_ |
6 #define V8_CRANKSHAFT_X87_LITHIUM_CODEGEN_X87_H_ | 6 #define V8_CRANKSHAFT_X87_LITHIUM_CODEGEN_X87_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "src/ast/scopes.h" | 10 #include "src/ast/scopes.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 class LGapNode; | 24 class LGapNode; |
25 class SafepointGenerator; | 25 class SafepointGenerator; |
26 | 26 |
27 class LCodeGen: public LCodeGenBase { | 27 class LCodeGen: public LCodeGenBase { |
28 public: | 28 public: |
29 LCodeGen(LChunk* chunk, MacroAssembler* assembler, CompilationInfo* info) | 29 LCodeGen(LChunk* chunk, MacroAssembler* assembler, CompilationInfo* info) |
30 : LCodeGenBase(chunk, assembler, info), | 30 : LCodeGenBase(chunk, assembler, info), |
31 jump_table_(4, info->zone()), | 31 jump_table_(4, info->zone()), |
32 scope_(info->scope()), | 32 scope_(info->scope()), |
33 deferred_(8, info->zone()), | 33 deferred_(8, info->zone()), |
34 dynamic_frame_alignment_(false), | |
35 support_aligned_spilled_doubles_(false), | |
36 frame_is_built_(false), | 34 frame_is_built_(false), |
37 x87_stack_(assembler), | 35 x87_stack_(assembler), |
38 safepoints_(info->zone()), | 36 safepoints_(info->zone()), |
39 resolver_(this), | 37 resolver_(this), |
40 expected_safepoint_kind_(Safepoint::kSimple) { | 38 expected_safepoint_kind_(Safepoint::kSimple) { |
41 PopulateDeoptimizationLiteralsWithInlinedFunctions(); | 39 PopulateDeoptimizationLiteralsWithInlinedFunctions(); |
42 } | 40 } |
43 | 41 |
44 int LookupDestination(int block_id) const { | 42 int LookupDestination(int block_id) const { |
45 return chunk()->LookupDestination(block_id); | 43 return chunk()->LookupDestination(block_id); |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 void DoLoadKeyedFixedArray(LLoadKeyed* instr); | 320 void DoLoadKeyedFixedArray(LLoadKeyed* instr); |
323 void DoStoreKeyedExternalArray(LStoreKeyed* instr); | 321 void DoStoreKeyedExternalArray(LStoreKeyed* instr); |
324 void DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr); | 322 void DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr); |
325 void DoStoreKeyedFixedArray(LStoreKeyed* instr); | 323 void DoStoreKeyedFixedArray(LStoreKeyed* instr); |
326 | 324 |
327 template <class T> | 325 template <class T> |
328 void EmitVectorLoadICRegisters(T* instr); | 326 void EmitVectorLoadICRegisters(T* instr); |
329 template <class T> | 327 template <class T> |
330 void EmitVectorStoreICRegisters(T* instr); | 328 void EmitVectorStoreICRegisters(T* instr); |
331 | 329 |
332 void EmitReturn(LReturn* instr, bool dynamic_frame_alignment); | 330 void EmitReturn(LReturn* instr); |
333 | 331 |
334 // Emits code for pushing either a tagged constant, a (non-double) | 332 // Emits code for pushing either a tagged constant, a (non-double) |
335 // register, or a stack slot operand. | 333 // register, or a stack slot operand. |
336 void EmitPushTaggedOperand(LOperand* operand); | 334 void EmitPushTaggedOperand(LOperand* operand); |
337 | 335 |
338 void X87Fld(Operand src, X87OperandType opts); | 336 void X87Fld(Operand src, X87OperandType opts); |
339 | 337 |
340 void EmitFlushX87ForDeopt(); | 338 void EmitFlushX87ForDeopt(); |
341 void FlushX87StackIfNecessary(LInstruction* instr) { | 339 void FlushX87StackIfNecessary(LInstruction* instr) { |
342 x87_stack_.FlushIfNecessary(instr, this); | 340 x87_stack_.FlushIfNecessary(instr, this); |
343 } | 341 } |
344 friend class LGapResolver; | 342 friend class LGapResolver; |
345 | 343 |
346 #ifdef _MSC_VER | 344 #ifdef _MSC_VER |
347 // On windows, you may not access the stack more than one page below | 345 // On windows, you may not access the stack more than one page below |
348 // the most recently mapped page. To make the allocated area randomly | 346 // the most recently mapped page. To make the allocated area randomly |
349 // accessible, we write an arbitrary value to each page in range | 347 // accessible, we write an arbitrary value to each page in range |
350 // esp + offset - page_size .. esp in turn. | 348 // esp + offset - page_size .. esp in turn. |
351 void MakeSureStackPagesMapped(int offset); | 349 void MakeSureStackPagesMapped(int offset); |
352 #endif | 350 #endif |
353 | 351 |
354 ZoneList<Deoptimizer::JumpTableEntry> jump_table_; | 352 ZoneList<Deoptimizer::JumpTableEntry> jump_table_; |
355 Scope* const scope_; | 353 Scope* const scope_; |
356 ZoneList<LDeferredCode*> deferred_; | 354 ZoneList<LDeferredCode*> deferred_; |
357 bool dynamic_frame_alignment_; | |
358 bool support_aligned_spilled_doubles_; | |
359 bool frame_is_built_; | 355 bool frame_is_built_; |
360 | 356 |
361 class X87Stack : public ZoneObject { | 357 class X87Stack : public ZoneObject { |
362 public: | 358 public: |
363 explicit X87Stack(MacroAssembler* masm) | 359 explicit X87Stack(MacroAssembler* masm) |
364 : stack_depth_(0), is_mutable_(true), masm_(masm) { } | 360 : stack_depth_(0), is_mutable_(true), masm_(masm) { } |
365 explicit X87Stack(const X87Stack& other) | 361 explicit X87Stack(const X87Stack& other) |
366 : stack_depth_(other.stack_depth_), is_mutable_(false), masm_(masm()) { | 362 : stack_depth_(other.stack_depth_), is_mutable_(false), masm_(masm()) { |
367 for (int i = 0; i < stack_depth_; i++) { | 363 for (int i = 0; i < stack_depth_; i++) { |
368 stack_[i] = other.stack_[i]; | 364 stack_[i] = other.stack_[i]; |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 Label* external_exit_; | 486 Label* external_exit_; |
491 Label done_; | 487 Label done_; |
492 int instruction_index_; | 488 int instruction_index_; |
493 LCodeGen::X87Stack x87_stack_; | 489 LCodeGen::X87Stack x87_stack_; |
494 }; | 490 }; |
495 | 491 |
496 } // namespace internal | 492 } // namespace internal |
497 } // namespace v8 | 493 } // namespace v8 |
498 | 494 |
499 #endif // V8_CRANKSHAFT_X87_LITHIUM_CODEGEN_X87_H_ | 495 #endif // V8_CRANKSHAFT_X87_LITHIUM_CODEGEN_X87_H_ |
OLD | NEW |