Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: src/mips/lithium-mips.cc

Issue 195893013: MIPS: Remove uses of RangeCanInclude() in flooring division by power of 2. (Closed) Base URL: https://github.com/v8/v8.git@gbl
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after
1273 return DoArithmeticD(Token::DIV, instr); 1273 return DoArithmeticD(Token::DIV, instr);
1274 } else { 1274 } else {
1275 return DoArithmeticT(Token::DIV, instr); 1275 return DoArithmeticT(Token::DIV, instr);
1276 } 1276 }
1277 } 1277 }
1278 1278
1279 1279
1280 LInstruction* LChunkBuilder::DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr) { 1280 LInstruction* LChunkBuilder::DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr) {
1281 LOperand* dividend = UseRegisterAtStart(instr->left()); 1281 LOperand* dividend = UseRegisterAtStart(instr->left());
1282 int32_t divisor = instr->right()->GetInteger32Constant(); 1282 int32_t divisor = instr->right()->GetInteger32Constant();
1283 LInstruction* result = 1283 LInstruction* result = DefineAsRegister(new(zone()) LFlooringDivByPowerOf2I(
1284 DefineSameAsFirst( 1284 dividend, divisor));
1285 new(zone()) LFlooringDivByPowerOf2I(dividend, divisor)); 1285 if ((instr->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) ||
1286 bool can_deopt = 1286 (instr->CheckFlag(HValue::kLeftCanBeMinInt) && divisor == -1)) {
1287 (instr->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) || 1287 result = AssignEnvironment(result);
1288 (instr->left()->RangeCanInclude(kMinInt) && divisor == -1); 1288 }
1289 return can_deopt ? AssignEnvironment(result) : result; 1289 return result;
1290 } 1290 }
1291 1291
1292 1292
1293 LInstruction* LChunkBuilder::DoFlooringDivByConstI(HMathFloorOfDiv* instr) { 1293 LInstruction* LChunkBuilder::DoFlooringDivByConstI(HMathFloorOfDiv* instr) {
1294 ASSERT(instr->representation().IsInteger32()); 1294 ASSERT(instr->representation().IsInteger32());
1295 ASSERT(instr->left()->representation().Equals(instr->representation())); 1295 ASSERT(instr->left()->representation().Equals(instr->representation()));
1296 ASSERT(instr->right()->representation().Equals(instr->representation())); 1296 ASSERT(instr->right()->representation().Equals(instr->representation()));
1297 LOperand* dividend = UseRegister(instr->left()); 1297 LOperand* dividend = UseRegister(instr->left());
1298 int32_t divisor = instr->right()->GetInteger32Constant(); 1298 int32_t divisor = instr->right()->GetInteger32Constant();
1299 LInstruction* result = 1299 LInstruction* result =
(...skipping 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after
2435 2435
2436 2436
2437 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2437 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2438 LOperand* object = UseRegister(instr->object()); 2438 LOperand* object = UseRegister(instr->object());
2439 LOperand* index = UseRegister(instr->index()); 2439 LOperand* index = UseRegister(instr->index());
2440 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); 2440 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index));
2441 } 2441 }
2442 2442
2443 2443
2444 } } // namespace v8::internal 2444 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698