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_MIPS_LITHIUM_CODEGEN_MIPS_H_ | 5 #ifndef V8_MIPS_LITHIUM_CODEGEN_MIPS_H_ |
6 #define V8_MIPS_LITHIUM_CODEGEN_MIPS_H_ | 6 #define V8_MIPS_LITHIUM_CODEGEN_MIPS_H_ |
7 | 7 |
8 #include "src/deoptimizer.h" | 8 #include "src/deoptimizer.h" |
9 #include "src/lithium-codegen.h" | 9 #include "src/lithium-codegen.h" |
10 #include "src/mips/lithium-gap-resolver-mips.h" | 10 #include "src/mips/lithium-gap-resolver-mips.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 | 162 |
163 int GetStackSlotCount() const { return chunk()->spill_slot_count(); } | 163 int GetStackSlotCount() const { return chunk()->spill_slot_count(); } |
164 | 164 |
165 void AddDeferredCode(LDeferredCode* code) { deferred_.Add(code, zone()); } | 165 void AddDeferredCode(LDeferredCode* code) { deferred_.Add(code, zone()); } |
166 | 166 |
167 void SaveCallerDoubles(); | 167 void SaveCallerDoubles(); |
168 void RestoreCallerDoubles(); | 168 void RestoreCallerDoubles(); |
169 | 169 |
170 // Code generation passes. Returns true if code generation should | 170 // Code generation passes. Returns true if code generation should |
171 // continue. | 171 // continue. |
172 void GenerateBodyInstructionPre(LInstruction* instr) OVERRIDE; | 172 void GenerateBodyInstructionPre(LInstruction* instr) override; |
173 bool GeneratePrologue(); | 173 bool GeneratePrologue(); |
174 bool GenerateDeferredCode(); | 174 bool GenerateDeferredCode(); |
175 bool GenerateJumpTable(); | 175 bool GenerateJumpTable(); |
176 bool GenerateSafepointTable(); | 176 bool GenerateSafepointTable(); |
177 | 177 |
178 // Generates the custom OSR entrypoint and sets the osr_pc_offset. | 178 // Generates the custom OSR entrypoint and sets the osr_pc_offset. |
179 void GenerateOsrPrologue(); | 179 void GenerateOsrPrologue(); |
180 | 180 |
181 enum SafepointMode { | 181 enum SafepointMode { |
182 RECORD_SIMPLE_SAFEPOINT, | 182 RECORD_SIMPLE_SAFEPOINT, |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 void RecordSafepoint(LPointerMap* pointers, | 256 void RecordSafepoint(LPointerMap* pointers, |
257 Safepoint::Kind kind, | 257 Safepoint::Kind kind, |
258 int arguments, | 258 int arguments, |
259 Safepoint::DeoptMode mode); | 259 Safepoint::DeoptMode mode); |
260 void RecordSafepoint(LPointerMap* pointers, Safepoint::DeoptMode mode); | 260 void RecordSafepoint(LPointerMap* pointers, Safepoint::DeoptMode mode); |
261 void RecordSafepoint(Safepoint::DeoptMode mode); | 261 void RecordSafepoint(Safepoint::DeoptMode mode); |
262 void RecordSafepointWithRegisters(LPointerMap* pointers, | 262 void RecordSafepointWithRegisters(LPointerMap* pointers, |
263 int arguments, | 263 int arguments, |
264 Safepoint::DeoptMode mode); | 264 Safepoint::DeoptMode mode); |
265 | 265 |
266 void RecordAndWritePosition(int position) OVERRIDE; | 266 void RecordAndWritePosition(int position) override; |
267 | 267 |
268 static Condition TokenToCondition(Token::Value op, bool is_unsigned); | 268 static Condition TokenToCondition(Token::Value op, bool is_unsigned); |
269 void EmitGoto(int block); | 269 void EmitGoto(int block); |
270 | 270 |
271 // EmitBranch expects to be the last instruction of a block. | 271 // EmitBranch expects to be the last instruction of a block. |
272 template<class InstrType> | 272 template<class InstrType> |
273 void EmitBranch(InstrType instr, | 273 void EmitBranch(InstrType instr, |
274 Condition condition, | 274 Condition condition, |
275 Register src1, | 275 Register src1, |
276 const Operand& src2); | 276 const Operand& src2); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 // All registers are clobbered. | 338 // All registers are clobbered. |
339 // If 'remainder' is no_reg, it is not computed. | 339 // If 'remainder' is no_reg, it is not computed. |
340 void EmitSignedIntegerDivisionByConstant(Register result, | 340 void EmitSignedIntegerDivisionByConstant(Register result, |
341 Register dividend, | 341 Register dividend, |
342 int32_t divisor, | 342 int32_t divisor, |
343 Register remainder, | 343 Register remainder, |
344 Register scratch, | 344 Register scratch, |
345 LEnvironment* environment); | 345 LEnvironment* environment); |
346 | 346 |
347 | 347 |
348 void EnsureSpaceForLazyDeopt(int space_needed) OVERRIDE; | 348 void EnsureSpaceForLazyDeopt(int space_needed) override; |
349 void DoLoadKeyedExternalArray(LLoadKeyed* instr); | 349 void DoLoadKeyedExternalArray(LLoadKeyed* instr); |
350 void DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr); | 350 void DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr); |
351 void DoLoadKeyedFixedArray(LLoadKeyed* instr); | 351 void DoLoadKeyedFixedArray(LLoadKeyed* instr); |
352 void DoStoreKeyedExternalArray(LStoreKeyed* instr); | 352 void DoStoreKeyedExternalArray(LStoreKeyed* instr); |
353 void DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr); | 353 void DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr); |
354 void DoStoreKeyedFixedArray(LStoreKeyed* instr); | 354 void DoStoreKeyedFixedArray(LStoreKeyed* instr); |
355 | 355 |
356 template <class T> | 356 template <class T> |
357 void EmitVectorLoadICRegisters(T* instr); | 357 void EmitVectorLoadICRegisters(T* instr); |
358 | 358 |
359 ZoneList<LEnvironment*> deoptimizations_; | 359 ZoneList<LEnvironment*> deoptimizations_; |
360 ZoneList<Deoptimizer::JumpTableEntry> jump_table_; | 360 ZoneList<Deoptimizer::JumpTableEntry> jump_table_; |
361 ZoneList<Handle<Object> > deoptimization_literals_; | 361 ZoneList<Handle<Object> > deoptimization_literals_; |
362 int inlined_function_count_; | 362 int inlined_function_count_; |
363 Scope* const scope_; | 363 Scope* const scope_; |
364 TranslationBuffer translations_; | 364 TranslationBuffer translations_; |
365 ZoneList<LDeferredCode*> deferred_; | 365 ZoneList<LDeferredCode*> deferred_; |
366 int osr_pc_offset_; | 366 int osr_pc_offset_; |
367 bool frame_is_built_; | 367 bool frame_is_built_; |
368 | 368 |
369 // Builder that keeps track of safepoints in the code. The table | 369 // Builder that keeps track of safepoints in the code. The table |
370 // itself is emitted at the end of the generated code. | 370 // itself is emitted at the end of the generated code. |
371 SafepointTableBuilder safepoints_; | 371 SafepointTableBuilder safepoints_; |
372 | 372 |
373 // Compiler from a set of parallel moves to a sequential list of moves. | 373 // Compiler from a set of parallel moves to a sequential list of moves. |
374 LGapResolver resolver_; | 374 LGapResolver resolver_; |
375 | 375 |
376 Safepoint::Kind expected_safepoint_kind_; | 376 Safepoint::Kind expected_safepoint_kind_; |
377 | 377 |
378 class PushSafepointRegistersScope FINAL BASE_EMBEDDED { | 378 class PushSafepointRegistersScope final BASE_EMBEDDED { |
379 public: | 379 public: |
380 explicit PushSafepointRegistersScope(LCodeGen* codegen) | 380 explicit PushSafepointRegistersScope(LCodeGen* codegen) |
381 : codegen_(codegen) { | 381 : codegen_(codegen) { |
382 DCHECK(codegen_->info()->is_calling()); | 382 DCHECK(codegen_->info()->is_calling()); |
383 DCHECK(codegen_->expected_safepoint_kind_ == Safepoint::kSimple); | 383 DCHECK(codegen_->expected_safepoint_kind_ == Safepoint::kSimple); |
384 codegen_->expected_safepoint_kind_ = Safepoint::kWithRegisters; | 384 codegen_->expected_safepoint_kind_ = Safepoint::kWithRegisters; |
385 | 385 |
386 StoreRegistersStateStub stub(codegen_->isolate()); | 386 StoreRegistersStateStub stub(codegen_->isolate()); |
387 codegen_->masm_->push(ra); | 387 codegen_->masm_->push(ra); |
388 codegen_->masm_->CallStub(&stub); | 388 codegen_->masm_->CallStub(&stub); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 LCodeGen* codegen_; | 433 LCodeGen* codegen_; |
434 Label entry_; | 434 Label entry_; |
435 Label exit_; | 435 Label exit_; |
436 Label* external_exit_; | 436 Label* external_exit_; |
437 int instruction_index_; | 437 int instruction_index_; |
438 }; | 438 }; |
439 | 439 |
440 } } // namespace v8::internal | 440 } } // namespace v8::internal |
441 | 441 |
442 #endif // V8_MIPS_LITHIUM_CODEGEN_MIPS_H_ | 442 #endif // V8_MIPS_LITHIUM_CODEGEN_MIPS_H_ |
OLD | NEW |