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

Unified Diff: runtime/vm/flow_graph_compiler.cc

Issue 1153893005: 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 640600225848c52e8b7ecfdbbf10209ce4be52b8..74af234a78d583fe98c7cf213ca3905b94cd4632 100644
--- a/runtime/vm/flow_graph_compiler.cc
+++ b/runtime/vm/flow_graph_compiler.cc
@@ -1190,19 +1190,15 @@ static Register AllocateFreeRegister(bool* blocked_registers) {
}
-static uword RegMaskBit(Register reg) {
- return ((reg) != kNoRegister) ? (1 << (reg)) : 0;
-}
-
-
+#define REG_MASK_BIT(reg) (((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 = RegMaskBit(SPREG)
- | RegMaskBit(FPREG)
- | RegMaskBit(TMP)
- | RegMaskBit(TMP2)
- | RegMaskBit(PP)
- | RegMaskBit(THR);
+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);
void FlowGraphCompiler::AllocateRegistersLocally(Instruction* instr) {
@@ -1509,10 +1505,10 @@ ParallelMoveResolver::ScratchRegisterScope::ScratchRegisterScope(
: resolver_(resolver),
reg_(kNoRegister),
spilled_(false) {
- uword blocked_mask = RegMaskBit(blocked) | kReservedCpuRegisters;
+ uword blocked_mask = REG_MASK_BIT(blocked) | kReservedCpuRegisters;
if (resolver->compiler_->intrinsic_mode()) {
// Block additional registers that must be preserved for intrinsics.
- blocked_mask |= RegMaskBit(ARGS_DESC_REG);
+ blocked_mask |= REG_MASK_BIT(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