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_IA32_LITHIUM_CODEGEN_IA32_H_ | 5 #ifndef V8_CRANKSHAFT_IA32_LITHIUM_CODEGEN_IA32_H_ |
6 #define V8_CRANKSHAFT_IA32_LITHIUM_CODEGEN_IA32_H_ | 6 #define V8_CRANKSHAFT_IA32_LITHIUM_CODEGEN_IA32_H_ |
7 | 7 |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 #include "src/base/logging.h" | 9 #include "src/base/logging.h" |
10 #include "src/crankshaft/ia32/lithium-gap-resolver-ia32.h" | 10 #include "src/crankshaft/ia32/lithium-gap-resolver-ia32.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 int LookupDestination(int block_id) const { | 41 int LookupDestination(int block_id) const { |
42 return chunk()->LookupDestination(block_id); | 42 return chunk()->LookupDestination(block_id); |
43 } | 43 } |
44 | 44 |
45 bool IsNextEmittedBlock(int block_id) const { | 45 bool IsNextEmittedBlock(int block_id) const { |
46 return LookupDestination(block_id) == GetNextEmittedBlock(); | 46 return LookupDestination(block_id) == GetNextEmittedBlock(); |
47 } | 47 } |
48 | 48 |
49 bool NeedsEagerFrame() const { | 49 bool NeedsEagerFrame() const { |
50 return HasAllocatedStackSlots() || info()->is_non_deferred_calling() || | 50 return GetStackSlotCount() > 0 || |
51 !info()->IsStub() || info()->requires_frame(); | 51 info()->is_non_deferred_calling() || |
| 52 !info()->IsStub() || |
| 53 info()->requires_frame(); |
52 } | 54 } |
53 bool NeedsDeferredFrame() const { | 55 bool NeedsDeferredFrame() const { |
54 return !NeedsEagerFrame() && info()->is_deferred_calling(); | 56 return !NeedsEagerFrame() && info()->is_deferred_calling(); |
55 } | 57 } |
56 | 58 |
57 // Support for converting LOperands to assembler types. | 59 // Support for converting LOperands to assembler types. |
58 Operand ToOperand(LOperand* op) const; | 60 Operand ToOperand(LOperand* op) const; |
59 Register ToRegister(LOperand* op) const; | 61 Register ToRegister(LOperand* op) const; |
60 XMMRegister ToDoubleRegister(LOperand* op) const; | 62 XMMRegister ToDoubleRegister(LOperand* op) const; |
61 | 63 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 125 |
124 XMMRegister double_scratch0() const { return xmm0; } | 126 XMMRegister double_scratch0() const { return xmm0; } |
125 | 127 |
126 void EmitClassOfTest(Label* if_true, | 128 void EmitClassOfTest(Label* if_true, |
127 Label* if_false, | 129 Label* if_false, |
128 Handle<String> class_name, | 130 Handle<String> class_name, |
129 Register input, | 131 Register input, |
130 Register temporary, | 132 Register temporary, |
131 Register temporary2); | 133 Register temporary2); |
132 | 134 |
133 bool HasAllocatedStackSlots() const { | 135 int GetStackSlotCount() const { return chunk()->spill_slot_count(); } |
134 return chunk()->HasAllocatedStackSlots(); | |
135 } | |
136 int GetStackSlotCount() const { return chunk()->GetSpillSlotCount(); } | |
137 int GetTotalFrameSlotCount() const { | |
138 return chunk()->GetTotalFrameSlotCount(); | |
139 } | |
140 | 136 |
141 void AddDeferredCode(LDeferredCode* code) { deferred_.Add(code, zone()); } | 137 void AddDeferredCode(LDeferredCode* code) { deferred_.Add(code, zone()); } |
142 | 138 |
143 void SaveCallerDoubles(); | 139 void SaveCallerDoubles(); |
144 void RestoreCallerDoubles(); | 140 void RestoreCallerDoubles(); |
145 | 141 |
146 // Code generation passes. Returns true if code generation should | 142 // Code generation passes. Returns true if code generation should |
147 // continue. | 143 // continue. |
148 void GenerateBodyInstructionPre(LInstruction* instr) override; | 144 void GenerateBodyInstructionPre(LInstruction* instr) override; |
149 void GenerateBodyInstructionPost(LInstruction* instr) override; | 145 void GenerateBodyInstructionPost(LInstruction* instr) override; |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 Label exit_; | 384 Label exit_; |
389 Label* external_exit_; | 385 Label* external_exit_; |
390 Label done_; | 386 Label done_; |
391 int instruction_index_; | 387 int instruction_index_; |
392 }; | 388 }; |
393 | 389 |
394 } // namespace internal | 390 } // namespace internal |
395 } // namespace v8 | 391 } // namespace v8 |
396 | 392 |
397 #endif // V8_CRANKSHAFT_IA32_LITHIUM_CODEGEN_IA32_H_ | 393 #endif // V8_CRANKSHAFT_IA32_LITHIUM_CODEGEN_IA32_H_ |
OLD | NEW |