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

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, 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 | 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 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after
1305 LOperand* dividend = UseFixed(instr->left(), a0); 1305 LOperand* dividend = UseFixed(instr->left(), a0);
1306 LOperand* divisor = UseFixed(instr->right(), a1); 1306 LOperand* divisor = UseFixed(instr->right(), a1);
1307 return AssignEnvironment(AssignPointerMap( 1307 return AssignEnvironment(AssignPointerMap(
1308 DefineFixed(new(zone()) LDivI(dividend, divisor), v0))); 1308 DefineFixed(new(zone()) LDivI(dividend, divisor), v0)));
1309 } else { 1309 } else {
1310 return DoArithmeticT(Token::DIV, instr); 1310 return DoArithmeticT(Token::DIV, instr);
1311 } 1311 }
1312 } 1312 }
1313 1313
1314 1314
1315 LInstruction* LChunkBuilder::DoMathFloorOfDiv(HMathFloorOfDiv* instr) {
1316 UNIMPLEMENTED();
1317 return NULL;
1318 }
1319
1320
1315 LInstruction* LChunkBuilder::DoMod(HMod* instr) { 1321 LInstruction* LChunkBuilder::DoMod(HMod* instr) {
1316 if (instr->representation().IsInteger32()) { 1322 if (instr->representation().IsInteger32()) {
1317 ASSERT(instr->left()->representation().IsInteger32()); 1323 ASSERT(instr->left()->representation().IsInteger32());
1318 ASSERT(instr->right()->representation().IsInteger32()); 1324 ASSERT(instr->right()->representation().IsInteger32());
1319 1325
1320 LModI* mod; 1326 LModI* mod;
1321 if (instr->HasPowerOf2Divisor()) { 1327 if (instr->HasPowerOf2Divisor()) {
1322 ASSERT(!instr->CheckFlag(HValue::kCanBeDivByZero)); 1328 ASSERT(!instr->CheckFlag(HValue::kCanBeDivByZero));
1323 LOperand* value = UseRegisterAtStart(instr->left()); 1329 LOperand* value = UseRegisterAtStart(instr->left());
1324 mod = new(zone()) LModI(value, UseOrConstant(instr->right())); 1330 mod = new(zone()) LModI(value, UseOrConstant(instr->right()));
(...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after
2306 2312
2307 2313
2308 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2314 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2309 LOperand* object = UseRegister(instr->object()); 2315 LOperand* object = UseRegister(instr->object());
2310 LOperand* index = UseRegister(instr->index()); 2316 LOperand* index = UseRegister(instr->index());
2311 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); 2317 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index));
2312 } 2318 }
2313 2319
2314 2320
2315 } } // namespace v8::internal 2321 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698