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 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1122 __ sarl(dividend, Immediate(shift)); | 1122 __ sarl(dividend, Immediate(shift)); |
1123 return; | 1123 return; |
1124 } | 1124 } |
1125 | 1125 |
1126 // If the divisor is negative, we have to negate and handle edge cases. | 1126 // If the divisor is negative, we have to negate and handle edge cases. |
1127 Label not_kmin_int, done; | 1127 Label not_kmin_int, done; |
1128 __ negl(dividend); | 1128 __ negl(dividend); |
1129 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { | 1129 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { |
1130 DeoptimizeIf(zero, instr->environment()); | 1130 DeoptimizeIf(zero, instr->environment()); |
1131 } | 1131 } |
1132 if (instr->hydrogen()->left()->RangeCanInclude(kMinInt)) { | 1132 if (instr->hydrogen()->CheckFlag(HValue::kLeftCanBeMinInt)) { |
1133 // Note that we could emit branch-free code, but that would need one more | 1133 // Note that we could emit branch-free code, but that would need one more |
1134 // register. | 1134 // register. |
1135 __ j(no_overflow, ¬_kmin_int, Label::kNear); | 1135 __ j(no_overflow, ¬_kmin_int, Label::kNear); |
1136 if (divisor == -1) { | 1136 if (divisor == -1) { |
1137 DeoptimizeIf(no_condition, instr->environment()); | 1137 DeoptimizeIf(no_condition, instr->environment()); |
1138 } else { | 1138 } else { |
1139 __ movl(dividend, Immediate(kMinInt / divisor)); | 1139 __ movl(dividend, Immediate(kMinInt / divisor)); |
1140 __ jmp(&done, Label::kNear); | 1140 __ jmp(&done, Label::kNear); |
1141 } | 1141 } |
1142 } | 1142 } |
(...skipping 4496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5639 FixedArray::kHeaderSize - kPointerSize)); | 5639 FixedArray::kHeaderSize - kPointerSize)); |
5640 __ bind(&done); | 5640 __ bind(&done); |
5641 } | 5641 } |
5642 | 5642 |
5643 | 5643 |
5644 #undef __ | 5644 #undef __ |
5645 | 5645 |
5646 } } // namespace v8::internal | 5646 } } // namespace v8::internal |
5647 | 5647 |
5648 #endif // V8_TARGET_ARCH_X64 | 5648 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |