Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1868)

Unified Diff: src/arm64/deoptimizer-arm64.cc

Issue 341863002: ARM64: Give LR to the allocator. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/arm64/deoptimizer-arm64.cc
diff --git a/src/arm64/deoptimizer-arm64.cc b/src/arm64/deoptimizer-arm64.cc
index 7ac5bd0d2d55b0eae80eba021f6e1159420592b0..0624a99917e3c127a353094411669909f785ad88 100644
--- a/src/arm64/deoptimizer-arm64.cc
+++ b/src/arm64/deoptimizer-arm64.cc
@@ -17,7 +17,7 @@ namespace internal {
int Deoptimizer::patch_size() {
// Size of the code used to patch lazy bailout points.
// Patching is done by Deoptimizer::DeoptimizeFunction.
- return 4 * kInstructionSize;
+ return 5 * kInstructionSize;
}
@@ -48,6 +48,7 @@ void Deoptimizer::PatchCodeForDeoptimization(Isolate* isolate, Code* code) {
Address deopt_entry = GetDeoptimizationEntry(isolate, i, LAZY);
PatchingAssembler patcher(call_address, patch_size() / kInstructionSize);
+ patcher.adr(ip1, 0);
patcher.ldr_pcrel(ip0, (2 * kInstructionSize) >> kLoadLiteralScaleLog2);
patcher.blr(ip0);
ulan 2014/06/23 11:17:11 Did you mean br(ip0) here?
jbramley 2014/06/23 17:22:05 Yes! Thank you.
patcher.dc64(reinterpret_cast<intptr_t>(deopt_entry));
@@ -150,6 +151,13 @@ static void CopyRegisterDumpToFrame(MacroAssembler* masm,
#define __ masm()->
void Deoptimizer::EntryGenerator::Generate() {
+ UseScratchRegisterScope temps(masm());
+
+ // The deopt entry jump must put the caller address in ip1. This can be done
+ // either in the level-one deopt table (GenerateDeoptJumpTable), or inline in
+ // the code (DeoptimizeBranch).
+ Register caller_address = temps.Acquire(ip1);
+
GeneratePrologue();
// TODO(all): This code needs to be revisited. We probably only need to save
@@ -161,9 +169,9 @@ void Deoptimizer::EntryGenerator::Generate() {
FPRegister::kAllocatableFPRegisters);
__ PushCPURegList(saved_fp_registers);
- // We save all the registers expcept jssp, sp and lr.
- CPURegList saved_registers(CPURegister::kRegister, kXRegSizeInBits, 0, 27);
- saved_registers.Combine(fp);
+ // We save all allocatable registers plus fp.
+ CPURegList saved_registers(CPURegister::kRegister, kXRegSizeInBits,
+ Register::kAllocatableRegisters | fp.Bit());
__ PushCPURegList(saved_registers);
const int kSavedRegistersAreaSize =
@@ -181,7 +189,7 @@ void Deoptimizer::EntryGenerator::Generate() {
Register fp_to_sp = x4;
// Get the address of the location in the code object. This is the return
// address for lazy deoptimization.
- __ Mov(code_object, lr);
+ __ Mov(code_object, caller_address);
// Compute the fp-to-sp delta, and correct one word for bailout id.
__ Add(fp_to_sp, masm()->StackPointer(),
kSavedRegistersAreaSize + (1 * kPointerSize));
@@ -303,11 +311,8 @@ void Deoptimizer::EntryGenerator::Generate() {
// registers (note that at least fp must be restored though).
// Restore registers from the last output frame.
- // Note that lr is not in the list of saved_registers and will be restored
- // later. We can use it to hold the address of last output frame while
- // reloading the other registers.
- ASSERT(!saved_registers.IncludesAliasOf(lr));
- Register last_output_frame = lr;
+ Register last_output_frame = temps.AcquireX();
+ ASSERT(!saved_registers.IncludesAliasOf(last_output_frame));
__ Mov(last_output_frame, current_frame);
// We don't need to restore x7 as it will be clobbered later to hold the

Powered by Google App Engine
This is Rietveld 408576698