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 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1289 return result; | 1289 return result; |
1290 } else if (instr->representation().IsDouble()) { | 1290 } else if (instr->representation().IsDouble()) { |
1291 return DoArithmeticD(Token::ADD, instr); | 1291 return DoArithmeticD(Token::ADD, instr); |
1292 } else { | 1292 } else { |
1293 ASSERT(instr->representation().IsTagged()); | 1293 ASSERT(instr->representation().IsTagged()); |
1294 return DoArithmeticT(Token::ADD, instr); | 1294 return DoArithmeticT(Token::ADD, instr); |
1295 } | 1295 } |
1296 } | 1296 } |
1297 | 1297 |
1298 | 1298 |
| 1299 LInstruction* LChunkBuilder::DoMathMinMax(HMathMinMax* instr) { |
| 1300 LOperand* left = NULL; |
| 1301 LOperand* right = NULL; |
| 1302 if (instr->representation().IsInteger32()) { |
| 1303 ASSERT(instr->left()->representation().IsInteger32()); |
| 1304 ASSERT(instr->right()->representation().IsInteger32()); |
| 1305 left = UseRegisterAtStart(instr->LeastConstantOperand()); |
| 1306 right = UseOrConstantAtStart(instr->MostConstantOperand()); |
| 1307 } else { |
| 1308 ASSERT(instr->representation().IsDouble()); |
| 1309 ASSERT(instr->left()->representation().IsDouble()); |
| 1310 ASSERT(instr->right()->representation().IsDouble()); |
| 1311 left = UseRegisterAtStart(instr->left()); |
| 1312 right = UseRegisterAtStart(instr->right()); |
| 1313 } |
| 1314 return DefineAsRegister(new(zone()) LMathMinMax(left, right)); |
| 1315 } |
| 1316 |
| 1317 |
1299 LInstruction* LChunkBuilder::DoPower(HPower* instr) { | 1318 LInstruction* LChunkBuilder::DoPower(HPower* instr) { |
1300 ASSERT(instr->representation().IsDouble()); | 1319 ASSERT(instr->representation().IsDouble()); |
1301 // We call a C function for double power. It can't trigger a GC. | 1320 // We call a C function for double power. It can't trigger a GC. |
1302 // We need to use fixed result register for the call. | 1321 // We need to use fixed result register for the call. |
1303 Representation exponent_type = instr->right()->representation(); | 1322 Representation exponent_type = instr->right()->representation(); |
1304 ASSERT(instr->left()->representation().IsDouble()); | 1323 ASSERT(instr->left()->representation().IsDouble()); |
1305 LOperand* left = UseFixedDouble(instr->left(), f2); | 1324 LOperand* left = UseFixedDouble(instr->left(), f2); |
1306 LOperand* right = exponent_type.IsDouble() ? | 1325 LOperand* right = exponent_type.IsDouble() ? |
1307 UseFixedDouble(instr->right(), f4) : | 1326 UseFixedDouble(instr->right(), f4) : |
1308 UseFixed(instr->right(), a2); | 1327 UseFixed(instr->right(), a2); |
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2220 | 2239 |
2221 | 2240 |
2222 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2241 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2223 LOperand* object = UseRegister(instr->object()); | 2242 LOperand* object = UseRegister(instr->object()); |
2224 LOperand* index = UseRegister(instr->index()); | 2243 LOperand* index = UseRegister(instr->index()); |
2225 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2244 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
2226 } | 2245 } |
2227 | 2246 |
2228 | 2247 |
2229 } } // namespace v8::internal | 2248 } } // namespace v8::internal |
OLD | NEW |