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 {
CPURegister::RegisterType type_;
bool IsValid() const {
if ((type_ == CPURegister::kRegister) ||
(type_ == CPURegister::kFPRegister)) {
bool is_valid = true;
// Try to create a CPURegister for each element in the list.
for (int i = 0; i < kRegListSizeInBits; i++) {
if (((list_ >> i) & 1) != 0) {
is_valid &= CPURegister::Create(i, size_, type_).IsValid();
}
}
return is_valid;
} else if (type_ == CPURegister::kNoRegister) {
// The kNoRegister type is valid only for empty lists.
// We can't use IsEmpty here because that asserts IsValid().
return list_ == 0;
} else {
return false;
const RegList kValidRegisters = 0x8000000ffffffff;
const RegList kValidFPRegisters = 0x0000000ffffffff;
switch (type_) {
case CPURegister::kRegister:
return (list_ & kValidRegisters) == list_;
case CPURegister::kFPRegister:
return (list_ & kValidFPRegisters) == list_;
case CPURegister::kNoRegister:
return list_ == 0;
default:
UNREACHABLE();
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