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 1433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1444 // The temporary operand is necessary to ensure that right is not | 1444 // The temporary operand is necessary to ensure that right is not |
1445 // allocated into edx. | 1445 // allocated into edx. |
1446 LOperand* temp = FixedTemp(rdx); | 1446 LOperand* temp = FixedTemp(rdx); |
1447 LOperand* value = UseFixed(instr->left(), rax); | 1447 LOperand* value = UseFixed(instr->left(), rax); |
1448 LOperand* divisor = UseRegister(instr->right()); | 1448 LOperand* divisor = UseRegister(instr->right()); |
1449 LModI* mod = new(zone()) LModI(value, divisor, temp); | 1449 LModI* mod = new(zone()) LModI(value, divisor, temp); |
1450 result = DefineFixed(mod, rdx); | 1450 result = DefineFixed(mod, rdx); |
1451 } | 1451 } |
1452 | 1452 |
1453 return (instr->CheckFlag(HValue::kBailoutOnMinusZero) || | 1453 return (instr->CheckFlag(HValue::kBailoutOnMinusZero) || |
1454 instr->CheckFlag(HValue::kCanBeDivByZero)) | 1454 instr->CheckFlag(HValue::kCanBeDivByZero) || |
| 1455 instr->CheckFlag(HValue::kCanOverflow)) |
1455 ? AssignEnvironment(result) | 1456 ? AssignEnvironment(result) |
1456 : result; | 1457 : result; |
1457 } else if (instr->representation().IsTagged()) { | 1458 } else if (instr->representation().IsTagged()) { |
1458 return DoArithmeticT(Token::MOD, instr); | 1459 return DoArithmeticT(Token::MOD, instr); |
1459 } else { | 1460 } else { |
1460 ASSERT(instr->representation().IsDouble()); | 1461 ASSERT(instr->representation().IsDouble()); |
1461 // We call a C function for double modulo. It can't trigger a GC. | 1462 // We call a C function for double modulo. It can't trigger a GC. |
1462 // We need to use fixed result register for the call. | 1463 // We need to use fixed result register for the call. |
1463 // TODO(fschneider): Allow any register as input registers. | 1464 // TODO(fschneider): Allow any register as input registers. |
1464 LOperand* left = UseFixedDouble(instr->left(), xmm2); | 1465 LOperand* left = UseFixedDouble(instr->left(), xmm2); |
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2557 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2558 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2558 LOperand* object = UseRegister(instr->object()); | 2559 LOperand* object = UseRegister(instr->object()); |
2559 LOperand* index = UseTempRegister(instr->index()); | 2560 LOperand* index = UseTempRegister(instr->index()); |
2560 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2561 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
2561 } | 2562 } |
2562 | 2563 |
2563 | 2564 |
2564 } } // namespace v8::internal | 2565 } } // namespace v8::internal |
2565 | 2566 |
2566 #endif // V8_TARGET_ARCH_X64 | 2567 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |