| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
| 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 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1059 | 1059 |
| 1060 void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) { | 1060 void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) { |
| 1061 GenerateOsrPrologue(); | 1061 GenerateOsrPrologue(); |
| 1062 } | 1062 } |
| 1063 | 1063 |
| 1064 | 1064 |
| 1065 void LCodeGen::DoModI(LModI* instr) { | 1065 void LCodeGen::DoModI(LModI* instr) { |
| 1066 HMod* hmod = instr->hydrogen(); | 1066 HMod* hmod = instr->hydrogen(); |
| 1067 HValue* left = hmod->left(); | 1067 HValue* left = hmod->left(); |
| 1068 HValue* right = hmod->right(); | 1068 HValue* right = hmod->right(); |
| 1069 if (hmod->HasPowerOf2Divisor()) { | 1069 if (hmod->RightIsPowerOf2()) { |
| 1070 const Register left_reg = ToRegister(instr->left()); | 1070 const Register left_reg = ToRegister(instr->left()); |
| 1071 const Register result_reg = ToRegister(instr->result()); | 1071 const Register result_reg = ToRegister(instr->result()); |
| 1072 | 1072 |
| 1073 // Note: The code below even works when right contains kMinInt. | 1073 // Note: The code below even works when right contains kMinInt. |
| 1074 int32_t divisor = Abs(right->GetInteger32Constant()); | 1074 int32_t divisor = Abs(right->GetInteger32Constant()); |
| 1075 | 1075 |
| 1076 Label left_is_not_negative, done; | 1076 Label left_is_not_negative, done; |
| 1077 if (left->CanBeNegative()) { | 1077 if (left->CanBeNegative()) { |
| 1078 __ Branch(left_reg.is(result_reg) ? PROTECT : USE_DELAY_SLOT, | 1078 __ Branch(left_reg.is(result_reg) ? PROTECT : USE_DELAY_SLOT, |
| 1079 &left_is_not_negative, ge, left_reg, Operand(zero_reg)); | 1079 &left_is_not_negative, ge, left_reg, Operand(zero_reg)); |
| (...skipping 4736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5816 __ Subu(scratch, result, scratch); | 5816 __ Subu(scratch, result, scratch); |
| 5817 __ lw(result, FieldMemOperand(scratch, | 5817 __ lw(result, FieldMemOperand(scratch, |
| 5818 FixedArray::kHeaderSize - kPointerSize)); | 5818 FixedArray::kHeaderSize - kPointerSize)); |
| 5819 __ bind(&done); | 5819 __ bind(&done); |
| 5820 } | 5820 } |
| 5821 | 5821 |
| 5822 | 5822 |
| 5823 #undef __ | 5823 #undef __ |
| 5824 | 5824 |
| 5825 } } // namespace v8::internal | 5825 } } // namespace v8::internal |
| OLD | NEW |