| 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) OVERRIDE; | 173 void GenerateBodyInstructionPre(LInstruction* instr) override; |
| 174 bool GeneratePrologue(); | 174 bool GeneratePrologue(); |
| 175 bool GenerateDeferredCode(); | 175 bool GenerateDeferredCode(); |
| 176 bool GenerateJumpTable(); | 176 bool GenerateJumpTable(); |
| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 void RecordSafepoint(LPointerMap* pointers, | 257 void RecordSafepoint(LPointerMap* pointers, |
| 258 Safepoint::Kind kind, | 258 Safepoint::Kind kind, |
| 259 int arguments, | 259 int arguments, |
| 260 Safepoint::DeoptMode mode); | 260 Safepoint::DeoptMode mode); |
| 261 void RecordSafepoint(LPointerMap* pointers, Safepoint::DeoptMode mode); | 261 void RecordSafepoint(LPointerMap* pointers, Safepoint::DeoptMode mode); |
| 262 void RecordSafepoint(Safepoint::DeoptMode mode); | 262 void RecordSafepoint(Safepoint::DeoptMode mode); |
| 263 void RecordSafepointWithRegisters(LPointerMap* pointers, | 263 void RecordSafepointWithRegisters(LPointerMap* pointers, |
| 264 int arguments, | 264 int arguments, |
| 265 Safepoint::DeoptMode mode); | 265 Safepoint::DeoptMode mode); |
| 266 | 266 |
| 267 void RecordAndWritePosition(int position) OVERRIDE; | 267 void RecordAndWritePosition(int position) override; |
| 268 | 268 |
| 269 static Condition TokenToCondition(Token::Value op, bool is_unsigned); | 269 static Condition TokenToCondition(Token::Value op, bool is_unsigned); |
| 270 void EmitGoto(int block); | 270 void EmitGoto(int block); |
| 271 | 271 |
| 272 // EmitBranch expects to be the last instruction of a block. | 272 // EmitBranch expects to be the last instruction of a block. |
| 273 template<class InstrType> | 273 template<class InstrType> |
| 274 void EmitBranch(InstrType instr, | 274 void EmitBranch(InstrType instr, |
| 275 Condition condition, | 275 Condition condition, |
| 276 Register src1, | 276 Register src1, |
| 277 const Operand& src2); | 277 const Operand& src2); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 // All registers are clobbered. | 339 // All registers are clobbered. |
| 340 // If 'remainder' is no_reg, it is not computed. | 340 // If 'remainder' is no_reg, it is not computed. |
| 341 void EmitSignedIntegerDivisionByConstant(Register result, | 341 void EmitSignedIntegerDivisionByConstant(Register result, |
| 342 Register dividend, | 342 Register dividend, |
| 343 int32_t divisor, | 343 int32_t divisor, |
| 344 Register remainder, | 344 Register remainder, |
| 345 Register scratch, | 345 Register scratch, |
| 346 LEnvironment* environment); | 346 LEnvironment* environment); |
| 347 | 347 |
| 348 | 348 |
| 349 void EnsureSpaceForLazyDeopt(int space_needed) OVERRIDE; | 349 void EnsureSpaceForLazyDeopt(int space_needed) override; |
| 350 void DoLoadKeyedExternalArray(LLoadKeyed* instr); | 350 void DoLoadKeyedExternalArray(LLoadKeyed* instr); |
| 351 void DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr); | 351 void DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr); |
| 352 void DoLoadKeyedFixedArray(LLoadKeyed* instr); | 352 void DoLoadKeyedFixedArray(LLoadKeyed* instr); |
| 353 void DoStoreKeyedExternalArray(LStoreKeyed* instr); | 353 void DoStoreKeyedExternalArray(LStoreKeyed* instr); |
| 354 void DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr); | 354 void DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr); |
| 355 void DoStoreKeyedFixedArray(LStoreKeyed* instr); | 355 void DoStoreKeyedFixedArray(LStoreKeyed* instr); |
| 356 | 356 |
| 357 template <class T> | 357 template <class T> |
| 358 void EmitVectorLoadICRegisters(T* instr); | 358 void EmitVectorLoadICRegisters(T* instr); |
| 359 | 359 |
| 360 ZoneList<LEnvironment*> deoptimizations_; | 360 ZoneList<LEnvironment*> deoptimizations_; |
| 361 ZoneList<Deoptimizer::JumpTableEntry*> jump_table_; | 361 ZoneList<Deoptimizer::JumpTableEntry*> jump_table_; |
| 362 ZoneList<Handle<Object> > deoptimization_literals_; | 362 ZoneList<Handle<Object> > deoptimization_literals_; |
| 363 int inlined_function_count_; | 363 int inlined_function_count_; |
| 364 Scope* const scope_; | 364 Scope* const scope_; |
| 365 TranslationBuffer translations_; | 365 TranslationBuffer translations_; |
| 366 ZoneList<LDeferredCode*> deferred_; | 366 ZoneList<LDeferredCode*> deferred_; |
| 367 int osr_pc_offset_; | 367 int osr_pc_offset_; |
| 368 bool frame_is_built_; | 368 bool frame_is_built_; |
| 369 | 369 |
| 370 // Builder that keeps track of safepoints in the code. The table | 370 // Builder that keeps track of safepoints in the code. The table |
| 371 // itself is emitted at the end of the generated code. | 371 // itself is emitted at the end of the generated code. |
| 372 SafepointTableBuilder safepoints_; | 372 SafepointTableBuilder safepoints_; |
| 373 | 373 |
| 374 // Compiler from a set of parallel moves to a sequential list of moves. | 374 // Compiler from a set of parallel moves to a sequential list of moves. |
| 375 LGapResolver resolver_; | 375 LGapResolver resolver_; |
| 376 | 376 |
| 377 Safepoint::Kind expected_safepoint_kind_; | 377 Safepoint::Kind expected_safepoint_kind_; |
| 378 | 378 |
| 379 class PushSafepointRegistersScope FINAL BASE_EMBEDDED { | 379 class PushSafepointRegistersScope final BASE_EMBEDDED { |
| 380 public: | 380 public: |
| 381 explicit PushSafepointRegistersScope(LCodeGen* codegen) | 381 explicit PushSafepointRegistersScope(LCodeGen* codegen) |
| 382 : codegen_(codegen) { | 382 : codegen_(codegen) { |
| 383 DCHECK(codegen_->info()->is_calling()); | 383 DCHECK(codegen_->info()->is_calling()); |
| 384 DCHECK(codegen_->expected_safepoint_kind_ == Safepoint::kSimple); | 384 DCHECK(codegen_->expected_safepoint_kind_ == Safepoint::kSimple); |
| 385 codegen_->expected_safepoint_kind_ = Safepoint::kWithRegisters; | 385 codegen_->expected_safepoint_kind_ = Safepoint::kWithRegisters; |
| 386 | 386 |
| 387 StoreRegistersStateStub stub(codegen_->isolate()); | 387 StoreRegistersStateStub stub(codegen_->isolate()); |
| 388 codegen_->masm_->push(ra); | 388 codegen_->masm_->push(ra); |
| 389 codegen_->masm_->CallStub(&stub); | 389 codegen_->masm_->CallStub(&stub); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 LCodeGen* codegen_; | 434 LCodeGen* codegen_; |
| 435 Label entry_; | 435 Label entry_; |
| 436 Label exit_; | 436 Label exit_; |
| 437 Label* external_exit_; | 437 Label* external_exit_; |
| 438 int instruction_index_; | 438 int instruction_index_; |
| 439 }; | 439 }; |
| 440 | 440 |
| 441 } } // namespace v8::internal | 441 } } // namespace v8::internal |
| 442 | 442 |
| 443 #endif // V8_MIPS_LITHIUM_CODEGEN_MIPS_H_ | 443 #endif // V8_MIPS_LITHIUM_CODEGEN_MIPS_H_ |
| OLD | NEW |