| 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 1313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1324 } | 1324 } |
| 1325 } | 1325 } |
| 1326 | 1326 |
| 1327 | 1327 |
| 1328 // TODO(svenpanne) Refactor this to avoid code duplication with DoFlooringDivI. | 1328 // TODO(svenpanne) Refactor this to avoid code duplication with DoFlooringDivI. |
| 1329 void LCodeGen::DoDivI(LDivI* instr) { | 1329 void LCodeGen::DoDivI(LDivI* instr) { |
| 1330 HBinaryOperation* hdiv = instr->hydrogen(); | 1330 HBinaryOperation* hdiv = instr->hydrogen(); |
| 1331 Register dividend = ToRegister(instr->dividend()); | 1331 Register dividend = ToRegister(instr->dividend()); |
| 1332 Register divisor = ToRegister(instr->divisor()); | 1332 Register divisor = ToRegister(instr->divisor()); |
| 1333 Register remainder = ToRegister(instr->temp()); | 1333 Register remainder = ToRegister(instr->temp()); |
| 1334 Register result = ToRegister(instr->result()); | |
| 1335 ASSERT(dividend.is(rax)); | 1334 ASSERT(dividend.is(rax)); |
| 1336 ASSERT(remainder.is(rdx)); | 1335 ASSERT(remainder.is(rdx)); |
| 1337 ASSERT(result.is(rax)); | 1336 ASSERT(ToRegister(instr->result()).is(rax)); |
| 1338 ASSERT(!divisor.is(rax)); | 1337 ASSERT(!divisor.is(rax)); |
| 1339 ASSERT(!divisor.is(rdx)); | 1338 ASSERT(!divisor.is(rdx)); |
| 1340 | 1339 |
| 1341 // Check for x / 0. | 1340 // Check for x / 0. |
| 1342 if (hdiv->CheckFlag(HValue::kCanBeDivByZero)) { | 1341 if (hdiv->CheckFlag(HValue::kCanBeDivByZero)) { |
| 1343 __ testl(divisor, divisor); | 1342 __ testl(divisor, divisor); |
| 1344 DeoptimizeIf(zero, instr->environment()); | 1343 DeoptimizeIf(zero, instr->environment()); |
| 1345 } | 1344 } |
| 1346 | 1345 |
| 1347 // Check for (0 / -x) that will produce negative zero. | 1346 // Check for (0 / -x) that will produce negative zero. |
| (...skipping 4331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5679 __ bind(deferred->exit()); | 5678 __ bind(deferred->exit()); |
| 5680 __ bind(&done); | 5679 __ bind(&done); |
| 5681 } | 5680 } |
| 5682 | 5681 |
| 5683 | 5682 |
| 5684 #undef __ | 5683 #undef __ |
| 5685 | 5684 |
| 5686 } } // namespace v8::internal | 5685 } } // namespace v8::internal |
| 5687 | 5686 |
| 5688 #endif // V8_TARGET_ARCH_X64 | 5687 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |