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

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

Issue 16857004: MIPS: Increase sanity of integer division handling. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « src/mips/code-stubs-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 1342 matching lines...) Expand 10 before | Expand all | Expand 10 after
1353 if (instr->HasNoUses()) return NULL; 1353 if (instr->HasNoUses()) return NULL;
1354 LOperand* value = UseRegisterAtStart(instr->value()); 1354 LOperand* value = UseRegisterAtStart(instr->value());
1355 return DefineAsRegister(new(zone()) LBitNotI(value)); 1355 return DefineAsRegister(new(zone()) LBitNotI(value));
1356 } 1356 }
1357 1357
1358 1358
1359 LInstruction* LChunkBuilder::DoDiv(HDiv* instr) { 1359 LInstruction* LChunkBuilder::DoDiv(HDiv* instr) {
1360 if (instr->representation().IsDouble()) { 1360 if (instr->representation().IsDouble()) {
1361 return DoArithmeticD(Token::DIV, instr); 1361 return DoArithmeticD(Token::DIV, instr);
1362 } else if (instr->representation().IsInteger32()) { 1362 } else if (instr->representation().IsInteger32()) {
1363 // TODO(1042) The fixed register allocation 1363 LOperand* dividend = UseRegister(instr->left());
1364 // is needed because we call TypeRecordingBinaryOpStub from 1364 LOperand* divisor = UseRegister(instr->right());
1365 // the generated code, which requires registers a0 1365 LDivI* div = new(zone()) LDivI(dividend, divisor);
1366 // and a1 to be used. We should remove that 1366 return AssignEnvironment(DefineAsRegister(div));
1367 // when we provide a native implementation.
1368 LOperand* dividend = UseFixed(instr->left(), a0);
1369 LOperand* divisor = UseFixed(instr->right(), a1);
1370 return AssignEnvironment(AssignPointerMap(
1371 DefineFixed(new(zone()) LDivI(dividend, divisor), v0)));
1372 } else { 1367 } else {
1373 return DoArithmeticT(Token::DIV, instr); 1368 return DoArithmeticT(Token::DIV, instr);
1374 } 1369 }
1375 } 1370 }
1376 1371
1377 1372
1378 LInstruction* LChunkBuilder::DoMathFloorOfDiv(HMathFloorOfDiv* instr) { 1373 LInstruction* LChunkBuilder::DoMathFloorOfDiv(HMathFloorOfDiv* instr) {
1379 UNIMPLEMENTED(); 1374 UNIMPLEMENTED();
1380 return NULL; 1375 return NULL;
1381 } 1376 }
(...skipping 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after
2527 2522
2528 2523
2529 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2524 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2530 LOperand* object = UseRegister(instr->object()); 2525 LOperand* object = UseRegister(instr->object());
2531 LOperand* index = UseRegister(instr->index()); 2526 LOperand* index = UseRegister(instr->index());
2532 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); 2527 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index));
2533 } 2528 }
2534 2529
2535 2530
2536 } } // namespace v8::internal 2531 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mips/code-stubs-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698