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