Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Unified Diff: src/arm/codegen-arm.cc

Issue 3195004: Fix an issue in the ARM port where a left shift was predicted to have... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/shifts.js » ('j') | test/mjsunit/shifts.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/codegen-arm.cc
===================================================================
--- src/arm/codegen-arm.cc (revision 5308)
+++ src/arm/codegen-arm.cc (working copy)
@@ -1222,21 +1222,26 @@
case Token::SHR:
case Token::SAR: {
ASSERT(!reversed);
- TypeInfo result =
- (op == Token::SAR) ? TypeInfo::Integer32() : TypeInfo::Number();
- if (!reversed) {
- if (op == Token::SHR) {
- if (int_value >= 2) {
- result = TypeInfo::Smi();
- } else if (int_value >= 1) {
- result = TypeInfo::Integer32();
- }
+ int shift_amount = int_value & 0x1f;
+ TypeInfo result = TypeInfo::Number();
+
+ if (op == Token::SHR) {
+ if (shift_amount > 1) {
+ result = TypeInfo::Smi();
+ } else if (shift_amount > 0) {
+ result = TypeInfo::Integer32();
+ }
+ } else if (op == Token::SAR) {
+ if (shift_amount > 0) {
+ result = TypeInfo::Smi();
} else {
- if (int_value >= 1) {
- result = TypeInfo::Smi();
- }
+ result = TypeInfo::Integer32();
}
+ } else {
+ ASSERT(op == Token::SHL);
+ result = TypeInfo::Integer32();
}
+
Register scratch = VirtualFrame::scratch0();
Register scratch2 = VirtualFrame::scratch1();
int shift_value = int_value & 0x1f; // least significant 5 bits
« no previous file with comments | « no previous file | test/mjsunit/shifts.js » ('j') | test/mjsunit/shifts.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698