diff options
author | Vladimir Marko <vmarko@google.com> | 2014-05-02 11:53:22 +0100 |
---|---|---|
committer | Vladimir Marko <vmarko@google.com> | 2014-05-02 12:21:02 +0100 |
commit | 8194963098247be6bca9cc4a54dbfa65c73e8ccc (patch) | |
tree | 547cc708e06e6541676b17066023ae6f07b2049b /runtime/runtime.cc | |
parent | 56a341a82ece9aa4f2a071629f3e1fd1adf988ae (diff) | |
download | art-8194963098247be6bca9cc4a54dbfa65c73e8ccc.tar.gz art-8194963098247be6bca9cc4a54dbfa65c73e8ccc.tar.bz2 art-8194963098247be6bca9cc4a54dbfa65c73e8ccc.zip |
Replace CountOneBits and __builtin_popcount with POPCOUNT.
Clean up utils.h, make some functions constexpr.
Change-Id: I2399100280cbce81c3c4f5765f0680c1ddcb5883
Diffstat (limited to 'runtime/runtime.cc')
-rw-r--r-- | runtime/runtime.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc index 20df78eef1..fbc0460bb7 100644 --- a/runtime/runtime.cc +++ b/runtime/runtime.cc @@ -1010,8 +1010,8 @@ mirror::ArtMethod* Runtime::CreateCalleeSaveMethod(InstructionSet instruction_se (1 << art::arm::S27) | (1 << art::arm::S28) | (1 << art::arm::S29) | (1 << art::arm::S30) | (1 << art::arm::S31); uint32_t fp_spills = type == kSaveAll ? fp_all_spills : 0; - size_t frame_size = RoundUp((__builtin_popcount(core_spills) /* gprs */ + - __builtin_popcount(fp_spills) /* fprs */ + + size_t frame_size = RoundUp((POPCOUNT(core_spills) /* gprs */ + + POPCOUNT(fp_spills) /* fprs */ + 1 /* Method* */) * kArmPointerSize, kStackAlignment); method->SetFrameSizeInBytes(frame_size); method->SetCoreSpillMask(core_spills); @@ -1024,7 +1024,7 @@ mirror::ArtMethod* Runtime::CreateCalleeSaveMethod(InstructionSet instruction_se uint32_t all_spills = (1 << art::mips::S0) | (1 << art::mips::S1); uint32_t core_spills = ref_spills | (type == kRefsAndArgs ? arg_spills : 0) | (type == kSaveAll ? all_spills : 0) | (1 << art::mips::RA); - size_t frame_size = RoundUp((__builtin_popcount(core_spills) /* gprs */ + + size_t frame_size = RoundUp((POPCOUNT(core_spills) /* gprs */ + (type == kRefsAndArgs ? 0 : 3) + 1 /* Method* */) * kMipsPointerSize, kStackAlignment); method->SetFrameSizeInBytes(frame_size); @@ -1035,7 +1035,7 @@ mirror::ArtMethod* Runtime::CreateCalleeSaveMethod(InstructionSet instruction_se uint32_t arg_spills = (1 << art::x86::ECX) | (1 << art::x86::EDX) | (1 << art::x86::EBX); uint32_t core_spills = ref_spills | (type == kRefsAndArgs ? arg_spills : 0) | (1 << art::x86::kNumberOfCpuRegisters); // fake return address callee save - size_t frame_size = RoundUp((__builtin_popcount(core_spills) /* gprs */ + + size_t frame_size = RoundUp((POPCOUNT(core_spills) /* gprs */ + 1 /* Method* */) * kX86PointerSize, kStackAlignment); method->SetFrameSizeInBytes(frame_size); method->SetCoreSpillMask(core_spills); @@ -1054,8 +1054,8 @@ mirror::ArtMethod* Runtime::CreateCalleeSaveMethod(InstructionSet instruction_se (1 << art::x86_64::XMM3) | (1 << art::x86_64::XMM4) | (1 << art::x86_64::XMM5) | (1 << art::x86_64::XMM6) | (1 << art::x86_64::XMM7); uint32_t fp_spills = (type == kRefsAndArgs ? fp_arg_spills : 0); - size_t frame_size = RoundUp((__builtin_popcount(core_spills) /* gprs */ + - __builtin_popcount(fp_spills) /* fprs */ + + size_t frame_size = RoundUp((POPCOUNT(core_spills) /* gprs */ + + POPCOUNT(fp_spills) /* fprs */ + 1 /* Method* */) * kX86_64PointerSize, kStackAlignment); method->SetFrameSizeInBytes(frame_size); method->SetCoreSpillMask(core_spills); @@ -1094,8 +1094,8 @@ mirror::ArtMethod* Runtime::CreateCalleeSaveMethod(InstructionSet instruction_se (1 << art::arm64::D31); uint32_t fp_spills = fp_ref_spills | (type == kRefsAndArgs ? fp_arg_spills: 0) | (type == kSaveAll ? fp_all_spills : 0); - size_t frame_size = RoundUp((__builtin_popcount(core_spills) /* gprs */ + - __builtin_popcount(fp_spills) /* fprs */ + + size_t frame_size = RoundUp((POPCOUNT(core_spills) /* gprs */ + + POPCOUNT(fp_spills) /* fprs */ + 1 /* Method* */) * kArm64PointerSize, kStackAlignment); method->SetFrameSizeInBytes(frame_size); method->SetCoreSpillMask(core_spills); |