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 1475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1486 } | 1486 } |
1487 __ idiv(right_reg); | 1487 __ idiv(right_reg); |
1488 __ bind(&done); | 1488 __ bind(&done); |
1489 } | 1489 } |
1490 | 1490 |
1491 | 1491 |
1492 void LCodeGen::DoDivByPowerOf2I(LDivByPowerOf2I* instr) { | 1492 void LCodeGen::DoDivByPowerOf2I(LDivByPowerOf2I* instr) { |
1493 Register dividend = ToRegister(instr->dividend()); | 1493 Register dividend = ToRegister(instr->dividend()); |
1494 int32_t divisor = instr->divisor(); | 1494 int32_t divisor = instr->divisor(); |
1495 Register result = ToRegister(instr->result()); | 1495 Register result = ToRegister(instr->result()); |
1496 ASSERT(divisor == kMinInt || (divisor != 0 && IsPowerOf2(Abs(divisor)))); | 1496 ASSERT(divisor == kMinInt || IsPowerOf2(Abs(divisor))); |
1497 ASSERT(!result.is(dividend)); | 1497 ASSERT(!result.is(dividend)); |
1498 | 1498 |
1499 // Check for (0 / -x) that will produce negative zero. | 1499 // Check for (0 / -x) that will produce negative zero. |
1500 HDiv* hdiv = instr->hydrogen(); | 1500 HDiv* hdiv = instr->hydrogen(); |
1501 if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) { | 1501 if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) { |
1502 __ test(dividend, dividend); | 1502 __ test(dividend, dividend); |
1503 DeoptimizeIf(zero, instr->environment()); | 1503 DeoptimizeIf(zero, instr->environment()); |
1504 } | 1504 } |
1505 // Check for (kMinInt / -1). | 1505 // Check for (kMinInt / -1). |
1506 if (hdiv->CheckFlag(HValue::kCanOverflow) && divisor == -1) { | 1506 if (hdiv->CheckFlag(HValue::kCanOverflow) && divisor == -1) { |
(...skipping 4885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6392 __ bind(deferred->exit()); | 6392 __ bind(deferred->exit()); |
6393 __ bind(&done); | 6393 __ bind(&done); |
6394 } | 6394 } |
6395 | 6395 |
6396 | 6396 |
6397 #undef __ | 6397 #undef __ |
6398 | 6398 |
6399 } } // namespace v8::internal | 6399 } } // namespace v8::internal |
6400 | 6400 |
6401 #endif // V8_TARGET_ARCH_IA32 | 6401 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |