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 1540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1551 if (instr->HasPowerOf2Divisor()) { | 1551 if (instr->HasPowerOf2Divisor()) { |
1552 ASSERT(!right->CanBeZero()); | 1552 ASSERT(!right->CanBeZero()); |
1553 LModI* mod = new(zone()) LModI(UseRegisterAtStart(left), | 1553 LModI* mod = new(zone()) LModI(UseRegisterAtStart(left), |
1554 UseOrConstant(right), | 1554 UseOrConstant(right), |
1555 NULL); | 1555 NULL); |
1556 LInstruction* result = DefineSameAsFirst(mod); | 1556 LInstruction* result = DefineSameAsFirst(mod); |
1557 return (left->CanBeNegative() && | 1557 return (left->CanBeNegative() && |
1558 instr->CheckFlag(HValue::kBailoutOnMinusZero)) | 1558 instr->CheckFlag(HValue::kBailoutOnMinusZero)) |
1559 ? AssignEnvironment(result) | 1559 ? AssignEnvironment(result) |
1560 : result; | 1560 : result; |
1561 } else if (instr->fixed_right_arg().has_value) { | |
1562 LModI* mod = new(zone()) LModI(UseRegister(left), | |
1563 UseRegisterAtStart(right), | |
1564 NULL); | |
1565 return AssignEnvironment(DefineSameAsFirst(mod)); | 1561 return AssignEnvironment(DefineSameAsFirst(mod)); |
1566 } else { | 1562 } else { |
1567 // The temporary operand is necessary to ensure that right is not | 1563 // The temporary operand is necessary to ensure that right is not |
1568 // allocated into edx. | 1564 // allocated into edx. |
1569 LModI* mod = new(zone()) LModI(UseFixed(left, eax), | 1565 LModI* mod = new(zone()) LModI(UseFixed(left, eax), |
1570 UseRegister(right), | 1566 UseRegister(right), |
1571 FixedTemp(edx)); | 1567 FixedTemp(edx)); |
1572 LInstruction* result = DefineFixed(mod, edx); | 1568 LInstruction* result = DefineFixed(mod, edx); |
1573 return (right->CanBeZero() || | 1569 return (right->CanBeZero() || |
1574 (left->RangeCanInclude(kMinInt) && | 1570 (left->RangeCanInclude(kMinInt) && |
(...skipping 1215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2790 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2786 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2791 LOperand* object = UseRegister(instr->object()); | 2787 LOperand* object = UseRegister(instr->object()); |
2792 LOperand* index = UseTempRegister(instr->index()); | 2788 LOperand* index = UseTempRegister(instr->index()); |
2793 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2789 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
2794 } | 2790 } |
2795 | 2791 |
2796 | 2792 |
2797 } } // namespace v8::internal | 2793 } } // namespace v8::internal |
2798 | 2794 |
2799 #endif // V8_TARGET_ARCH_IA32 | 2795 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |