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

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

Issue 6328009: Move swapping of operands for commutative binary operations to the lithium IR... Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 11 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/hydrogen-instructions.h » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 return AssignEnvironment(new LDeoptimize); 723 return AssignEnvironment(new LDeoptimize);
724 } 724 }
725 725
726 726
727 LInstruction* LChunkBuilder::DoBit(Token::Value op, 727 LInstruction* LChunkBuilder::DoBit(Token::Value op,
728 HBitwiseBinaryOperation* instr) { 728 HBitwiseBinaryOperation* instr) {
729 ASSERT(instr->representation().IsInteger32()); 729 ASSERT(instr->representation().IsInteger32());
730 ASSERT(instr->left()->representation().IsInteger32()); 730 ASSERT(instr->left()->representation().IsInteger32());
731 ASSERT(instr->right()->representation().IsInteger32()); 731 ASSERT(instr->right()->representation().IsInteger32());
732 732
733 LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand()); 733 LOperand* left = UseRegisterAtStart(instr->left()->IsConstant()
734 LOperand* right = UseOrConstantAtStart(instr->MostConstantOperand()); 734 ? instr->right()
735 : instr->left());
736 LOperand* right = UseOrConstantAtStart(instr->left()->IsConstant()
737 ? instr->left()
738 : instr->right());
735 return DefineSameAsFirst(new LBitI(op, left, right)); 739 return DefineSameAsFirst(new LBitI(op, left, right));
736 } 740 }
737 741
738 742
739 LInstruction* LChunkBuilder::DoShift(Token::Value op, 743 LInstruction* LChunkBuilder::DoShift(Token::Value op,
740 HBitwiseBinaryOperation* instr) { 744 HBitwiseBinaryOperation* instr) {
741 ASSERT(instr->representation().IsInteger32()); 745 ASSERT(instr->representation().IsInteger32());
742 ASSERT(instr->OperandAt(0)->representation().IsInteger32()); 746 ASSERT(instr->OperandAt(0)->representation().IsInteger32());
743 ASSERT(instr->OperandAt(1)->representation().IsInteger32()); 747 ASSERT(instr->OperandAt(1)->representation().IsInteger32());
744 LOperand* left = UseRegisterAtStart(instr->OperandAt(0)); 748 LOperand* left = UseRegisterAtStart(instr->OperandAt(0));
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
1267 LArithmeticD* result = new LArithmeticD(Token::MOD, left, right); 1271 LArithmeticD* result = new LArithmeticD(Token::MOD, left, right);
1268 return MarkAsCall(DefineFixedDouble(result, d1), instr); 1272 return MarkAsCall(DefineFixedDouble(result, d1), instr);
1269 } 1273 }
1270 } 1274 }
1271 1275
1272 1276
1273 LInstruction* LChunkBuilder::DoMul(HMul* instr) { 1277 LInstruction* LChunkBuilder::DoMul(HMul* instr) {
1274 if (instr->representation().IsInteger32()) { 1278 if (instr->representation().IsInteger32()) {
1275 ASSERT(instr->left()->representation().IsInteger32()); 1279 ASSERT(instr->left()->representation().IsInteger32());
1276 ASSERT(instr->right()->representation().IsInteger32()); 1280 ASSERT(instr->right()->representation().IsInteger32());
1277 LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand()); 1281 LOperand* left = UseRegisterAtStart(instr->left()->IsConstant()
1278 LOperand* right = UseOrConstant(instr->MostConstantOperand()); 1282 ? instr->right()
1283 : instr->left());
1284 LOperand* right = UseOrConstant(instr->left()->IsConstant()
1285 ? instr->left()
1286 : instr->right());
1279 LOperand* temp = NULL; 1287 LOperand* temp = NULL;
1280 if (instr->CheckFlag(HValue::kBailoutOnMinusZero)) { 1288 if (instr->CheckFlag(HValue::kBailoutOnMinusZero)) {
1281 temp = TempRegister(); 1289 temp = TempRegister();
1282 } 1290 }
1283 LMulI* mul = new LMulI(left, right, temp); 1291 LMulI* mul = new LMulI(left, right, temp);
1284 return AssignEnvironment(DefineSameAsFirst(mul)); 1292 return AssignEnvironment(DefineSameAsFirst(mul));
1285 } else if (instr->representation().IsDouble()) { 1293 } else if (instr->representation().IsDouble()) {
1286 return DoArithmeticD(Token::MUL, instr); 1294 return DoArithmeticD(Token::MUL, instr);
1287 } else { 1295 } else {
1288 return DoArithmeticT(Token::MUL, instr); 1296 return DoArithmeticT(Token::MUL, instr);
(...skipping 18 matching lines...) Expand all
1307 } else { 1315 } else {
1308 return DoArithmeticT(Token::SUB, instr); 1316 return DoArithmeticT(Token::SUB, instr);
1309 } 1317 }
1310 } 1318 }
1311 1319
1312 1320
1313 LInstruction* LChunkBuilder::DoAdd(HAdd* instr) { 1321 LInstruction* LChunkBuilder::DoAdd(HAdd* instr) {
1314 if (instr->representation().IsInteger32()) { 1322 if (instr->representation().IsInteger32()) {
1315 ASSERT(instr->left()->representation().IsInteger32()); 1323 ASSERT(instr->left()->representation().IsInteger32());
1316 ASSERT(instr->right()->representation().IsInteger32()); 1324 ASSERT(instr->right()->representation().IsInteger32());
1317 LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand()); 1325 LOperand* left = UseRegisterAtStart(instr->left()->IsConstant()
1318 LOperand* right = UseOrConstantAtStart(instr->MostConstantOperand()); 1326 ? instr->right()
1327 : instr->left());
1328 LOperand* right = UseOrConstantAtStart(instr->left()->IsConstant()
1329 ? instr->left()
1330 : instr->right());
1319 LAddI* add = new LAddI(left, right); 1331 LAddI* add = new LAddI(left, right);
1320 LInstruction* result = DefineSameAsFirst(add); 1332 LInstruction* result = DefineSameAsFirst(add);
1321 if (instr->CheckFlag(HValue::kCanOverflow)) { 1333 if (instr->CheckFlag(HValue::kCanOverflow)) {
1322 result = AssignEnvironment(result); 1334 result = AssignEnvironment(result);
1323 } 1335 }
1324 return result; 1336 return result;
1325 } else if (instr->representation().IsDouble()) { 1337 } else if (instr->representation().IsDouble()) {
1326 return DoArithmeticD(Token::ADD, instr); 1338 return DoArithmeticD(Token::ADD, instr);
1327 } else { 1339 } else {
1328 ASSERT(instr->representation().IsTagged()); 1340 ASSERT(instr->representation().IsTagged());
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
1841 1853
1842 1854
1843 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { 1855 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) {
1844 HEnvironment* outer = current_block_->last_environment()->outer(); 1856 HEnvironment* outer = current_block_->last_environment()->outer();
1845 current_block_->UpdateEnvironment(outer); 1857 current_block_->UpdateEnvironment(outer);
1846 return NULL; 1858 return NULL;
1847 } 1859 }
1848 1860
1849 1861
1850 } } // namespace v8::internal 1862 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698