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

Side by Side Diff: src/ia32/lithium-ia32.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/ia32/lithium-ia32.h ('k') | src/x64/lithium-x64.h » ('j') | 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 1453 matching lines...) Expand 10 before | Expand all | Expand 10 after
1464 LOperand* divisor = UseRegister(instr->right()); 1464 LOperand* divisor = UseRegister(instr->right());
1465 LDivI* result = new(zone()) LDivI(dividend, divisor, temp); 1465 LDivI* result = new(zone()) LDivI(dividend, divisor, temp);
1466 return AssignEnvironment(DefineFixed(result, eax)); 1466 return AssignEnvironment(DefineFixed(result, eax));
1467 } else { 1467 } else {
1468 ASSERT(instr->representation().IsSmiOrTagged()); 1468 ASSERT(instr->representation().IsSmiOrTagged());
1469 return DoArithmeticT(Token::DIV, instr); 1469 return DoArithmeticT(Token::DIV, instr);
1470 } 1470 }
1471 } 1471 }
1472 1472
1473 1473
1474 HValue* LChunkBuilder::SimplifiedDividendForMathFloorOfDiv(HValue* dividend) {
1475 // A value with an integer representation does not need to be transformed.
1476 if (dividend->representation().IsInteger32()) {
1477 return dividend;
1478 // A change from an integer32 can be replaced by the integer32 value.
1479 } else if (dividend->IsChange() &&
1480 HChange::cast(dividend)->from().IsInteger32()) {
1481 return HChange::cast(dividend)->value();
1482 }
1483 return NULL;
1484 }
1485
1486
1487 HValue* LChunkBuilder::SimplifiedDivisorForMathFloorOfDiv(HValue* divisor) { 1474 HValue* LChunkBuilder::SimplifiedDivisorForMathFloorOfDiv(HValue* divisor) {
1488 if (divisor->IsConstant() && 1475 if (divisor->IsConstant() &&
1489 HConstant::cast(divisor)->HasInteger32Value()) { 1476 HConstant::cast(divisor)->HasInteger32Value()) {
1490 HConstant* constant_val = HConstant::cast(divisor); 1477 HConstant* constant_val = HConstant::cast(divisor);
1491 return constant_val->CopyToRepresentation(Representation::Integer32(), 1478 return constant_val->CopyToRepresentation(Representation::Integer32(),
1492 divisor->block()->zone()); 1479 divisor->block()->zone());
1493 } 1480 }
1494 // A value with an integer representation does not need to be transformed. 1481 // A value with an integer representation does not need to be transformed.
1495 if (divisor->representation().IsInteger32()) { 1482 if (divisor->representation().IsInteger32()) {
1496 return divisor; 1483 return divisor;
(...skipping 1313 matching lines...) Expand 10 before | Expand all | Expand 10 after
2810 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2797 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2811 LOperand* object = UseRegister(instr->object()); 2798 LOperand* object = UseRegister(instr->object());
2812 LOperand* index = UseTempRegister(instr->index()); 2799 LOperand* index = UseTempRegister(instr->index());
2813 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2800 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2814 } 2801 }
2815 2802
2816 2803
2817 } } // namespace v8::internal 2804 } } // namespace v8::internal
2818 2805
2819 #endif // V8_TARGET_ARCH_IA32 2806 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/lithium-ia32.h ('k') | src/x64/lithium-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698