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 1341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1352 return result; | 1352 return result; |
1353 } else if (instr->representation().IsDouble()) { | 1353 } else if (instr->representation().IsDouble()) { |
1354 return DoArithmeticD(Token::ADD, instr); | 1354 return DoArithmeticD(Token::ADD, instr); |
1355 } else { | 1355 } else { |
1356 ASSERT(instr->representation().IsTagged()); | 1356 ASSERT(instr->representation().IsTagged()); |
1357 return DoArithmeticT(Token::ADD, instr); | 1357 return DoArithmeticT(Token::ADD, instr); |
1358 } | 1358 } |
1359 } | 1359 } |
1360 | 1360 |
1361 | 1361 |
| 1362 LInstruction* LChunkBuilder::DoMathMinMax(HMathMinMax* instr) { |
| 1363 LOperand* left = NULL; |
| 1364 LOperand* right = NULL; |
| 1365 if (instr->representation().IsInteger32()) { |
| 1366 ASSERT(instr->left()->representation().IsInteger32()); |
| 1367 ASSERT(instr->right()->representation().IsInteger32()); |
| 1368 left = UseRegisterAtStart(instr->LeastConstantOperand()); |
| 1369 right = UseOrConstantAtStart(instr->MostConstantOperand()); |
| 1370 } else { |
| 1371 ASSERT(instr->representation().IsDouble()); |
| 1372 ASSERT(instr->left()->representation().IsDouble()); |
| 1373 ASSERT(instr->right()->representation().IsDouble()); |
| 1374 left = UseRegisterAtStart(instr->left()); |
| 1375 right = UseRegisterAtStart(instr->right()); |
| 1376 } |
| 1377 return DefineAsRegister(new(zone()) LMathMinMax(left, right)); |
| 1378 } |
| 1379 |
| 1380 |
1362 LInstruction* LChunkBuilder::DoPower(HPower* instr) { | 1381 LInstruction* LChunkBuilder::DoPower(HPower* instr) { |
1363 ASSERT(instr->representation().IsDouble()); | 1382 ASSERT(instr->representation().IsDouble()); |
1364 // We call a C function for double power. It can't trigger a GC. | 1383 // We call a C function for double power. It can't trigger a GC. |
1365 // We need to use fixed result register for the call. | 1384 // We need to use fixed result register for the call. |
1366 Representation exponent_type = instr->right()->representation(); | 1385 Representation exponent_type = instr->right()->representation(); |
1367 ASSERT(instr->left()->representation().IsDouble()); | 1386 ASSERT(instr->left()->representation().IsDouble()); |
1368 LOperand* left = UseFixedDouble(instr->left(), d1); | 1387 LOperand* left = UseFixedDouble(instr->left(), d1); |
1369 LOperand* right = exponent_type.IsDouble() ? | 1388 LOperand* right = exponent_type.IsDouble() ? |
1370 UseFixedDouble(instr->right(), d2) : | 1389 UseFixedDouble(instr->right(), d2) : |
1371 UseFixed(instr->right(), r2); | 1390 UseFixed(instr->right(), r2); |
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2280 | 2299 |
2281 | 2300 |
2282 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2301 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2283 LOperand* object = UseRegister(instr->object()); | 2302 LOperand* object = UseRegister(instr->object()); |
2284 LOperand* index = UseRegister(instr->index()); | 2303 LOperand* index = UseRegister(instr->index()); |
2285 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2304 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
2286 } | 2305 } |
2287 | 2306 |
2288 | 2307 |
2289 } } // namespace v8::internal | 2308 } } // namespace v8::internal |
OLD | NEW |