Commit 8dd69f8d authored by verwaest@chromium.org's avatar verwaest@chromium.org

Infer smi-range for smi-typed values.

Review URL: https://chromiumcodereview.appspot.com/14192034

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14365 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 37d11fb0
......@@ -1683,9 +1683,15 @@ void HInstanceOf::PrintDataTo(StringStream* stream) {
Range* HValue::InferRange(Zone* zone) {
// Untagged integer32 cannot be -0, all other representations can.
Range* result = new(zone) Range();
result->set_can_be_minus_zero(!representation().IsInteger32());
Range* result;
if (type().IsSmi()) {
result = new(zone) Range(Smi::kMinValue, Smi::kMaxValue);
result->set_can_be_minus_zero(false);
} else {
// Untagged integer32 cannot be -0, all other representations can.
result = new(zone) Range();
result->set_can_be_minus_zero(!representation().IsInteger32());
}
return result;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment