Chromium Code Reviews| Index: runtime/lib/integers.cc |
| =================================================================== |
| --- runtime/lib/integers.cc (revision 38076) |
| +++ runtime/lib/integers.cc (working copy) |
| @@ -282,12 +282,16 @@ |
| if (value.IsMint()) { |
| const int64_t mint_value = value.AsInt64Value(); |
| const int count = Utils::HighestBit(mint_value); |
| - if ((count + amount.Value()) < Mint::kBits) { |
| + int shift_count = amount.Value(); |
| + if (kind == Token::kSHR) { |
| + shift_count = -shift_count; |
| + } |
|
srdjan
2014/07/09 17:05:16
s/int/intptr_t/
regis
2014/07/09 17:15:51
Done.
|
| + if ((count + shift_count) < Mint::kBits) { |
| switch (kind) { |
| case Token::kSHL: |
| - return Integer::New(mint_value << amount.Value(), Heap::kNew, silent); |
| + return Integer::New(mint_value << shift_count, Heap::kNew, silent); |
| case Token::kSHR: |
| - return Integer::New(mint_value >> amount.Value(), Heap::kNew, silent); |
| + return Integer::New(mint_value >> -shift_count, Heap::kNew, silent); |
| default: |
| UNIMPLEMENTED(); |
| } |