| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 5333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5344 case Token::BIT_AND: | 5344 case Token::BIT_AND: |
| 5345 // Result is always a smi. | 5345 // Result is always a smi. |
| 5346 result_type = TypeInfo::Smi(); | 5346 result_type = TypeInfo::Smi(); |
| 5347 break; | 5347 break; |
| 5348 case Token::SAR: | 5348 case Token::SAR: |
| 5349 case Token::SHL: | 5349 case Token::SHL: |
| 5350 // Result is always a smi. | 5350 // Result is always a smi. |
| 5351 result_type = TypeInfo::Smi(); | 5351 result_type = TypeInfo::Smi(); |
| 5352 break; | 5352 break; |
| 5353 case Token::SHR: | 5353 case Token::SHR: |
| 5354 // Result of x >>> y is always a smi if y >= 1, otherwise a number. | 5354 // Result of x >>> y is always a smi if masked y >= 1, otherwise a number. |
| 5355 result_type = (right.is_constant() && right.handle()->IsSmi() | 5355 result_type = (right.is_constant() && right.handle()->IsSmi() |
| 5356 && Smi::cast(*right.handle())->value() >= 1) | 5356 && (Smi::cast(*right.handle())->value() & 0x1F) >= 1) |
| 5357 ? TypeInfo::Smi() | 5357 ? TypeInfo::Smi() |
| 5358 : TypeInfo::Number(); | 5358 : TypeInfo::Number(); |
| 5359 break; | 5359 break; |
| 5360 case Token::ADD: | 5360 case Token::ADD: |
| 5361 // Result could be a string or a number. Check types of inputs. | 5361 // Result could be a string or a number. Check types of inputs. |
| 5362 result_type = operands_type.IsNumber() | 5362 result_type = operands_type.IsNumber() |
| 5363 ? TypeInfo::Number() | 5363 ? TypeInfo::Number() |
| 5364 : TypeInfo::Unknown(); | 5364 : TypeInfo::Unknown(); |
| 5365 break; | 5365 break; |
| 5366 case Token::SUB: | 5366 case Token::SUB: |
| (...skipping 4626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9993 // Call the function from C++. | 9993 // Call the function from C++. |
| 9994 return FUNCTION_CAST<ModuloFunction>(buffer); | 9994 return FUNCTION_CAST<ModuloFunction>(buffer); |
| 9995 } | 9995 } |
| 9996 | 9996 |
| 9997 #endif | 9997 #endif |
| 9998 | 9998 |
| 9999 | 9999 |
| 10000 #undef __ | 10000 #undef __ |
| 10001 | 10001 |
| 10002 } } // namespace v8::internal | 10002 } } // namespace v8::internal |
| OLD | NEW |