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 1390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1401 return MarkAsCall(DefineFixed(result, rax), instr); | 1401 return MarkAsCall(DefineFixed(result, rax), instr); |
1402 } | 1402 } |
1403 | 1403 |
1404 | 1404 |
1405 LInstruction* LChunkBuilder::DoCompareIDAndBranch( | 1405 LInstruction* LChunkBuilder::DoCompareIDAndBranch( |
1406 HCompareIDAndBranch* instr) { | 1406 HCompareIDAndBranch* instr) { |
1407 Representation r = instr->GetInputRepresentation(); | 1407 Representation r = instr->GetInputRepresentation(); |
1408 if (r.IsInteger32()) { | 1408 if (r.IsInteger32()) { |
1409 ASSERT(instr->left()->representation().IsInteger32()); | 1409 ASSERT(instr->left()->representation().IsInteger32()); |
1410 ASSERT(instr->right()->representation().IsInteger32()); | 1410 ASSERT(instr->right()->representation().IsInteger32()); |
1411 LOperand* left = UseRegisterAtStart(instr->left()); | 1411 LOperand* left = UseRegisterOrConstantAtStart(instr->left()); |
1412 LOperand* right = UseOrConstantAtStart(instr->right()); | 1412 LOperand* right = UseOrConstantAtStart(instr->right()); |
1413 return new LCmpIDAndBranch(left, right); | 1413 return new LCmpIDAndBranch(left, right); |
1414 } else { | 1414 } else { |
1415 ASSERT(r.IsDouble()); | 1415 ASSERT(r.IsDouble()); |
1416 ASSERT(instr->left()->representation().IsDouble()); | 1416 ASSERT(instr->left()->representation().IsDouble()); |
1417 ASSERT(instr->right()->representation().IsDouble()); | 1417 ASSERT(instr->right()->representation().IsDouble()); |
1418 LOperand* left = UseRegisterAtStart(instr->left()); | 1418 LOperand* left; |
1419 LOperand* right = UseRegisterAtStart(instr->right()); | 1419 LOperand* right; |
| 1420 if (instr->left()->IsConstant() && instr->right()->IsConstant()) { |
| 1421 left = UseRegisterOrConstantAtStart(instr->left()); |
| 1422 right = UseRegisterOrConstantAtStart(instr->right()); |
| 1423 } else { |
| 1424 left = UseRegisterAtStart(instr->left()); |
| 1425 right = UseRegisterAtStart(instr->right()); |
| 1426 } |
1420 return new LCmpIDAndBranch(left, right); | 1427 return new LCmpIDAndBranch(left, right); |
1421 } | 1428 } |
1422 } | 1429 } |
1423 | 1430 |
1424 | 1431 |
1425 LInstruction* LChunkBuilder::DoCompareObjectEqAndBranch( | 1432 LInstruction* LChunkBuilder::DoCompareObjectEqAndBranch( |
1426 HCompareObjectEqAndBranch* instr) { | 1433 HCompareObjectEqAndBranch* instr) { |
1427 LOperand* left = UseRegisterAtStart(instr->left()); | 1434 LOperand* left = UseRegisterAtStart(instr->left()); |
1428 LOperand* right = UseRegisterAtStart(instr->right()); | 1435 LOperand* right = UseRegisterAtStart(instr->right()); |
1429 return new LCmpObjectEqAndBranch(left, right); | 1436 return new LCmpObjectEqAndBranch(left, right); |
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2169 LOperand* key = UseOrConstantAtStart(instr->key()); | 2176 LOperand* key = UseOrConstantAtStart(instr->key()); |
2170 LOperand* object = UseOrConstantAtStart(instr->object()); | 2177 LOperand* object = UseOrConstantAtStart(instr->object()); |
2171 LIn* result = new LIn(key, object); | 2178 LIn* result = new LIn(key, object); |
2172 return MarkAsCall(DefineFixed(result, rax), instr); | 2179 return MarkAsCall(DefineFixed(result, rax), instr); |
2173 } | 2180 } |
2174 | 2181 |
2175 | 2182 |
2176 } } // namespace v8::internal | 2183 } } // namespace v8::internal |
2177 | 2184 |
2178 #endif // V8_TARGET_ARCH_X64 | 2185 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |