| 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 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1209 power = WhichPowerOf2(-divisor); | 1209 power = WhichPowerOf2(-divisor); |
| 1210 } | 1210 } |
| 1211 | 1211 |
| 1212 if (test_value != 0) { | 1212 if (test_value != 0) { |
| 1213 if (instr->hydrogen()->CheckFlag( | 1213 if (instr->hydrogen()->CheckFlag( |
| 1214 HInstruction::kAllUsesTruncatingToInt32)) { | 1214 HInstruction::kAllUsesTruncatingToInt32)) { |
| 1215 Label done, negative; | 1215 Label done, negative; |
| 1216 __ cmpl(dividend, Immediate(0)); | 1216 __ cmpl(dividend, Immediate(0)); |
| 1217 __ j(less, &negative, Label::kNear); | 1217 __ j(less, &negative, Label::kNear); |
| 1218 __ sarl(dividend, Immediate(power)); | 1218 __ sarl(dividend, Immediate(power)); |
| 1219 if (divisor < 0) __ negl(dividend); |
| 1219 __ jmp(&done, Label::kNear); | 1220 __ jmp(&done, Label::kNear); |
| 1220 | 1221 |
| 1221 __ bind(&negative); | 1222 __ bind(&negative); |
| 1222 __ negl(dividend); | 1223 __ negl(dividend); |
| 1223 __ sarl(dividend, Immediate(power)); | 1224 __ sarl(dividend, Immediate(power)); |
| 1224 if (divisor > 0) __ negl(dividend); | 1225 if (divisor > 0) __ negl(dividend); |
| 1225 __ bind(&done); | 1226 __ bind(&done); |
| 1226 return; // Don't fall through to "__ neg" below. | 1227 return; // Don't fall through to "__ neg" below. |
| 1227 } else { | 1228 } else { |
| 1228 // Deoptimize if remainder is not 0. | 1229 // Deoptimize if remainder is not 0. |
| (...skipping 4293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5522 FixedArray::kHeaderSize - kPointerSize)); | 5523 FixedArray::kHeaderSize - kPointerSize)); |
| 5523 __ bind(&done); | 5524 __ bind(&done); |
| 5524 } | 5525 } |
| 5525 | 5526 |
| 5526 | 5527 |
| 5527 #undef __ | 5528 #undef __ |
| 5528 | 5529 |
| 5529 } } // namespace v8::internal | 5530 } } // namespace v8::internal |
| 5530 | 5531 |
| 5531 #endif // V8_TARGET_ARCH_X64 | 5532 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |