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

Side by Side Diff: src/arm/codegen-arm.cc

Issue 6672040: Fix incorrect assumption about BIT_AND on smis on ARM. (Closed) Base URL: http://v8.googlecode.com/svn/branches/2.3/
Patch Set: Created 9 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/version.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after
1194 new DeferredInlineSmiOperation(op, int_value, reversed, mode, tos); 1194 new DeferredInlineSmiOperation(op, int_value, reversed, mode, tos);
1195 __ tst(tos, Operand(kSmiTagMask)); 1195 __ tst(tos, Operand(kSmiTagMask));
1196 deferred->Branch(ne); 1196 deferred->Branch(ne);
1197 switch (op) { 1197 switch (op) {
1198 case Token::BIT_OR: __ orr(tos, tos, Operand(value)); break; 1198 case Token::BIT_OR: __ orr(tos, tos, Operand(value)); break;
1199 case Token::BIT_XOR: __ eor(tos, tos, Operand(value)); break; 1199 case Token::BIT_XOR: __ eor(tos, tos, Operand(value)); break;
1200 case Token::BIT_AND: __ And(tos, tos, Operand(value)); break; 1200 case Token::BIT_AND: __ And(tos, tos, Operand(value)); break;
1201 default: UNREACHABLE(); 1201 default: UNREACHABLE();
1202 } 1202 }
1203 deferred->BindExit(); 1203 deferred->BindExit();
1204 TypeInfo result_type = 1204 TypeInfo result_type = TypeInfo::Integer32();
1205 (op == Token::BIT_AND) ? TypeInfo::Smi() : TypeInfo::Integer32(); 1205 if (op == Token::BIT_AND && int_value >= 0) {
1206 result_type = TypeInfo::Smi();
1207 }
1206 frame_->EmitPush(tos, result_type); 1208 frame_->EmitPush(tos, result_type);
1207 } 1209 }
1208 break; 1210 break;
1209 } 1211 }
1210 1212
1211 case Token::SHL: 1213 case Token::SHL:
1212 if (reversed) { 1214 if (reversed) {
1213 ASSERT(both_sides_are_smi); 1215 ASSERT(both_sides_are_smi);
1214 int max_shift = 0; 1216 int max_shift = 0;
1215 int max_result = int_value == 0 ? 1 : int_value; 1217 int max_result = int_value == 0 ? 1 : int_value;
(...skipping 5872 matching lines...) Expand 10 before | Expand all | Expand 10 after
7088 BinaryOpIC::GetName(runtime_operands_type_)); 7090 BinaryOpIC::GetName(runtime_operands_type_));
7089 return name_; 7091 return name_;
7090 } 7092 }
7091 7093
7092 7094
7093 #undef __ 7095 #undef __
7094 7096
7095 } } // namespace v8::internal 7097 } } // namespace v8::internal
7096 7098
7097 #endif // V8_TARGET_ARCH_ARM 7099 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698