Chromium Code Reviews| Index: src/hydrogen-instructions.cc | 
| =================================================================== | 
| --- src/hydrogen-instructions.cc (revision 8984) | 
| +++ src/hydrogen-instructions.cc (working copy) | 
| @@ -641,6 +641,7 @@ | 
| length()->PrintNameTo(stream); | 
| } | 
| + | 
| void HCallConstantFunction::PrintDataTo(StringStream* stream) { | 
| if (IsApplyFunction()) { | 
| stream->Add("optimized apply "); | 
| @@ -875,6 +876,17 @@ | 
| } | 
| +Range* HChange::InferRange() { | 
| + Range* input_range = value()->range(); | 
| + if (from().IsInteger32() && | 
| + to().IsTagged() && | 
| + input_range != NULL && input_range->IsInSmiRange()) { | 
| + set_type(HType::Smi()); | 
| + } | 
| + return input_range != NULL ? input_range->Copy() : HValue::InferRange(); | 
| 
 
Vyacheslav Egorov (Chromium)
2011/08/22 12:53:31
It seems that if we are converting to integer type
 
fschneider
2011/08/23 07:36:10
Done.
 
 | 
| +} | 
| + | 
| + | 
| Range* HConstant::InferRange() { | 
| if (has_int32_value_) { | 
| Range* result = new Range(int32_value_, int32_value_); | 
| @@ -1220,6 +1232,7 @@ | 
| ? left()->range()->Copy() | 
| : new Range(); | 
| result->Sar(c->Integer32Value()); | 
| + result->set_can_be_minus_zero(false); | 
| return result; | 
| } | 
| } | 
| @@ -1243,6 +1256,7 @@ | 
| ? left()->range()->Copy() | 
| : new Range(); | 
| result->Sar(c->Integer32Value()); | 
| + result->set_can_be_minus_zero(false); | 
| return result; | 
| } | 
| } | 
| @@ -1259,6 +1273,7 @@ | 
| ? left()->range()->Copy() | 
| : new Range(); | 
| result->Shl(c->Integer32Value()); | 
| + result->set_can_be_minus_zero(false); | 
| return result; | 
| } | 
| } |