| 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 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1147 if (hmod->CheckFlag(HValue::kBailoutOnMinusZero)) { | 1147 if (hmod->CheckFlag(HValue::kBailoutOnMinusZero)) { |
| 1148 DeoptimizeIf(eq, instr->environment()); | 1148 DeoptimizeIf(eq, instr->environment()); |
| 1149 } | 1149 } |
| 1150 __ b(&done); | 1150 __ b(&done); |
| 1151 } | 1151 } |
| 1152 | 1152 |
| 1153 __ bind(&left_is_not_negative); | 1153 __ bind(&left_is_not_negative); |
| 1154 __ and_(result_reg, left_reg, Operand(divisor - 1)); | 1154 __ and_(result_reg, left_reg, Operand(divisor - 1)); |
| 1155 __ bind(&done); | 1155 __ bind(&done); |
| 1156 | 1156 |
| 1157 } else if (hmod->has_fixed_right_arg()) { | 1157 } else if (hmod->fixed_right_arg().has_value) { |
| 1158 Register left_reg = ToRegister(instr->left()); | 1158 Register left_reg = ToRegister(instr->left()); |
| 1159 Register right_reg = ToRegister(instr->right()); | 1159 Register right_reg = ToRegister(instr->right()); |
| 1160 Register result_reg = ToRegister(instr->result()); | 1160 Register result_reg = ToRegister(instr->result()); |
| 1161 | 1161 |
| 1162 int32_t divisor = hmod->fixed_right_arg_value(); | 1162 int32_t divisor = hmod->fixed_right_arg().value; |
| 1163 ASSERT(IsPowerOf2(divisor)); | 1163 ASSERT(IsPowerOf2(divisor)); |
| 1164 | 1164 |
| 1165 // Check if our assumption of a fixed right operand still holds. | 1165 // Check if our assumption of a fixed right operand still holds. |
| 1166 __ cmp(right_reg, Operand(divisor)); | 1166 __ cmp(right_reg, Operand(divisor)); |
| 1167 DeoptimizeIf(ne, instr->environment()); | 1167 DeoptimizeIf(ne, instr->environment()); |
| 1168 | 1168 |
| 1169 Label left_is_not_negative, done; | 1169 Label left_is_not_negative, done; |
| 1170 if (left->CanBeNegative()) { | 1170 if (left->CanBeNegative()) { |
| 1171 __ cmp(left_reg, Operand::Zero()); | 1171 __ cmp(left_reg, Operand::Zero()); |
| 1172 __ b(pl, &left_is_not_negative); | 1172 __ b(pl, &left_is_not_negative); |
| (...skipping 4732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5905 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5905 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
| 5906 __ ldr(result, FieldMemOperand(scratch, | 5906 __ ldr(result, FieldMemOperand(scratch, |
| 5907 FixedArray::kHeaderSize - kPointerSize)); | 5907 FixedArray::kHeaderSize - kPointerSize)); |
| 5908 __ bind(&done); | 5908 __ bind(&done); |
| 5909 } | 5909 } |
| 5910 | 5910 |
| 5911 | 5911 |
| 5912 #undef __ | 5912 #undef __ |
| 5913 | 5913 |
| 5914 } } // namespace v8::internal | 5914 } } // namespace v8::internal |
| OLD | NEW |