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

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

Issue 7489045: ARM: Fast path for compare against constant. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 3 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
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 1425 matching lines...) Expand 10 before | Expand all | Expand 10 after
1436 return MarkAsCall(DefineFixed(result, eax), instr); 1436 return MarkAsCall(DefineFixed(result, eax), instr);
1437 } 1437 }
1438 1438
1439 1439
1440 LInstruction* LChunkBuilder::DoCompareIDAndBranch( 1440 LInstruction* LChunkBuilder::DoCompareIDAndBranch(
1441 HCompareIDAndBranch* instr) { 1441 HCompareIDAndBranch* instr) {
1442 Representation r = instr->GetInputRepresentation(); 1442 Representation r = instr->GetInputRepresentation();
1443 if (r.IsInteger32()) { 1443 if (r.IsInteger32()) {
1444 ASSERT(instr->left()->representation().IsInteger32()); 1444 ASSERT(instr->left()->representation().IsInteger32());
1445 ASSERT(instr->right()->representation().IsInteger32()); 1445 ASSERT(instr->right()->representation().IsInteger32());
1446 LOperand* left = UseRegisterAtStart(instr->left()); 1446 LOperand* left = UseRegisterOrConstantAtStart(instr->left());
1447 LOperand* right = UseOrConstantAtStart(instr->right()); 1447 LOperand* right = UseOrConstantAtStart(instr->right());
1448 return new LCmpIDAndBranch(left, right); 1448 return new LCmpIDAndBranch(left, right);
1449 } else { 1449 } else {
1450 ASSERT(r.IsDouble()); 1450 ASSERT(r.IsDouble());
1451 ASSERT(instr->left()->representation().IsDouble()); 1451 ASSERT(instr->left()->representation().IsDouble());
1452 ASSERT(instr->right()->representation().IsDouble()); 1452 ASSERT(instr->right()->representation().IsDouble());
1453 LOperand* left = UseRegisterAtStart(instr->left()); 1453 LOperand* left;
1454 LOperand* right = UseRegisterAtStart(instr->right()); 1454 LOperand* right;
1455 if (instr->left()->IsConstant() && instr->right()->IsConstant()) {
1456 left = UseRegisterOrConstantAtStart(instr->left());
1457 right = UseRegisterOrConstantAtStart(instr->right());
1458 } else {
1459 left = UseRegisterAtStart(instr->left());
1460 right = UseRegisterAtStart(instr->right());
1461 }
1455 return new LCmpIDAndBranch(left, right); 1462 return new LCmpIDAndBranch(left, right);
1456 } 1463 }
1457 } 1464 }
1458 1465
1459 1466
1460 LInstruction* LChunkBuilder::DoCompareObjectEqAndBranch( 1467 LInstruction* LChunkBuilder::DoCompareObjectEqAndBranch(
1461 HCompareObjectEqAndBranch* instr) { 1468 HCompareObjectEqAndBranch* instr) {
1462 LOperand* left = UseRegisterAtStart(instr->left()); 1469 LOperand* left = UseRegisterAtStart(instr->left());
1463 LOperand* right = UseAtStart(instr->right()); 1470 LOperand* right = UseAtStart(instr->right());
1464 return new LCmpObjectEqAndBranch(left, right); 1471 return new LCmpObjectEqAndBranch(left, right);
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
2258 LOperand* key = UseOrConstantAtStart(instr->key()); 2265 LOperand* key = UseOrConstantAtStart(instr->key());
2259 LOperand* object = UseOrConstantAtStart(instr->object()); 2266 LOperand* object = UseOrConstantAtStart(instr->object());
2260 LIn* result = new LIn(context, key, object); 2267 LIn* result = new LIn(context, key, object);
2261 return MarkAsCall(DefineFixed(result, eax), instr); 2268 return MarkAsCall(DefineFixed(result, eax), instr);
2262 } 2269 }
2263 2270
2264 2271
2265 } } // namespace v8::internal 2272 } } // namespace v8::internal
2266 2273
2267 #endif // V8_TARGET_ARCH_IA32 2274 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698