OLD | NEW |
---|---|
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
370 | 370 |
371 class PushSafepointRegistersScope BASE_EMBEDDED { | 371 class PushSafepointRegistersScope BASE_EMBEDDED { |
372 public: | 372 public: |
373 PushSafepointRegistersScope(LCodeGen* codegen, | 373 PushSafepointRegistersScope(LCodeGen* codegen, |
374 Safepoint::Kind kind) | 374 Safepoint::Kind kind) |
375 : codegen_(codegen) { | 375 : codegen_(codegen) { |
376 ASSERT(codegen_->info()->is_calling()); | 376 ASSERT(codegen_->info()->is_calling()); |
377 ASSERT(codegen_->expected_safepoint_kind_ == Safepoint::kSimple); | 377 ASSERT(codegen_->expected_safepoint_kind_ == Safepoint::kSimple); |
378 codegen_->expected_safepoint_kind_ = kind; | 378 codegen_->expected_safepoint_kind_ = kind; |
379 | 379 |
380 UseScratchRegisterScope temps(codegen_->masm_); | |
381 // Preserve the value of lr which must be saved on the stack (the call to | |
382 // the stub will clobber it). | |
383 Register to_be_pushed_lr = | |
384 temps.Acquire(StoreRegistersStateStub::to_be_pushed_lr()); | |
385 codegen_->masm_->Mov(to_be_pushed_lr, lr); | |
ulan
2014/03/24 11:09:25
to_be_pushed_lr is ip0, how do we guarantee that t
vincent.belliard
2014/03/24 11:16:59
This register is reserved by the UseScratchRegiste
ulan
2014/03/24 11:31:26
Right, and what if the ip0 is not available in the
vincent.belliard
2014/03/24 11:43:28
In debug, Acquire checks that the register is avai
ulan
2014/03/24 12:23:51
OK, thank you for explanation. I went through the
vincent.belliard
2014/03/24 16:03:52
done
| |
380 switch (codegen_->expected_safepoint_kind_) { | 386 switch (codegen_->expected_safepoint_kind_) { |
381 case Safepoint::kWithRegisters: | 387 case Safepoint::kWithRegisters: { |
382 codegen_->masm_->PushSafepointRegisters(); | 388 StoreRegistersStateStub stub(kDontSaveFPRegs); |
389 codegen_->masm_->CallStub(&stub); | |
383 break; | 390 break; |
384 case Safepoint::kWithRegistersAndDoubles: | 391 } |
385 codegen_->masm_->PushSafepointRegisters(); | 392 case Safepoint::kWithRegistersAndDoubles: { |
386 codegen_->masm_->PushSafepointFPRegisters(); | 393 StoreRegistersStateStub stub(kSaveFPRegs); |
394 codegen_->masm_->CallStub(&stub); | |
387 break; | 395 break; |
396 } | |
388 default: | 397 default: |
389 UNREACHABLE(); | 398 UNREACHABLE(); |
390 } | 399 } |
391 } | 400 } |
392 | 401 |
393 ~PushSafepointRegistersScope() { | 402 ~PushSafepointRegistersScope() { |
394 Safepoint::Kind kind = codegen_->expected_safepoint_kind_; | 403 Safepoint::Kind kind = codegen_->expected_safepoint_kind_; |
395 ASSERT((kind & Safepoint::kWithRegisters) != 0); | 404 ASSERT((kind & Safepoint::kWithRegisters) != 0); |
396 switch (kind) { | 405 switch (kind) { |
397 case Safepoint::kWithRegisters: | 406 case Safepoint::kWithRegisters: { |
398 codegen_->masm_->PopSafepointRegisters(); | 407 RestoreRegistersStateStub stub(kDontSaveFPRegs); |
408 codegen_->masm_->CallStub(&stub); | |
399 break; | 409 break; |
400 case Safepoint::kWithRegistersAndDoubles: | 410 } |
401 codegen_->masm_->PopSafepointFPRegisters(); | 411 case Safepoint::kWithRegistersAndDoubles: { |
402 codegen_->masm_->PopSafepointRegisters(); | 412 RestoreRegistersStateStub stub(kSaveFPRegs); |
413 codegen_->masm_->CallStub(&stub); | |
403 break; | 414 break; |
415 } | |
404 default: | 416 default: |
405 UNREACHABLE(); | 417 UNREACHABLE(); |
406 } | 418 } |
407 codegen_->expected_safepoint_kind_ = Safepoint::kSimple; | 419 codegen_->expected_safepoint_kind_ = Safepoint::kSimple; |
408 } | 420 } |
409 | 421 |
410 private: | 422 private: |
411 LCodeGen* codegen_; | 423 LCodeGen* codegen_; |
412 }; | 424 }; |
413 | 425 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
467 | 479 |
468 protected: | 480 protected: |
469 MacroAssembler* masm() const { return codegen_->masm(); } | 481 MacroAssembler* masm() const { return codegen_->masm(); } |
470 | 482 |
471 LCodeGen* codegen_; | 483 LCodeGen* codegen_; |
472 }; | 484 }; |
473 | 485 |
474 } } // namespace v8::internal | 486 } } // namespace v8::internal |
475 | 487 |
476 #endif // V8_ARM64_LITHIUM_CODEGEN_ARM64_H_ | 488 #endif // V8_ARM64_LITHIUM_CODEGEN_ARM64_H_ |
OLD | NEW |