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

Unified Diff: src/compiler/arm64/code-generator-arm64.cc

Issue 1191513003: [turbofan] Add CalleeSavedFPRegisters to CallDescriptor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased on bleeding_edge (af4c4b04). Created 5 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
« no previous file with comments | « src/compiler/arm/linkage-arm.cc ('k') | src/compiler/arm64/linkage-arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/arm64/code-generator-arm64.cc
diff --git a/src/compiler/arm64/code-generator-arm64.cc b/src/compiler/arm64/code-generator-arm64.cc
index 8692732112708148b11c9d2824ef67ddf58f7435..fa5743ab8e4d38865959b139b880d58c9801bf08 100644
--- a/src/compiler/arm64/code-generator-arm64.cc
+++ b/src/compiler/arm64/code-generator-arm64.cc
@@ -1094,9 +1094,23 @@ void CodeGenerator::AssemblePrologue() {
__ SetStackPointer(csp);
__ Push(lr, fp);
__ Mov(fp, csp);
- // TODO(dcarney): correct callee saved registers.
- __ PushCalleeSavedRegisters();
- frame()->SetRegisterSaveAreaSize(20 * kPointerSize);
+
+ // Save FP registers.
+ CPURegList saves_fp = CPURegList(CPURegister::kFPRegister, kDRegSizeInBits,
+ descriptor->CalleeSavedFPRegisters());
+ DCHECK(saves_fp.list() == CPURegList::GetCalleeSavedFP().list());
+ int saved_count = saves_fp.Count();
+ __ PushCPURegList(saves_fp);
+ // Save registers.
+ CPURegList saves = CPURegList(CPURegister::kRegister, kXRegSizeInBits,
+ descriptor->CalleeSavedRegisters());
+ // TODO(palfia): TF save list is not in sync with
+ // CPURegList::GetCalleeSaved(): x30 is missing.
jbramley 2015/06/29 13:53:09 x30 (lr) is caller-saved in the procedure-call sta
akos.palfi.imgtec 2015/06/30 12:31:49 Acknowledged.
+ // DCHECK(saves.list() == CPURegList::GetCalleeSaved().list());
+ saved_count += saves.Count();
+ __ PushCPURegList(saves);
+
+ frame()->SetRegisterSaveAreaSize(saved_count * kPointerSize);
} else if (descriptor->IsJSFunctionCall()) {
CompilationInfo* info = this->info();
__ SetStackPointer(jssp);
@@ -1145,10 +1159,18 @@ void CodeGenerator::AssembleReturn() {
if (stack_slots > 0) {
__ Add(csp, csp, AlignedStackSlots(stack_slots) * kPointerSize);
}
+
// Restore registers.
- // TODO(dcarney): correct callee saved registers.
- __ PopCalleeSavedRegisters();
+ CPURegList saves = CPURegList(CPURegister::kRegister, kXRegSizeInBits,
+ descriptor->CalleeSavedRegisters());
+ __ PopCPURegList(saves);
+
+ CPURegList saves_fp =
+ CPURegList(CPURegister::kFPRegister, kDRegSizeInBits,
+ descriptor->CalleeSavedFPRegisters());
+ __ PopCPURegList(saves_fp);
}
+
__ Mov(csp, fp);
__ Pop(fp, lr);
__ Ret();
« no previous file with comments | « src/compiler/arm/linkage-arm.cc ('k') | src/compiler/arm64/linkage-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698