| Index: src/compiler/x64/code-generator-x64.cc
|
| diff --git a/src/compiler/x64/code-generator-x64.cc b/src/compiler/x64/code-generator-x64.cc
|
| index 5dd41428ef0a605f73c4f575e1dca6dc2ebf9018..4dc75592ec2b189a5581a5ce1f89399cd40a02b2 100644
|
| --- a/src/compiler/x64/code-generator-x64.cc
|
| +++ b/src/compiler/x64/code-generator-x64.cc
|
| @@ -2124,15 +2124,22 @@
|
| CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
|
|
|
| const RegList saves_fp = descriptor->CalleeSavedFPRegisters();
|
| - if (saves_fp != 0) { // Save callee-saved XMM registers.
|
| - frame->AlignFrame();
|
| - uint32_t count = base::bits::CountPopulation32(saves_fp);
|
| - frame->AllocateSavedCalleeRegisterSlots(count *
|
| - (kQuadWordSize / kPointerSize));
|
| + if (saves_fp != 0) {
|
| + frame->AlignSavedCalleeRegisterSlots();
|
| + if (saves_fp != 0) { // Save callee-saved XMM registers.
|
| + const uint32_t saves_fp_count = base::bits::CountPopulation32(saves_fp);
|
| + frame->AllocateSavedCalleeRegisterSlots(saves_fp_count *
|
| + (kQuadWordSize / kPointerSize));
|
| + }
|
| }
|
| const RegList saves = descriptor->CalleeSavedRegisters();
|
| if (saves != 0) { // Save callee-saved registers.
|
| - uint32_t count = base::bits::CountPopulation32(saves);
|
| + int count = 0;
|
| + for (int i = Register::kNumRegisters - 1; i >= 0; i--) {
|
| + if (((1 << i) & saves)) {
|
| + ++count;
|
| + }
|
| + }
|
| frame->AllocateSavedCalleeRegisterSlots(count);
|
| }
|
| }
|
|
|