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

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

Issue 9638018: [v8-dev] Optimise Math.floor(x/y) to use integer division for specific divisor.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 8 years, 8 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
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 1302 matching lines...) Expand 10 before | Expand all | Expand 10 after
1313 LOperand* dividend = UseFixed(instr->left(), a0); 1313 LOperand* dividend = UseFixed(instr->left(), a0);
1314 LOperand* divisor = UseFixed(instr->right(), a1); 1314 LOperand* divisor = UseFixed(instr->right(), a1);
1315 return AssignEnvironment(AssignPointerMap( 1315 return AssignEnvironment(AssignPointerMap(
1316 DefineFixed(new(zone()) LDivI(dividend, divisor), v0))); 1316 DefineFixed(new(zone()) LDivI(dividend, divisor), v0)));
1317 } else { 1317 } else {
1318 return DoArithmeticT(Token::DIV, instr); 1318 return DoArithmeticT(Token::DIV, instr);
1319 } 1319 }
1320 } 1320 }
1321 1321
1322 1322
1323 LInstruction* LChunkBuilder::DoMathFloorOfDiv(HMathFloorOfDiv* instr) {
1324 UNIMPLEMENTED();
1325 return NULL;
1326 }
1327
1328
1323 LInstruction* LChunkBuilder::DoMod(HMod* instr) { 1329 LInstruction* LChunkBuilder::DoMod(HMod* instr) {
1324 if (instr->representation().IsInteger32()) { 1330 if (instr->representation().IsInteger32()) {
1325 ASSERT(instr->left()->representation().IsInteger32()); 1331 ASSERT(instr->left()->representation().IsInteger32());
1326 ASSERT(instr->right()->representation().IsInteger32()); 1332 ASSERT(instr->right()->representation().IsInteger32());
1327 1333
1328 LModI* mod; 1334 LModI* mod;
1329 if (instr->HasPowerOf2Divisor()) { 1335 if (instr->HasPowerOf2Divisor()) {
1330 ASSERT(!instr->CheckFlag(HValue::kCanBeDivByZero)); 1336 ASSERT(!instr->CheckFlag(HValue::kCanBeDivByZero));
1331 LOperand* value = UseRegisterAtStart(instr->left()); 1337 LOperand* value = UseRegisterAtStart(instr->left());
1332 mod = new(zone()) LModI(value, UseOrConstant(instr->right())); 1338 mod = new(zone()) LModI(value, UseOrConstant(instr->right()));
(...skipping 988 matching lines...) Expand 10 before | Expand all | Expand 10 after
2321 2327
2322 2328
2323 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2329 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2324 LOperand* object = UseRegister(instr->object()); 2330 LOperand* object = UseRegister(instr->object());
2325 LOperand* index = UseRegister(instr->index()); 2331 LOperand* index = UseRegister(instr->index());
2326 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); 2332 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index));
2327 } 2333 }
2328 2334
2329 2335
2330 } } // namespace v8::internal 2336 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698