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

Unified Diff: src/compiler/mips64/code-generator-mips64.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
Index: src/compiler/mips64/code-generator-mips64.cc
diff --git a/src/compiler/mips64/code-generator-mips64.cc b/src/compiler/mips64/code-generator-mips64.cc
index 74adbf4d2eec1bc232a513adf014affc9c429219..cb465f2d3ed6b069837f9d05074a66f06f711f11 100644
--- a/src/compiler/mips64/code-generator-mips64.cc
+++ b/src/compiler/mips64/code-generator-mips64.cc
@@ -1151,17 +1151,20 @@ void CodeGenerator::AssemblePrologue() {
if (descriptor->kind() == CallDescriptor::kCallAddress) {
__ Push(ra, fp);
__ mov(fp, sp);
+
const RegList saves = descriptor->CalleeSavedRegisters();
- if (saves != 0) { // Save callee-saved registers.
- // TODO(plind): make callee save size const, possibly DCHECK it.
- int register_save_area_size = 0;
- for (int i = Register::kNumRegisters - 1; i >= 0; i--) {
- if (!((1 << i) & saves)) continue;
- register_save_area_size += kPointerSize;
- }
- frame()->SetRegisterSaveAreaSize(register_save_area_size);
- __ MultiPush(saves);
- }
+ // Save callee-saved registers.
+ __ MultiPush(saves);
+ DCHECK(kNumCalleeSaved == base::bits::CountPopulation32(saves));
+ int register_save_area_size = kNumCalleeSaved * kPointerSize;
+
+ const RegList saves_fpu = descriptor->CalleeSavedFPRegisters();
+ // Save callee-saved FPU registers.
+ __ MultiPushFPU(saves_fpu);
+ DCHECK(kNumCalleeSavedFPU == base::bits::CountPopulation32(saves_fpu));
+ register_save_area_size += kNumCalleeSavedFPU * kDoubleSize * kPointerSize;
+
+ frame()->SetRegisterSaveAreaSize(register_save_area_size);
} else if (descriptor->IsJSFunctionCall()) {
CompilationInfo* info = this->info();
__ Prologue(info->IsCodePreAgingActive());
@@ -1204,11 +1207,13 @@ void CodeGenerator::AssembleReturn() {
if (stack_slots > 0) {
__ Daddu(sp, sp, Operand(stack_slots * kPointerSize));
}
- // Restore registers.
+ // Restore FPU registers.
+ const RegList saves_fpu = descriptor->CalleeSavedFPRegisters();
+ __ MultiPopFPU(saves_fpu);
+
+ // Restore GP registers.
const RegList saves = descriptor->CalleeSavedRegisters();
- if (saves != 0) {
- __ MultiPop(saves);
- }
+ __ MultiPop(saves);
}
__ mov(sp, fp);
__ Pop(ra, fp);

Powered by Google App Engine
This is Rietveld 408576698