| 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 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1216 if (hmod->CheckFlag(HValue::kBailoutOnMinusZero)) { | 1216 if (hmod->CheckFlag(HValue::kBailoutOnMinusZero)) { |
| 1217 DeoptimizeIf(zero, instr->environment()); | 1217 DeoptimizeIf(zero, instr->environment()); |
| 1218 } | 1218 } |
| 1219 __ jmp(&done, Label::kNear); | 1219 __ jmp(&done, Label::kNear); |
| 1220 } | 1220 } |
| 1221 | 1221 |
| 1222 __ bind(&left_is_not_negative); | 1222 __ bind(&left_is_not_negative); |
| 1223 __ and_(left_reg, divisor - 1); | 1223 __ and_(left_reg, divisor - 1); |
| 1224 __ bind(&done); | 1224 __ bind(&done); |
| 1225 | 1225 |
| 1226 } else if (hmod->has_fixed_right_arg()) { | 1226 } else if (hmod->fixed_right_arg().has_value) { |
| 1227 Register left_reg = ToRegister(instr->left()); | 1227 Register left_reg = ToRegister(instr->left()); |
| 1228 ASSERT(left_reg.is(ToRegister(instr->result()))); | 1228 ASSERT(left_reg.is(ToRegister(instr->result()))); |
| 1229 Register right_reg = ToRegister(instr->right()); | 1229 Register right_reg = ToRegister(instr->right()); |
| 1230 | 1230 |
| 1231 int32_t divisor = hmod->fixed_right_arg_value(); | 1231 int32_t divisor = hmod->fixed_right_arg().value; |
| 1232 ASSERT(IsPowerOf2(divisor)); | 1232 ASSERT(IsPowerOf2(divisor)); |
| 1233 | 1233 |
| 1234 // Check if our assumption of a fixed right operand still holds. | 1234 // Check if our assumption of a fixed right operand still holds. |
| 1235 __ cmp(right_reg, Immediate(divisor)); | 1235 __ cmp(right_reg, Immediate(divisor)); |
| 1236 DeoptimizeIf(not_equal, instr->environment()); | 1236 DeoptimizeIf(not_equal, instr->environment()); |
| 1237 | 1237 |
| 1238 Label left_is_not_negative, done; | 1238 Label left_is_not_negative, done; |
| 1239 if (left->CanBeNegative()) { | 1239 if (left->CanBeNegative()) { |
| 1240 __ test(left_reg, Operand(left_reg)); | 1240 __ test(left_reg, Operand(left_reg)); |
| 1241 __ j(not_sign, &left_is_not_negative, Label::kNear); | 1241 __ j(not_sign, &left_is_not_negative, Label::kNear); |
| (...skipping 5303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6545 FixedArray::kHeaderSize - kPointerSize)); | 6545 FixedArray::kHeaderSize - kPointerSize)); |
| 6546 __ bind(&done); | 6546 __ bind(&done); |
| 6547 } | 6547 } |
| 6548 | 6548 |
| 6549 | 6549 |
| 6550 #undef __ | 6550 #undef __ |
| 6551 | 6551 |
| 6552 } } // namespace v8::internal | 6552 } } // namespace v8::internal |
| 6553 | 6553 |
| 6554 #endif // V8_TARGET_ARCH_IA32 | 6554 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |