OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC_LITHIUM_CODEGEN_PPC_H_ | 5 #ifndef V8_PPC_LITHIUM_CODEGEN_PPC_H_ |
6 #define V8_PPC_LITHIUM_CODEGEN_PPC_H_ | 6 #define V8_PPC_LITHIUM_CODEGEN_PPC_H_ |
7 | 7 |
8 #include "src/ppc/lithium-ppc.h" | 8 #include "src/ppc/lithium-ppc.h" |
9 | 9 |
10 #include "src/ppc/lithium-gap-resolver-ppc.h" | 10 #include "src/ppc/lithium-gap-resolver-ppc.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 150 |
151 int GetStackSlotCount() const { return chunk()->spill_slot_count(); } | 151 int GetStackSlotCount() const { return chunk()->spill_slot_count(); } |
152 | 152 |
153 void AddDeferredCode(LDeferredCode* code) { deferred_.Add(code, zone()); } | 153 void AddDeferredCode(LDeferredCode* code) { deferred_.Add(code, zone()); } |
154 | 154 |
155 void SaveCallerDoubles(); | 155 void SaveCallerDoubles(); |
156 void RestoreCallerDoubles(); | 156 void RestoreCallerDoubles(); |
157 | 157 |
158 // Code generation passes. Returns true if code generation should | 158 // Code generation passes. Returns true if code generation should |
159 // continue. | 159 // continue. |
160 void GenerateBodyInstructionPre(LInstruction* instr) OVERRIDE; | 160 void GenerateBodyInstructionPre(LInstruction* instr) override; |
161 bool GeneratePrologue(); | 161 bool GeneratePrologue(); |
162 bool GenerateDeferredCode(); | 162 bool GenerateDeferredCode(); |
163 bool GenerateJumpTable(); | 163 bool GenerateJumpTable(); |
164 bool GenerateSafepointTable(); | 164 bool GenerateSafepointTable(); |
165 | 165 |
166 // Generates the custom OSR entrypoint and sets the osr_pc_offset. | 166 // Generates the custom OSR entrypoint and sets the osr_pc_offset. |
167 void GenerateOsrPrologue(); | 167 void GenerateOsrPrologue(); |
168 | 168 |
169 enum SafepointMode { | 169 enum SafepointMode { |
170 RECORD_SIMPLE_SAFEPOINT, | 170 RECORD_SIMPLE_SAFEPOINT, |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 #endif | 228 #endif |
229 | 229 |
230 // Support for recording safepoint and position information. | 230 // Support for recording safepoint and position information. |
231 void RecordSafepoint(LPointerMap* pointers, Safepoint::Kind kind, | 231 void RecordSafepoint(LPointerMap* pointers, Safepoint::Kind kind, |
232 int arguments, Safepoint::DeoptMode mode); | 232 int arguments, Safepoint::DeoptMode mode); |
233 void RecordSafepoint(LPointerMap* pointers, Safepoint::DeoptMode mode); | 233 void RecordSafepoint(LPointerMap* pointers, Safepoint::DeoptMode mode); |
234 void RecordSafepoint(Safepoint::DeoptMode mode); | 234 void RecordSafepoint(Safepoint::DeoptMode mode); |
235 void RecordSafepointWithRegisters(LPointerMap* pointers, int arguments, | 235 void RecordSafepointWithRegisters(LPointerMap* pointers, int arguments, |
236 Safepoint::DeoptMode mode); | 236 Safepoint::DeoptMode mode); |
237 | 237 |
238 void RecordAndWritePosition(int position) OVERRIDE; | 238 void RecordAndWritePosition(int position) override; |
239 | 239 |
240 static Condition TokenToCondition(Token::Value op); | 240 static Condition TokenToCondition(Token::Value op); |
241 void EmitGoto(int block); | 241 void EmitGoto(int block); |
242 | 242 |
243 // EmitBranch expects to be the last instruction of a block. | 243 // EmitBranch expects to be the last instruction of a block. |
244 template <class InstrType> | 244 template <class InstrType> |
245 void EmitBranch(InstrType instr, Condition condition, CRegister cr = cr7); | 245 void EmitBranch(InstrType instr, Condition condition, CRegister cr = cr7); |
246 template <class InstrType> | 246 template <class InstrType> |
247 void EmitFalseBranch(InstrType instr, Condition condition, | 247 void EmitFalseBranch(InstrType instr, Condition condition, |
248 CRegister cr = cr7); | 248 CRegister cr = cr7); |
(...skipping 20 matching lines...) Expand all Loading... |
269 | 269 |
270 // Emits optimized code for %_IsConstructCall(). | 270 // Emits optimized code for %_IsConstructCall(). |
271 // Caller should branch on equal condition. | 271 // Caller should branch on equal condition. |
272 void EmitIsConstructCall(Register temp1, Register temp2); | 272 void EmitIsConstructCall(Register temp1, Register temp2); |
273 | 273 |
274 // Emits optimized code to deep-copy the contents of statically known | 274 // Emits optimized code to deep-copy the contents of statically known |
275 // object graphs (e.g. object literal boilerplate). | 275 // object graphs (e.g. object literal boilerplate). |
276 void EmitDeepCopy(Handle<JSObject> object, Register result, Register source, | 276 void EmitDeepCopy(Handle<JSObject> object, Register result, Register source, |
277 int* offset, AllocationSiteMode mode); | 277 int* offset, AllocationSiteMode mode); |
278 | 278 |
279 void EnsureSpaceForLazyDeopt(int space_needed) OVERRIDE; | 279 void EnsureSpaceForLazyDeopt(int space_needed) override; |
280 void DoLoadKeyedExternalArray(LLoadKeyed* instr); | 280 void DoLoadKeyedExternalArray(LLoadKeyed* instr); |
281 void DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr); | 281 void DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr); |
282 void DoLoadKeyedFixedArray(LLoadKeyed* instr); | 282 void DoLoadKeyedFixedArray(LLoadKeyed* instr); |
283 void DoStoreKeyedExternalArray(LStoreKeyed* instr); | 283 void DoStoreKeyedExternalArray(LStoreKeyed* instr); |
284 void DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr); | 284 void DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr); |
285 void DoStoreKeyedFixedArray(LStoreKeyed* instr); | 285 void DoStoreKeyedFixedArray(LStoreKeyed* instr); |
286 | 286 |
287 template <class T> | 287 template <class T> |
288 void EmitVectorLoadICRegisters(T* instr); | 288 void EmitVectorLoadICRegisters(T* instr); |
289 | 289 |
290 ZoneList<LEnvironment*> deoptimizations_; | 290 ZoneList<LEnvironment*> deoptimizations_; |
291 ZoneList<Deoptimizer::JumpTableEntry> jump_table_; | 291 ZoneList<Deoptimizer::JumpTableEntry> jump_table_; |
292 ZoneList<Handle<Object> > deoptimization_literals_; | 292 ZoneList<Handle<Object> > deoptimization_literals_; |
293 int inlined_function_count_; | 293 int inlined_function_count_; |
294 Scope* const scope_; | 294 Scope* const scope_; |
295 TranslationBuffer translations_; | 295 TranslationBuffer translations_; |
296 ZoneList<LDeferredCode*> deferred_; | 296 ZoneList<LDeferredCode*> deferred_; |
297 int osr_pc_offset_; | 297 int osr_pc_offset_; |
298 bool frame_is_built_; | 298 bool frame_is_built_; |
299 | 299 |
300 // Builder that keeps track of safepoints in the code. The table | 300 // Builder that keeps track of safepoints in the code. The table |
301 // itself is emitted at the end of the generated code. | 301 // itself is emitted at the end of the generated code. |
302 SafepointTableBuilder safepoints_; | 302 SafepointTableBuilder safepoints_; |
303 | 303 |
304 // Compiler from a set of parallel moves to a sequential list of moves. | 304 // Compiler from a set of parallel moves to a sequential list of moves. |
305 LGapResolver resolver_; | 305 LGapResolver resolver_; |
306 | 306 |
307 Safepoint::Kind expected_safepoint_kind_; | 307 Safepoint::Kind expected_safepoint_kind_; |
308 | 308 |
309 class PushSafepointRegistersScope FINAL BASE_EMBEDDED { | 309 class PushSafepointRegistersScope final BASE_EMBEDDED { |
310 public: | 310 public: |
311 explicit PushSafepointRegistersScope(LCodeGen* codegen) | 311 explicit PushSafepointRegistersScope(LCodeGen* codegen) |
312 : codegen_(codegen) { | 312 : codegen_(codegen) { |
313 DCHECK(codegen_->info()->is_calling()); | 313 DCHECK(codegen_->info()->is_calling()); |
314 DCHECK(codegen_->expected_safepoint_kind_ == Safepoint::kSimple); | 314 DCHECK(codegen_->expected_safepoint_kind_ == Safepoint::kSimple); |
315 codegen_->expected_safepoint_kind_ = Safepoint::kWithRegisters; | 315 codegen_->expected_safepoint_kind_ = Safepoint::kWithRegisters; |
316 StoreRegistersStateStub stub(codegen_->isolate()); | 316 StoreRegistersStateStub stub(codegen_->isolate()); |
317 codegen_->masm_->CallStub(&stub); | 317 codegen_->masm_->CallStub(&stub); |
318 } | 318 } |
319 | 319 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 LCodeGen* codegen_; | 361 LCodeGen* codegen_; |
362 Label entry_; | 362 Label entry_; |
363 Label exit_; | 363 Label exit_; |
364 Label* external_exit_; | 364 Label* external_exit_; |
365 int instruction_index_; | 365 int instruction_index_; |
366 }; | 366 }; |
367 } | 367 } |
368 } // namespace v8::internal | 368 } // namespace v8::internal |
369 | 369 |
370 #endif // V8_PPC_LITHIUM_CODEGEN_PPC_H_ | 370 #endif // V8_PPC_LITHIUM_CODEGEN_PPC_H_ |
OLD | NEW |