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

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

Issue 16973002: Make MathFloorOfDiv optimization trigger more often (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix typo 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/x64/lithium-x64.h ('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 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after
1379 LOperand* divisor = UseRegister(instr->right()); 1379 LOperand* divisor = UseRegister(instr->right());
1380 LDivI* result = new(zone()) LDivI(dividend, divisor, temp); 1380 LDivI* result = new(zone()) LDivI(dividend, divisor, temp);
1381 return AssignEnvironment(DefineFixed(result, rax)); 1381 return AssignEnvironment(DefineFixed(result, rax));
1382 } else { 1382 } else {
1383 ASSERT(instr->representation().IsSmiOrTagged()); 1383 ASSERT(instr->representation().IsSmiOrTagged());
1384 return DoArithmeticT(Token::DIV, instr); 1384 return DoArithmeticT(Token::DIV, instr);
1385 } 1385 }
1386 } 1386 }
1387 1387
1388 1388
1389 HValue* LChunkBuilder::SimplifiedDividendForMathFloorOfDiv(HValue* dividend) {
1390 // A value with an integer representation does not need to be transformed.
1391 if (dividend->representation().IsInteger32()) {
1392 return dividend;
1393 // A change from an integer32 can be replaced by the integer32 value.
1394 } else if (dividend->IsChange() &&
1395 HChange::cast(dividend)->from().IsInteger32()) {
1396 return HChange::cast(dividend)->value();
1397 }
1398 return NULL;
1399 }
1400
1401
1402 HValue* LChunkBuilder::SimplifiedDivisorForMathFloorOfDiv(HValue* divisor) { 1389 HValue* LChunkBuilder::SimplifiedDivisorForMathFloorOfDiv(HValue* divisor) {
1403 if (divisor->IsConstant() && 1390 if (divisor->IsConstant() &&
1404 HConstant::cast(divisor)->HasInteger32Value()) { 1391 HConstant::cast(divisor)->HasInteger32Value()) {
1405 HConstant* constant_val = HConstant::cast(divisor); 1392 HConstant* constant_val = HConstant::cast(divisor);
1406 return constant_val->CopyToRepresentation(Representation::Integer32(), 1393 return constant_val->CopyToRepresentation(Representation::Integer32(),
1407 divisor->block()->zone()); 1394 divisor->block()->zone());
1408 } 1395 }
1409 // A value with an integer representation does not need to be transformed. 1396 // A value with an integer representation does not need to be transformed.
1410 if (divisor->representation().IsInteger32()) { 1397 if (divisor->representation().IsInteger32()) {
1411 return divisor; 1398 return divisor;
(...skipping 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after
2604 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2591 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2605 LOperand* object = UseRegister(instr->object()); 2592 LOperand* object = UseRegister(instr->object());
2606 LOperand* index = UseTempRegister(instr->index()); 2593 LOperand* index = UseTempRegister(instr->index());
2607 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2594 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2608 } 2595 }
2609 2596
2610 2597
2611 } } // namespace v8::internal 2598 } } // namespace v8::internal
2612 2599
2613 #endif // V8_TARGET_ARCH_X64 2600 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/lithium-x64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698