| 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 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1027 if (hmod->CheckFlag(HValue::kBailoutOnMinusZero)) { | 1027 if (hmod->CheckFlag(HValue::kBailoutOnMinusZero)) { |
| 1028 DeoptimizeIf(zero, instr->environment()); | 1028 DeoptimizeIf(zero, instr->environment()); |
| 1029 } | 1029 } |
| 1030 __ jmp(&done, Label::kNear); | 1030 __ jmp(&done, Label::kNear); |
| 1031 } | 1031 } |
| 1032 | 1032 |
| 1033 __ bind(&left_is_not_negative); | 1033 __ bind(&left_is_not_negative); |
| 1034 __ andl(left_reg, Immediate(divisor - 1)); | 1034 __ andl(left_reg, Immediate(divisor - 1)); |
| 1035 __ bind(&done); | 1035 __ bind(&done); |
| 1036 | 1036 |
| 1037 } else if (hmod->has_fixed_right_arg()) { | 1037 } else if (hmod->fixed_right_arg().has_value) { |
| 1038 Register left_reg = ToRegister(instr->left()); | 1038 Register left_reg = ToRegister(instr->left()); |
| 1039 ASSERT(left_reg.is(ToRegister(instr->result()))); | 1039 ASSERT(left_reg.is(ToRegister(instr->result()))); |
| 1040 Register right_reg = ToRegister(instr->right()); | 1040 Register right_reg = ToRegister(instr->right()); |
| 1041 | 1041 |
| 1042 int32_t divisor = hmod->fixed_right_arg_value(); | 1042 int32_t divisor = hmod->fixed_right_arg().value; |
| 1043 ASSERT(IsPowerOf2(divisor)); | 1043 ASSERT(IsPowerOf2(divisor)); |
| 1044 | 1044 |
| 1045 // Check if our assumption of a fixed right operand still holds. | 1045 // Check if our assumption of a fixed right operand still holds. |
| 1046 __ cmpl(right_reg, Immediate(divisor)); | 1046 __ cmpl(right_reg, Immediate(divisor)); |
| 1047 DeoptimizeIf(not_equal, instr->environment()); | 1047 DeoptimizeIf(not_equal, instr->environment()); |
| 1048 | 1048 |
| 1049 Label left_is_not_negative, done; | 1049 Label left_is_not_negative, done; |
| 1050 if (left->CanBeNegative()) { | 1050 if (left->CanBeNegative()) { |
| 1051 __ testl(left_reg, left_reg); | 1051 __ testl(left_reg, left_reg); |
| 1052 __ j(not_sign, &left_is_not_negative, Label::kNear); | 1052 __ j(not_sign, &left_is_not_negative, Label::kNear); |
| (...skipping 4593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5646 FixedArray::kHeaderSize - kPointerSize)); | 5646 FixedArray::kHeaderSize - kPointerSize)); |
| 5647 __ bind(&done); | 5647 __ bind(&done); |
| 5648 } | 5648 } |
| 5649 | 5649 |
| 5650 | 5650 |
| 5651 #undef __ | 5651 #undef __ |
| 5652 | 5652 |
| 5653 } } // namespace v8::internal | 5653 } } // namespace v8::internal |
| 5654 | 5654 |
| 5655 #endif // V8_TARGET_ARCH_X64 | 5655 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |