Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Unified Diff: runtime/vm/flow_graph_compiler.cc

Issue 1160973002: Revert 'Revert to use macro REG_MASK_BIT, now with parentheses.' (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler.cc
diff --git a/runtime/vm/flow_graph_compiler.cc b/runtime/vm/flow_graph_compiler.cc
index 29d1169c56ca2f0fecbb3baab3aa2b020094dd76..0dad4fd6d2f3b9d2d692a05d04c7ec167bd2b4d3 100644
--- a/runtime/vm/flow_graph_compiler.cc
+++ b/runtime/vm/flow_graph_compiler.cc
@@ -1201,15 +1201,19 @@ static Register AllocateFreeRegister(bool* blocked_registers) {
}
-#define REG_MASK_BIT(reg) (((reg) != kNoRegister) ? (1 << (reg)) : 0)
+static uword RegMaskBit(Register reg) {
+ return ((reg) != kNoRegister) ? (1 << (reg)) : 0;
+}
+
+
// Mask of globally reserved registers. Some other registers are only reserved
// in particular code (e.g., ARGS_DESC_REG in intrinsics).
-static const uword kReservedCpuRegisters = REG_MASK_BIT(SPREG)
- | REG_MASK_BIT(FPREG)
- | REG_MASK_BIT(TMP)
- | REG_MASK_BIT(TMP2)
- | REG_MASK_BIT(PP)
- | REG_MASK_BIT(THR);
+static const uword kReservedCpuRegisters = RegMaskBit(SPREG)
+ | RegMaskBit(FPREG)
+ | RegMaskBit(TMP)
+ | RegMaskBit(TMP2)
+ | RegMaskBit(PP)
+ | RegMaskBit(THR);
void FlowGraphCompiler::AllocateRegistersLocally(Instruction* instr) {
@@ -1516,10 +1520,10 @@ ParallelMoveResolver::ScratchRegisterScope::ScratchRegisterScope(
: resolver_(resolver),
reg_(kNoRegister),
spilled_(false) {
- uword blocked_mask = REG_MASK_BIT(blocked) | kReservedCpuRegisters;
+ uword blocked_mask = RegMaskBit(blocked) | kReservedCpuRegisters;
if (resolver->compiler_->intrinsic_mode()) {
// Block additional registers that must be preserved for intrinsics.
- blocked_mask |= REG_MASK_BIT(ARGS_DESC_REG);
+ blocked_mask |= RegMaskBit(ARGS_DESC_REG);
}
reg_ = static_cast<Register>(
resolver_->AllocateScratchRegister(Location::kRegister,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698