OLD | NEW |
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 1438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1449 return MarkAsCall(DefineFixed(result, eax), instr); | 1449 return MarkAsCall(DefineFixed(result, eax), instr); |
1450 } | 1450 } |
1451 | 1451 |
1452 | 1452 |
1453 LInstruction* LChunkBuilder::DoCompareIDAndBranch( | 1453 LInstruction* LChunkBuilder::DoCompareIDAndBranch( |
1454 HCompareIDAndBranch* instr) { | 1454 HCompareIDAndBranch* instr) { |
1455 Representation r = instr->GetInputRepresentation(); | 1455 Representation r = instr->GetInputRepresentation(); |
1456 if (r.IsInteger32()) { | 1456 if (r.IsInteger32()) { |
1457 ASSERT(instr->left()->representation().IsInteger32()); | 1457 ASSERT(instr->left()->representation().IsInteger32()); |
1458 ASSERT(instr->right()->representation().IsInteger32()); | 1458 ASSERT(instr->right()->representation().IsInteger32()); |
1459 LOperand* left = UseRegisterAtStart(instr->left()); | 1459 LOperand* left = UseRegisterOrConstantAtStart(instr->left()); |
1460 LOperand* right = UseOrConstantAtStart(instr->right()); | 1460 LOperand* right = UseOrConstantAtStart(instr->right()); |
1461 return new LCmpIDAndBranch(left, right); | 1461 return new LCmpIDAndBranch(left, right); |
1462 } else { | 1462 } else { |
1463 ASSERT(r.IsDouble()); | 1463 ASSERT(r.IsDouble()); |
1464 ASSERT(instr->left()->representation().IsDouble()); | 1464 ASSERT(instr->left()->representation().IsDouble()); |
1465 ASSERT(instr->right()->representation().IsDouble()); | 1465 ASSERT(instr->right()->representation().IsDouble()); |
1466 LOperand* left = UseRegisterAtStart(instr->left()); | 1466 LOperand* left; |
1467 LOperand* right = UseRegisterAtStart(instr->right()); | 1467 LOperand* right; |
| 1468 if (instr->left()->IsConstant() && instr->right()->IsConstant()) { |
| 1469 left = UseRegisterOrConstantAtStart(instr->left()); |
| 1470 right = UseRegisterOrConstantAtStart(instr->right()); |
| 1471 } else { |
| 1472 left = UseRegisterAtStart(instr->left()); |
| 1473 right = UseRegisterAtStart(instr->right()); |
| 1474 } |
1468 return new LCmpIDAndBranch(left, right); | 1475 return new LCmpIDAndBranch(left, right); |
1469 } | 1476 } |
1470 } | 1477 } |
1471 | 1478 |
1472 | 1479 |
1473 LInstruction* LChunkBuilder::DoCompareObjectEqAndBranch( | 1480 LInstruction* LChunkBuilder::DoCompareObjectEqAndBranch( |
1474 HCompareObjectEqAndBranch* instr) { | 1481 HCompareObjectEqAndBranch* instr) { |
1475 LOperand* left = UseRegisterAtStart(instr->left()); | 1482 LOperand* left = UseRegisterAtStart(instr->left()); |
1476 LOperand* right = UseAtStart(instr->right()); | 1483 LOperand* right = UseAtStart(instr->right()); |
1477 return new LCmpObjectEqAndBranch(left, right); | 1484 return new LCmpObjectEqAndBranch(left, right); |
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2303 LOperand* key = UseOrConstantAtStart(instr->key()); | 2310 LOperand* key = UseOrConstantAtStart(instr->key()); |
2304 LOperand* object = UseOrConstantAtStart(instr->object()); | 2311 LOperand* object = UseOrConstantAtStart(instr->object()); |
2305 LIn* result = new LIn(context, key, object); | 2312 LIn* result = new LIn(context, key, object); |
2306 return MarkAsCall(DefineFixed(result, eax), instr); | 2313 return MarkAsCall(DefineFixed(result, eax), instr); |
2307 } | 2314 } |
2308 | 2315 |
2309 | 2316 |
2310 } } // namespace v8::internal | 2317 } } // namespace v8::internal |
2311 | 2318 |
2312 #endif // V8_TARGET_ARCH_IA32 | 2319 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |