Fix lower bound of shr.

BUG=
R=rossberg@chromium.org

Review URL: https://codereview.chromium.org/27503002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17243 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
olivf@chromium.org 2013-10-16 14:39:27 +00:00
parent 18482d0da2
commit 0a6d2dec9f

View File

@ -603,8 +603,10 @@ void AstTyper::VisitBinaryOperation(BinaryOperation* expr) {
case Token::SHR: case Token::SHR:
RECURSE(Visit(expr->left())); RECURSE(Visit(expr->left()));
RECURSE(Visit(expr->right())); RECURSE(Visit(expr->right()));
// TODO(rossberg): we could use an UnsignedSmi as lower bound here... // TODO(rossberg): The upper bound would be Unsigned32, but since there
NarrowType(expr, Bounds(Type::Unsigned32(), isolate_)); // is no 'positive Smi' type for the lower bound, we use the smallest
// union of Smi and Unsigned32 as upper bound instead.
NarrowType(expr, Bounds(Type::Smi(), Type::Number(), isolate_));
break; break;
case Token::ADD: { case Token::ADD: {
RECURSE(Visit(expr->left())); RECURSE(Visit(expr->left()));