 Chromium Code Reviews
 Chromium Code Reviews Issue 6665006:
  Reduce strength of ModI for power-of-2 divisor.  (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
    
  
    Issue 6665006:
  Reduce strength of ModI for power-of-2 divisor.  (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge| 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") |