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 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1075 void CodeGenerator::AssemblePrologue() { | 1075 void CodeGenerator::AssemblePrologue() { |
1076 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 1076 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
1077 int stack_slots = frame()->GetSpillSlotCount(); | 1077 int stack_slots = frame()->GetSpillSlotCount(); |
1078 if (descriptor->kind() == CallDescriptor::kCallAddress) { | 1078 if (descriptor->kind() == CallDescriptor::kCallAddress) { |
1079 __ Push(ra, fp); | 1079 __ Push(ra, fp); |
1080 __ mov(fp, sp); | 1080 __ mov(fp, sp); |
1081 | 1081 |
1082 const RegList saves = descriptor->CalleeSavedRegisters(); | 1082 const RegList saves = descriptor->CalleeSavedRegisters(); |
1083 // Save callee-saved registers. | 1083 // Save callee-saved registers. |
1084 __ MultiPush(saves); | 1084 __ MultiPush(saves); |
1085 DCHECK(kNumCalleeSaved == base::bits::CountPopulation32(saves)); | 1085 // kNumCalleeSaved includes the fp register, but the fp register |
| 1086 // is saved separately in TF. |
| 1087 DCHECK(kNumCalleeSaved == base::bits::CountPopulation32(saves) + 1); |
1086 int register_save_area_size = kNumCalleeSaved * kPointerSize; | 1088 int register_save_area_size = kNumCalleeSaved * kPointerSize; |
1087 | 1089 |
1088 const RegList saves_fpu = descriptor->CalleeSavedFPRegisters(); | 1090 const RegList saves_fpu = descriptor->CalleeSavedFPRegisters(); |
1089 // Save callee-saved FPU registers. | 1091 // Save callee-saved FPU registers. |
1090 __ MultiPushFPU(saves_fpu); | 1092 __ MultiPushFPU(saves_fpu); |
1091 DCHECK(kNumCalleeSavedFPU == base::bits::CountPopulation32(saves_fpu)); | 1093 DCHECK(kNumCalleeSavedFPU == base::bits::CountPopulation32(saves_fpu)); |
1092 register_save_area_size += kNumCalleeSavedFPU * kDoubleSize * kPointerSize; | 1094 register_save_area_size += kNumCalleeSavedFPU * kDoubleSize * kPointerSize; |
1093 | 1095 |
1094 frame()->SetRegisterSaveAreaSize(register_save_area_size); | 1096 frame()->SetRegisterSaveAreaSize(register_save_area_size); |
1095 } else if (descriptor->IsJSFunctionCall()) { | 1097 } else if (descriptor->IsJSFunctionCall()) { |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1368 } | 1370 } |
1369 } | 1371 } |
1370 } | 1372 } |
1371 } | 1373 } |
1372 | 1374 |
1373 #undef __ | 1375 #undef __ |
1374 | 1376 |
1375 } // namespace compiler | 1377 } // namespace compiler |
1376 } // namespace internal | 1378 } // namespace internal |
1377 } // namespace v8 | 1379 } // namespace v8 |
OLD | NEW |