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 1298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1309 return DoArithmeticD(Token::DIV, instr); | 1309 return DoArithmeticD(Token::DIV, instr); |
1310 } else { | 1310 } else { |
1311 return DoArithmeticT(Token::DIV, instr); | 1311 return DoArithmeticT(Token::DIV, instr); |
1312 } | 1312 } |
1313 } | 1313 } |
1314 | 1314 |
1315 | 1315 |
1316 LInstruction* LChunkBuilder::DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr) { | 1316 LInstruction* LChunkBuilder::DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr) { |
1317 LOperand* dividend = UseRegisterAtStart(instr->left()); | 1317 LOperand* dividend = UseRegisterAtStart(instr->left()); |
1318 int32_t divisor = instr->right()->GetInteger32Constant(); | 1318 int32_t divisor = instr->right()->GetInteger32Constant(); |
1319 LInstruction* result = | 1319 LInstruction* result = DefineAsRegister(new(zone()) LFlooringDivByPowerOf2I( |
1320 DefineSameAsFirst( | 1320 dividend, divisor)); |
1321 new(zone()) LFlooringDivByPowerOf2I(dividend, divisor)); | 1321 if ((instr->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) || |
1322 bool can_deopt = | 1322 (instr->CheckFlag(HValue::kLeftCanBeMinInt) && divisor == -1)) { |
1323 (instr->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) || | 1323 result = AssignEnvironment(result); |
1324 (instr->left()->RangeCanInclude(kMinInt) && divisor == -1); | 1324 } |
1325 return can_deopt ? AssignEnvironment(result) : result; | 1325 return result; |
1326 } | 1326 } |
1327 | 1327 |
1328 | 1328 |
1329 LInstruction* LChunkBuilder::DoFlooringDivByConstI(HMathFloorOfDiv* instr) { | 1329 LInstruction* LChunkBuilder::DoFlooringDivByConstI(HMathFloorOfDiv* instr) { |
1330 ASSERT(instr->representation().IsInteger32()); | 1330 ASSERT(instr->representation().IsInteger32()); |
1331 ASSERT(instr->left()->representation().Equals(instr->representation())); | 1331 ASSERT(instr->left()->representation().Equals(instr->representation())); |
1332 ASSERT(instr->right()->representation().Equals(instr->representation())); | 1332 ASSERT(instr->right()->representation().Equals(instr->representation())); |
1333 LOperand* dividend = UseRegister(instr->left()); | 1333 LOperand* dividend = UseRegister(instr->left()); |
1334 int32_t divisor = instr->right()->GetInteger32Constant(); | 1334 int32_t divisor = instr->right()->GetInteger32Constant(); |
1335 LInstruction* result = | 1335 LInstruction* result = |
(...skipping 1194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2530 } | 2530 } |
2531 | 2531 |
2532 | 2532 |
2533 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2533 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2534 LOperand* object = UseRegister(instr->object()); | 2534 LOperand* object = UseRegister(instr->object()); |
2535 LOperand* index = UseRegister(instr->index()); | 2535 LOperand* index = UseRegister(instr->index()); |
2536 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2536 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
2537 } | 2537 } |
2538 | 2538 |
2539 } } // namespace v8::internal | 2539 } } // namespace v8::internal |
OLD | NEW |