| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 941 LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); | 941 LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); |
| 942 LOperand* right = | 942 LOperand* right = |
| 943 UseRegisterOrConstantAtStart(instr->BetterRightOperand()); | 943 UseRegisterOrConstantAtStart(instr->BetterRightOperand()); |
| 944 LInstruction* result = instr->representation().IsSmi() ? | 944 LInstruction* result = instr->representation().IsSmi() ? |
| 945 DefineAsRegister(new(zone()) LAddS(left, right)) : | 945 DefineAsRegister(new(zone()) LAddS(left, right)) : |
| 946 DefineAsRegister(new(zone()) LAddI(left, right)); | 946 DefineAsRegister(new(zone()) LAddI(left, right)); |
| 947 if (instr->CheckFlag(HValue::kCanOverflow)) { | 947 if (instr->CheckFlag(HValue::kCanOverflow)) { |
| 948 result = AssignEnvironment(result); | 948 result = AssignEnvironment(result); |
| 949 } | 949 } |
| 950 return result; | 950 return result; |
| 951 } else if (instr->representation().IsExternal()) { |
| 952 ASSERT(instr->left()->representation().IsExternal()); |
| 953 ASSERT(instr->right()->representation().IsInteger32()); |
| 954 ASSERT(!instr->CheckFlag(HValue::kCanOverflow)); |
| 955 LOperand* left = UseRegisterAtStart(instr->left()); |
| 956 LOperand* right = UseRegisterOrConstantAtStart(instr->right()); |
| 957 return DefineAsRegister(new(zone()) LAddI(left, right)); |
| 951 } else if (instr->representation().IsDouble()) { | 958 } else if (instr->representation().IsDouble()) { |
| 952 return DoArithmeticD(Token::ADD, instr); | 959 return DoArithmeticD(Token::ADD, instr); |
| 953 } else { | 960 } else { |
| 954 ASSERT(instr->representation().IsTagged()); | 961 ASSERT(instr->representation().IsTagged()); |
| 955 return DoArithmeticT(Token::ADD, instr); | 962 return DoArithmeticT(Token::ADD, instr); |
| 956 } | 963 } |
| 957 } | 964 } |
| 958 | 965 |
| 959 | 966 |
| 960 LInstruction* LChunkBuilder::DoAllocate(HAllocate* instr) { | 967 LInstruction* LChunkBuilder::DoAllocate(HAllocate* instr) { |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1356 // it will be loaded multiple times. Unfortunatly crankshaft already | 1363 // it will be loaded multiple times. Unfortunatly crankshaft already |
| 1357 // duplicates constant loads, but we should modify the code below once this | 1364 // duplicates constant loads, but we should modify the code below once this |
| 1358 // issue has been addressed in crankshaft. | 1365 // issue has been addressed in crankshaft. |
| 1359 LOperand* left = UseRegisterOrConstantAtStart(instr->left()); | 1366 LOperand* left = UseRegisterOrConstantAtStart(instr->left()); |
| 1360 LOperand* right = UseRegisterOrConstantAtStart(instr->right()); | 1367 LOperand* right = UseRegisterOrConstantAtStart(instr->right()); |
| 1361 return new(zone()) LCompareNumericAndBranch(left, right); | 1368 return new(zone()) LCompareNumericAndBranch(left, right); |
| 1362 } | 1369 } |
| 1363 } | 1370 } |
| 1364 | 1371 |
| 1365 | 1372 |
| 1366 // TODO(all): This will disappear when Math.random is rewritten in JavaScript. | |
| 1367 LInstruction* LChunkBuilder::DoRandom(HRandom* instr) { | |
| 1368 ASSERT(instr->representation().IsDouble()); | |
| 1369 ASSERT(instr->global_object()->representation().IsTagged()); | |
| 1370 LOperand* global_object = UseFixed(instr->global_object(), x0); | |
| 1371 LRandom* result = new(zone()) LRandom(global_object); | |
| 1372 return MarkAsCall(DefineFixedDouble(result, d7), instr); | |
| 1373 } | |
| 1374 | |
| 1375 | |
| 1376 LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) { | 1373 LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) { |
| 1377 ASSERT(instr->left()->representation().IsTagged()); | 1374 ASSERT(instr->left()->representation().IsTagged()); |
| 1378 ASSERT(instr->right()->representation().IsTagged()); | 1375 ASSERT(instr->right()->representation().IsTagged()); |
| 1379 LOperand* left = UseFixed(instr->left(), x1); | 1376 LOperand* left = UseFixed(instr->left(), x1); |
| 1380 LOperand* right = UseFixed(instr->right(), x0); | 1377 LOperand* right = UseFixed(instr->right(), x0); |
| 1381 LCmpT* result = new(zone()) LCmpT(left, right); | 1378 LCmpT* result = new(zone()) LCmpT(left, right); |
| 1382 return MarkAsCall(DefineFixed(result, x0), instr); | 1379 return MarkAsCall(DefineFixed(result, x0), instr); |
| 1383 } | 1380 } |
| 1384 | 1381 |
| 1385 | 1382 |
| (...skipping 1202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2588 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) { | 2585 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) { |
| 2589 LOperand* receiver = UseRegister(instr->receiver()); | 2586 LOperand* receiver = UseRegister(instr->receiver()); |
| 2590 LOperand* function = UseRegisterAtStart(instr->function()); | 2587 LOperand* function = UseRegisterAtStart(instr->function()); |
| 2591 LOperand* temp = TempRegister(); | 2588 LOperand* temp = TempRegister(); |
| 2592 LWrapReceiver* result = new(zone()) LWrapReceiver(receiver, function, temp); | 2589 LWrapReceiver* result = new(zone()) LWrapReceiver(receiver, function, temp); |
| 2593 return AssignEnvironment(DefineAsRegister(result)); | 2590 return AssignEnvironment(DefineAsRegister(result)); |
| 2594 } | 2591 } |
| 2595 | 2592 |
| 2596 | 2593 |
| 2597 } } // namespace v8::internal | 2594 } } // namespace v8::internal |
| OLD | NEW |