ARM64: Optimize RegList::IsValid() to speed up simulation in (opt)debug mode.

On my machine this improves the simulation speed noticeably.
| test               | base  | patched |
|--------------------|-------|---------|
| optdebug           | 15:37 | 11:07   |
| debug --quickcheck | 33:53 | 26:14   |

R=ulan@chromium.org

Review URL: https://codereview.chromium.org/209353010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20232 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 09753b4a
...@@ -588,22 +588,18 @@ class CPURegList { ...@@ -588,22 +588,18 @@ class CPURegList {
CPURegister::RegisterType type_; CPURegister::RegisterType type_;
bool IsValid() const { bool IsValid() const {
if ((type_ == CPURegister::kRegister) || const RegList kValidRegisters = 0x8000000ffffffff;
(type_ == CPURegister::kFPRegister)) { const RegList kValidFPRegisters = 0x0000000ffffffff;
bool is_valid = true; switch (type_) {
// Try to create a CPURegister for each element in the list. case CPURegister::kRegister:
for (int i = 0; i < kRegListSizeInBits; i++) { return (list_ & kValidRegisters) == list_;
if (((list_ >> i) & 1) != 0) { case CPURegister::kFPRegister:
is_valid &= CPURegister::Create(i, size_, type_).IsValid(); return (list_ & kValidFPRegisters) == list_;
} case CPURegister::kNoRegister:
} return list_ == 0;
return is_valid; default:
} else if (type_ == CPURegister::kNoRegister) { UNREACHABLE();
// The kNoRegister type is valid only for empty lists. return false;
// We can't use IsEmpty here because that asserts IsValid().
return list_ == 0;
} else {
return false;
} }
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment