| 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/mips64/lithium-gap-resolver-mips64.h" | 10 #include "src/mips64/lithium-gap-resolver-mips64.h" |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 | 163 |
| 164 int GetStackSlotCount() const { return chunk()->spill_slot_count(); } | 164 int GetStackSlotCount() const { return chunk()->spill_slot_count(); } |
| 165 | 165 |
| 166 void AddDeferredCode(LDeferredCode* code) { deferred_.Add(code, zone()); } | 166 void AddDeferredCode(LDeferredCode* code) { deferred_.Add(code, zone()); } |
| 167 | 167 |
| 168 void SaveCallerDoubles(); | 168 void SaveCallerDoubles(); |
| 169 void RestoreCallerDoubles(); | 169 void RestoreCallerDoubles(); |
| 170 | 170 |
| 171 // Code generation passes. Returns true if code generation should | 171 // Code generation passes. Returns true if code generation should |
| 172 // continue. | 172 // continue. |
| 173 void GenerateBodyInstructionPre(LInstruction* instr) V8_OVERRIDE; | 173 void GenerateBodyInstructionPre(LInstruction* instr) OVERRIDE; |
| 174 bool GeneratePrologue(); | 174 bool GeneratePrologue(); |
| 175 bool GenerateDeferredCode(); | 175 bool GenerateDeferredCode(); |
| 176 bool GenerateDeoptJumpTable(); | 176 bool GenerateDeoptJumpTable(); |
| 177 bool GenerateSafepointTable(); | 177 bool GenerateSafepointTable(); |
| 178 | 178 |
| 179 // Generates the custom OSR entrypoint and sets the osr_pc_offset. | 179 // Generates the custom OSR entrypoint and sets the osr_pc_offset. |
| 180 void GenerateOsrPrologue(); | 180 void GenerateOsrPrologue(); |
| 181 | 181 |
| 182 enum SafepointMode { | 182 enum SafepointMode { |
| 183 RECORD_SIMPLE_SAFEPOINT, | 183 RECORD_SIMPLE_SAFEPOINT, |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 void RecordSafepoint(LPointerMap* pointers, | 264 void RecordSafepoint(LPointerMap* pointers, |
| 265 Safepoint::Kind kind, | 265 Safepoint::Kind kind, |
| 266 int arguments, | 266 int arguments, |
| 267 Safepoint::DeoptMode mode); | 267 Safepoint::DeoptMode mode); |
| 268 void RecordSafepoint(LPointerMap* pointers, Safepoint::DeoptMode mode); | 268 void RecordSafepoint(LPointerMap* pointers, Safepoint::DeoptMode mode); |
| 269 void RecordSafepoint(Safepoint::DeoptMode mode); | 269 void RecordSafepoint(Safepoint::DeoptMode mode); |
| 270 void RecordSafepointWithRegisters(LPointerMap* pointers, | 270 void RecordSafepointWithRegisters(LPointerMap* pointers, |
| 271 int arguments, | 271 int arguments, |
| 272 Safepoint::DeoptMode mode); | 272 Safepoint::DeoptMode mode); |
| 273 | 273 |
| 274 void RecordAndWritePosition(int position) V8_OVERRIDE; | 274 void RecordAndWritePosition(int position) OVERRIDE; |
| 275 | 275 |
| 276 static Condition TokenToCondition(Token::Value op, bool is_unsigned); | 276 static Condition TokenToCondition(Token::Value op, bool is_unsigned); |
| 277 void EmitGoto(int block); | 277 void EmitGoto(int block); |
| 278 | 278 |
| 279 // EmitBranch expects to be the last instruction of a block. | 279 // EmitBranch expects to be the last instruction of a block. |
| 280 template<class InstrType> | 280 template<class InstrType> |
| 281 void EmitBranch(InstrType instr, | 281 void EmitBranch(InstrType instr, |
| 282 Condition condition, | 282 Condition condition, |
| 283 Register src1, | 283 Register src1, |
| 284 const Operand& src2); | 284 const Operand& src2); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 // All registers are clobbered. | 350 // All registers are clobbered. |
| 351 // If 'remainder' is no_reg, it is not computed. | 351 // If 'remainder' is no_reg, it is not computed. |
| 352 void EmitSignedIntegerDivisionByConstant(Register result, | 352 void EmitSignedIntegerDivisionByConstant(Register result, |
| 353 Register dividend, | 353 Register dividend, |
| 354 int32_t divisor, | 354 int32_t divisor, |
| 355 Register remainder, | 355 Register remainder, |
| 356 Register scratch, | 356 Register scratch, |
| 357 LEnvironment* environment); | 357 LEnvironment* environment); |
| 358 | 358 |
| 359 | 359 |
| 360 void EnsureSpaceForLazyDeopt(int space_needed) V8_OVERRIDE; | 360 void EnsureSpaceForLazyDeopt(int space_needed) OVERRIDE; |
| 361 void DoLoadKeyedExternalArray(LLoadKeyed* instr); | 361 void DoLoadKeyedExternalArray(LLoadKeyed* instr); |
| 362 void DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr); | 362 void DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr); |
| 363 void DoLoadKeyedFixedArray(LLoadKeyed* instr); | 363 void DoLoadKeyedFixedArray(LLoadKeyed* instr); |
| 364 void DoStoreKeyedExternalArray(LStoreKeyed* instr); | 364 void DoStoreKeyedExternalArray(LStoreKeyed* instr); |
| 365 void DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr); | 365 void DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr); |
| 366 void DoStoreKeyedFixedArray(LStoreKeyed* instr); | 366 void DoStoreKeyedFixedArray(LStoreKeyed* instr); |
| 367 | 367 |
| 368 template <class T> | 368 template <class T> |
| 369 void EmitVectorLoadICRegisters(T* instr); | 369 void EmitVectorLoadICRegisters(T* instr); |
| 370 | 370 |
| 371 ZoneList<LEnvironment*> deoptimizations_; | 371 ZoneList<LEnvironment*> deoptimizations_; |
| 372 ZoneList<Deoptimizer::JumpTableEntry> deopt_jump_table_; | 372 ZoneList<Deoptimizer::JumpTableEntry> deopt_jump_table_; |
| 373 ZoneList<Handle<Object> > deoptimization_literals_; | 373 ZoneList<Handle<Object> > deoptimization_literals_; |
| 374 int inlined_function_count_; | 374 int inlined_function_count_; |
| 375 Scope* const scope_; | 375 Scope* const scope_; |
| 376 TranslationBuffer translations_; | 376 TranslationBuffer translations_; |
| 377 ZoneList<LDeferredCode*> deferred_; | 377 ZoneList<LDeferredCode*> deferred_; |
| 378 int osr_pc_offset_; | 378 int osr_pc_offset_; |
| 379 bool frame_is_built_; | 379 bool frame_is_built_; |
| 380 | 380 |
| 381 // Builder that keeps track of safepoints in the code. The table | 381 // Builder that keeps track of safepoints in the code. The table |
| 382 // itself is emitted at the end of the generated code. | 382 // itself is emitted at the end of the generated code. |
| 383 SafepointTableBuilder safepoints_; | 383 SafepointTableBuilder safepoints_; |
| 384 | 384 |
| 385 // Compiler from a set of parallel moves to a sequential list of moves. | 385 // Compiler from a set of parallel moves to a sequential list of moves. |
| 386 LGapResolver resolver_; | 386 LGapResolver resolver_; |
| 387 | 387 |
| 388 Safepoint::Kind expected_safepoint_kind_; | 388 Safepoint::Kind expected_safepoint_kind_; |
| 389 | 389 |
| 390 class PushSafepointRegistersScope V8_FINAL BASE_EMBEDDED { | 390 class PushSafepointRegistersScope FINAL BASE_EMBEDDED { |
| 391 public: | 391 public: |
| 392 explicit PushSafepointRegistersScope(LCodeGen* codegen) | 392 explicit PushSafepointRegistersScope(LCodeGen* codegen) |
| 393 : codegen_(codegen) { | 393 : codegen_(codegen) { |
| 394 DCHECK(codegen_->info()->is_calling()); | 394 DCHECK(codegen_->info()->is_calling()); |
| 395 DCHECK(codegen_->expected_safepoint_kind_ == Safepoint::kSimple); | 395 DCHECK(codegen_->expected_safepoint_kind_ == Safepoint::kSimple); |
| 396 codegen_->expected_safepoint_kind_ = Safepoint::kWithRegisters; | 396 codegen_->expected_safepoint_kind_ = Safepoint::kWithRegisters; |
| 397 | 397 |
| 398 StoreRegistersStateStub stub(codegen_->isolate()); | 398 StoreRegistersStateStub stub(codegen_->isolate()); |
| 399 codegen_->masm_->push(ra); | 399 codegen_->masm_->push(ra); |
| 400 codegen_->masm_->CallStub(&stub); | 400 codegen_->masm_->CallStub(&stub); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 LCodeGen* codegen_; | 445 LCodeGen* codegen_; |
| 446 Label entry_; | 446 Label entry_; |
| 447 Label exit_; | 447 Label exit_; |
| 448 Label* external_exit_; | 448 Label* external_exit_; |
| 449 int instruction_index_; | 449 int instruction_index_; |
| 450 }; | 450 }; |
| 451 | 451 |
| 452 } } // namespace v8::internal | 452 } } // namespace v8::internal |
| 453 | 453 |
| 454 #endif // V8_MIPS_LITHIUM_CODEGEN_MIPS_H_ | 454 #endif // V8_MIPS_LITHIUM_CODEGEN_MIPS_H_ |
| OLD | NEW |