| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #include "src/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
| 6 #include "src/compiler/code-generator-impl.h" | 6 #include "src/compiler/code-generator-impl.h" |
| 7 #include "src/compiler/gap-resolver.h" | 7 #include "src/compiler/gap-resolver.h" |
| 8 #include "src/compiler/node-matchers.h" | 8 #include "src/compiler/node-matchers.h" |
| 9 #include "src/mips/macro-assembler-mips.h" | 9 #include "src/mips/macro-assembler-mips.h" |
| 10 #include "src/scopes.h" | 10 #include "src/scopes.h" |
| (...skipping 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1148 void CodeGenerator::AssemblePrologue() { | 1148 void CodeGenerator::AssemblePrologue() { |
| 1149 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 1149 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
| 1150 int stack_slots = frame()->GetSpillSlotCount(); | 1150 int stack_slots = frame()->GetSpillSlotCount(); |
| 1151 if (descriptor->kind() == CallDescriptor::kCallAddress) { | 1151 if (descriptor->kind() == CallDescriptor::kCallAddress) { |
| 1152 __ Push(ra, fp); | 1152 __ Push(ra, fp); |
| 1153 __ mov(fp, sp); | 1153 __ mov(fp, sp); |
| 1154 | 1154 |
| 1155 const RegList saves = descriptor->CalleeSavedRegisters(); | 1155 const RegList saves = descriptor->CalleeSavedRegisters(); |
| 1156 // Save callee-saved registers. | 1156 // Save callee-saved registers. |
| 1157 __ MultiPush(saves); | 1157 __ MultiPush(saves); |
| 1158 DCHECK(kNumCalleeSaved == base::bits::CountPopulation32(saves)); | 1158 // kNumCalleeSaved includes the fp register, but the fp register |
| 1159 // is saved separately in TF. |
| 1160 DCHECK(kNumCalleeSaved == base::bits::CountPopulation32(saves) + 1); |
| 1159 int register_save_area_size = kNumCalleeSaved * kPointerSize; | 1161 int register_save_area_size = kNumCalleeSaved * kPointerSize; |
| 1160 | 1162 |
| 1161 const RegList saves_fpu = descriptor->CalleeSavedFPRegisters(); | 1163 const RegList saves_fpu = descriptor->CalleeSavedFPRegisters(); |
| 1162 // Save callee-saved FPU registers. | 1164 // Save callee-saved FPU registers. |
| 1163 __ MultiPushFPU(saves_fpu); | 1165 __ MultiPushFPU(saves_fpu); |
| 1164 DCHECK(kNumCalleeSavedFPU == base::bits::CountPopulation32(saves_fpu)); | 1166 DCHECK(kNumCalleeSavedFPU == base::bits::CountPopulation32(saves_fpu)); |
| 1165 register_save_area_size += kNumCalleeSavedFPU * kDoubleSize * kPointerSize; | 1167 register_save_area_size += kNumCalleeSavedFPU * kDoubleSize * kPointerSize; |
| 1166 | 1168 |
| 1167 frame()->SetRegisterSaveAreaSize(register_save_area_size); | 1169 frame()->SetRegisterSaveAreaSize(register_save_area_size); |
| 1168 } else if (descriptor->IsJSFunctionCall()) { | 1170 } else if (descriptor->IsJSFunctionCall()) { |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1441 } | 1443 } |
| 1442 } | 1444 } |
| 1443 } | 1445 } |
| 1444 } | 1446 } |
| 1445 | 1447 |
| 1446 #undef __ | 1448 #undef __ |
| 1447 | 1449 |
| 1448 } // namespace compiler | 1450 } // namespace compiler |
| 1449 } // namespace internal | 1451 } // namespace internal |
| 1450 } // namespace v8 | 1452 } // namespace v8 |
| OLD | NEW |