Index: src/hydrogen-instructions.cc |
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc |
index 39d59582beec3d1ba57cad734dc5713e5bdda976..f7a9569ed612a6b4c88d5e4b5de820567bc39e80 100644 |
--- a/src/hydrogen-instructions.cc |
+++ b/src/hydrogen-instructions.cc |
@@ -521,12 +521,19 @@ bool HValue::CanReplaceWithDummyUses() { |
bool HValue::IsInteger32Constant() { |
- return IsConstant() && HConstant::cast(this)->HasInteger32Value(); |
+ HValue* value_to_check = IsForceRepresentation() |
+ ? HForceRepresentation::cast(this)->value() |
+ : this; |
+ return value_to_check->IsConstant() && |
+ HConstant::cast(value_to_check)->HasInteger32Value(); |
} |
int32_t HValue::GetInteger32Constant() { |
- return HConstant::cast(this)->Integer32Value(); |
+ HValue* constant_value = IsForceRepresentation() |
+ ? HForceRepresentation::cast(this)->value() |
+ : this; |
+ return HConstant::cast(constant_value)->Integer32Value(); |
} |