Chromium Code Reviews| Index: src/hydrogen-instructions.h |
| diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
| index 4a8a406eb3befbc126c4f0f6aa15119892ef316f..a4b2e0990dd44d5d5fa90e2581c6f04afb631555 100644 |
| --- a/src/hydrogen-instructions.h |
| +++ b/src/hydrogen-instructions.h |
| @@ -271,6 +271,14 @@ class Range: public ZoneObject { |
| bool IsInSmiRange() const { |
| return lower_ >= Smi::kMinValue && upper_ <= Smi::kMaxValue; |
| } |
| + void TruncateToSmi() { |
|
Sven Panne
2013/06/07 06:40:54
I think that "ClampToSmi" is a better name. "Clamp
|
| + lower_ = Max(lower_, Smi::kMinValue); |
| + upper_ = Min(upper_, Smi::kMaxValue); |
| + } |
| + void TruncateToInt32() { |
|
Jakob Kummerow
2013/06/07 08:21:05
Considering that lower_ and upper_ are int32_t, th
|
| + lower_ = Max(lower_, kMinInt); |
| + upper_ = Min(upper_, kMaxInt); |
| + } |
| void KeepOrder(); |
| #ifdef DEBUG |
| void Verify() const; |
| @@ -2644,6 +2652,8 @@ class HUnaryMathOperation: public HTemplateInstruction<2> { |
| } |
| } |
| + virtual Range* InferRange(Zone* zone); |
| + |
| virtual HValue* Canonicalize(); |
| BuiltinFunctionId op() const { return op_; } |