Commit 681bf59c authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[liftoff] Use LiftoffRegList::MaskOut more consistently

The {MaskOut} operation is faster than using {operator~}, since
{operator~} needs to ensure to return a valid register list, so it
contains an additional AND operation with the mask of all registers.
Hence use {MaskOut} more consistently, and remove the now unused
{operator~} on {LiftoffRegList}.

R=ahaas@chromium.org

Bug: v8:6600
Change-Id: Icf072e564c4e391cafa2abeeba53cf275cee75f8
Reviewed-on: https://chromium-review.googlesource.com/c/1275810Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56560}
parent e0c882e2
...@@ -127,7 +127,7 @@ class LiftoffAssembler : public TurboAssembler { ...@@ -127,7 +127,7 @@ class LiftoffAssembler : public TurboAssembler {
bool has_unused_register(RegClass rc, LiftoffRegList pinned = {}) const { bool has_unused_register(RegClass rc, LiftoffRegList pinned = {}) const {
if (kNeedI64RegPair && rc == kGpRegPair) { if (kNeedI64RegPair && rc == kGpRegPair) {
LiftoffRegList available_regs = LiftoffRegList available_regs =
kGpCacheRegList & ~used_registers & ~pinned; kGpCacheRegList.MaskOut(used_registers).MaskOut(pinned);
return available_regs.GetNumRegsSet() >= 2; return available_regs.GetNumRegsSet() >= 2;
} }
DCHECK(rc == kGpReg || rc == kFpReg); DCHECK(rc == kGpReg || rc == kFpReg);
...@@ -137,7 +137,8 @@ class LiftoffAssembler : public TurboAssembler { ...@@ -137,7 +137,8 @@ class LiftoffAssembler : public TurboAssembler {
bool has_unused_register(LiftoffRegList candidates, bool has_unused_register(LiftoffRegList candidates,
LiftoffRegList pinned = {}) const { LiftoffRegList pinned = {}) const {
LiftoffRegList available_regs = candidates & ~used_registers & ~pinned; LiftoffRegList available_regs =
candidates.MaskOut(used_registers).MaskOut(pinned);
return !available_regs.is_empty(); return !available_regs.is_empty();
} }
...@@ -155,7 +156,8 @@ class LiftoffAssembler : public TurboAssembler { ...@@ -155,7 +156,8 @@ class LiftoffAssembler : public TurboAssembler {
LiftoffRegister unused_register(LiftoffRegList candidates, LiftoffRegister unused_register(LiftoffRegList candidates,
LiftoffRegList pinned = {}) const { LiftoffRegList pinned = {}) const {
LiftoffRegList available_regs = candidates & ~used_registers & ~pinned; LiftoffRegList available_regs =
candidates.MaskOut(used_registers).MaskOut(pinned);
return available_regs.GetFirstRegSet(); return available_regs.GetFirstRegSet();
} }
......
...@@ -253,10 +253,6 @@ class LiftoffRegList { ...@@ -253,10 +253,6 @@ class LiftoffRegList {
return LiftoffRegList(regs_ & other.regs_); return LiftoffRegList(regs_ & other.regs_);
} }
constexpr LiftoffRegList operator~() const {
return LiftoffRegList(~regs_ & (kGpMask | kFpMask));
}
constexpr bool operator==(const LiftoffRegList other) const { constexpr bool operator==(const LiftoffRegList other) const {
return regs_ == other.regs_; return regs_ == other.regs_;
} }
......
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