Index: src/hydrogen-instructions.h |
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
index 6c516f2497e01ae6e63a9cca6f241d55d2929172..d92edbebb56ccb7769f4e964db955bc3d3d22f27 100644 |
--- a/src/hydrogen-instructions.h |
+++ b/src/hydrogen-instructions.h |
@@ -2567,6 +2567,16 @@ class HMod: public HArithmeticBinaryOperation { |
SetFlag(kCanBeDivByZero); |
} |
+ bool HasPowerOf2Divisor() { |
+ if (right()->IsConstant() && |
+ HConstant::cast(right())->HasInteger32Value()) { |
+ int32_t value = HConstant::cast(right())->HasInteger32Value(); |
Kevin Millikin (Chromium)
2011/03/11 11:59:43
HConstant::cast(right()->Integer32Value();
Vyacheslav Egorov (Chromium)
2011/03/14 14:30:51
Done.
|
+ return IsPowerOf2(value) || IsPowerOf2(-value); |
+ } |
+ |
+ return false; |
+ } |
+ |
virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited); |
DECLARE_CONCRETE_INSTRUCTION(Mod, "mod") |