OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1323 } else if (instr->representation().IsDouble()) { | 1323 } else if (instr->representation().IsDouble()) { |
1324 return DoArithmeticD(Token::ADD, instr); | 1324 return DoArithmeticD(Token::ADD, instr); |
1325 } else { | 1325 } else { |
1326 ASSERT(instr->representation().IsTagged()); | 1326 ASSERT(instr->representation().IsTagged()); |
1327 return DoArithmeticT(Token::ADD, instr); | 1327 return DoArithmeticT(Token::ADD, instr); |
1328 } | 1328 } |
1329 return NULL; | 1329 return NULL; |
1330 } | 1330 } |
1331 | 1331 |
1332 | 1332 |
| 1333 LInstruction* LChunkBuilder::DoMathMinMax(HMathMinMax* instr) { |
| 1334 LOperand* left = NULL; |
| 1335 LOperand* right = NULL; |
| 1336 if (instr->representation().IsInteger32()) { |
| 1337 ASSERT(instr->left()->representation().IsInteger32()); |
| 1338 ASSERT(instr->right()->representation().IsInteger32()); |
| 1339 left = UseRegisterAtStart(instr->LeastConstantOperand()); |
| 1340 right = UseOrConstantAtStart(instr->MostConstantOperand()); |
| 1341 } else { |
| 1342 ASSERT(instr->representation().IsDouble()); |
| 1343 ASSERT(instr->left()->representation().IsDouble()); |
| 1344 ASSERT(instr->right()->representation().IsDouble()); |
| 1345 left = UseRegisterAtStart(instr->left()); |
| 1346 right = UseRegisterAtStart(instr->right()); |
| 1347 } |
| 1348 LMathMinMax* minmax = new(zone()) LMathMinMax(left, right); |
| 1349 return DefineSameAsFirst(minmax); |
| 1350 } |
| 1351 |
| 1352 |
1333 LInstruction* LChunkBuilder::DoPower(HPower* instr) { | 1353 LInstruction* LChunkBuilder::DoPower(HPower* instr) { |
1334 ASSERT(instr->representation().IsDouble()); | 1354 ASSERT(instr->representation().IsDouble()); |
1335 // We call a C function for double power. It can't trigger a GC. | 1355 // We call a C function for double power. It can't trigger a GC. |
1336 // We need to use fixed result register for the call. | 1356 // We need to use fixed result register for the call. |
1337 Representation exponent_type = instr->right()->representation(); | 1357 Representation exponent_type = instr->right()->representation(); |
1338 ASSERT(instr->left()->representation().IsDouble()); | 1358 ASSERT(instr->left()->representation().IsDouble()); |
1339 LOperand* left = UseFixedDouble(instr->left(), xmm2); | 1359 LOperand* left = UseFixedDouble(instr->left(), xmm2); |
1340 LOperand* right = exponent_type.IsDouble() ? | 1360 LOperand* right = exponent_type.IsDouble() ? |
1341 UseFixedDouble(instr->right(), xmm1) : | 1361 UseFixedDouble(instr->right(), xmm1) : |
1342 #ifdef _WIN64 | 1362 #ifdef _WIN64 |
(...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2279 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2299 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2280 LOperand* object = UseRegister(instr->object()); | 2300 LOperand* object = UseRegister(instr->object()); |
2281 LOperand* index = UseTempRegister(instr->index()); | 2301 LOperand* index = UseTempRegister(instr->index()); |
2282 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2302 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
2283 } | 2303 } |
2284 | 2304 |
2285 | 2305 |
2286 } } // namespace v8::internal | 2306 } } // namespace v8::internal |
2287 | 2307 |
2288 #endif // V8_TARGET_ARCH_X64 | 2308 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |