From 917ac7d4131795bfd84694a07364e6bba2d8693a Mon Sep 17 00:00:00 2001 From: "verwaest@chromium.org" Date: Thu, 20 Jun 2013 14:11:52 +0000 Subject: [PATCH] Improve range analysis for smi phi R=jkummerow@chromium.org Review URL: https://chromiumcodereview.appspot.com/17498002 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15247 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/hydrogen-instructions.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc index f746af54bd..e227cea08b 100644 --- a/src/hydrogen-instructions.cc +++ b/src/hydrogen-instructions.cc @@ -1761,9 +1761,12 @@ Range* HConstant::InferRange(Zone* zone) { Range* HPhi::InferRange(Zone* zone) { - if (representation().IsInteger32()) { + Representation r = representation(); + if (r.IsSmiOrInteger32()) { if (block()->IsLoopHeader()) { - Range* range = new(zone) Range(kMinInt, kMaxInt); + Range* range = r.IsSmi() + ? new(zone) Range(Smi::kMinValue, Smi::kMaxValue) + : new(zone) Range(kMinInt, kMaxInt); return range; } else { Range* range = OperandAt(0)->range()->Copy(zone);