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

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

Issue 7027033: ARM: Add optimization for constant RHS in DoMulI. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 6 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 | « src/arm/code-stubs-arm.cc ('k') | src/arm/lithium-codegen-arm.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 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 1394 matching lines...) Expand 10 before | Expand all | Expand 10 after
1405 } 1405 }
1406 1406
1407 1407
1408 LInstruction* LChunkBuilder::DoMul(HMul* instr) { 1408 LInstruction* LChunkBuilder::DoMul(HMul* instr) {
1409 if (instr->representation().IsInteger32()) { 1409 if (instr->representation().IsInteger32()) {
1410 ASSERT(instr->left()->representation().IsInteger32()); 1410 ASSERT(instr->left()->representation().IsInteger32());
1411 ASSERT(instr->right()->representation().IsInteger32()); 1411 ASSERT(instr->right()->representation().IsInteger32());
1412 LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand()); 1412 LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand());
1413 LOperand* right = UseOrConstant(instr->MostConstantOperand()); 1413 LOperand* right = UseOrConstant(instr->MostConstantOperand());
1414 LOperand* temp = NULL; 1414 LOperand* temp = NULL;
1415 if (instr->CheckFlag(HValue::kBailoutOnMinusZero)) { 1415 if (instr->CheckFlag(HValue::kBailoutOnMinusZero) &&
1416 (instr->CheckFlag(HValue::kCanOverflow) ||
1417 !right->IsConstantOperand())) {
1416 temp = TempRegister(); 1418 temp = TempRegister();
1417 } 1419 }
1418 LMulI* mul = new LMulI(left, right, temp); 1420 return AssignEnvironment(DefineSameAsFirst(new LMulI(left, right, temp)));
1419 return AssignEnvironment(DefineSameAsFirst(mul)); 1421
1420 } else if (instr->representation().IsDouble()) { 1422 } else if (instr->representation().IsDouble()) {
1421 return DoArithmeticD(Token::MUL, instr); 1423 return DoArithmeticD(Token::MUL, instr);
1424
1422 } else { 1425 } else {
1423 return DoArithmeticT(Token::MUL, instr); 1426 return DoArithmeticT(Token::MUL, instr);
1424 } 1427 }
1425 } 1428 }
1426 1429
1427 1430
1428 LInstruction* LChunkBuilder::DoSub(HSub* instr) { 1431 LInstruction* LChunkBuilder::DoSub(HSub* instr) {
1429 if (instr->representation().IsInteger32()) { 1432 if (instr->representation().IsInteger32()) {
1430 ASSERT(instr->left()->representation().IsInteger32()); 1433 ASSERT(instr->left()->representation().IsInteger32());
1431 ASSERT(instr->right()->representation().IsInteger32()); 1434 ASSERT(instr->right()->representation().IsInteger32());
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
2232 2235
2233 LInstruction* LChunkBuilder::DoIn(HIn* instr) { 2236 LInstruction* LChunkBuilder::DoIn(HIn* instr) {
2234 LOperand* key = UseRegisterAtStart(instr->key()); 2237 LOperand* key = UseRegisterAtStart(instr->key());
2235 LOperand* object = UseRegisterAtStart(instr->object()); 2238 LOperand* object = UseRegisterAtStart(instr->object());
2236 LIn* result = new LIn(key, object); 2239 LIn* result = new LIn(key, object);
2237 return MarkAsCall(DefineFixed(result, r0), instr); 2240 return MarkAsCall(DefineFixed(result, r0), instr);
2238 } 2241 }
2239 2242
2240 2243
2241 } } // namespace v8::internal 2244 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698