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

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

Issue 198973002: MIPS: Fix uses of range analysis results in HChange. (Closed) Base URL: https://github.com/v8/v8.git@gbl
Patch Set: Created 6 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
« no previous file with comments | « src/mips/lithium-mips.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 1781 matching lines...) Expand 10 before | Expand all | Expand 10 after
1792 ASSERT(to.IsInteger32()); 1792 ASSERT(to.IsInteger32());
1793 LOperand* value = UseRegister(instr->value()); 1793 LOperand* value = UseRegister(instr->value());
1794 LDoubleToI* res = new(zone()) LDoubleToI(value); 1794 LDoubleToI* res = new(zone()) LDoubleToI(value);
1795 return AssignEnvironment(DefineAsRegister(res)); 1795 return AssignEnvironment(DefineAsRegister(res));
1796 } 1796 }
1797 } else if (from.IsInteger32()) { 1797 } else if (from.IsInteger32()) {
1798 info()->MarkAsDeferredCalling(); 1798 info()->MarkAsDeferredCalling();
1799 if (to.IsTagged()) { 1799 if (to.IsTagged()) {
1800 HValue* val = instr->value(); 1800 HValue* val = instr->value();
1801 LOperand* value = UseRegisterAtStart(val); 1801 LOperand* value = UseRegisterAtStart(val);
1802 if (val->CheckFlag(HInstruction::kUint32)) { 1802 if (!instr->CheckFlag(HValue::kCanOverflow)) {
1803 return DefineAsRegister(new(zone()) LSmiTag(value));
1804 } else if (val->CheckFlag(HInstruction::kUint32)) {
1803 LOperand* temp1 = TempRegister(); 1805 LOperand* temp1 = TempRegister();
1804 LOperand* temp2 = TempRegister(); 1806 LOperand* temp2 = TempRegister();
1805 LNumberTagU* result = new(zone()) LNumberTagU(value, temp1, temp2); 1807 LNumberTagU* result = new(zone()) LNumberTagU(value, temp1, temp2);
1806 return AssignEnvironment(AssignPointerMap(DefineAsRegister(result))); 1808 return AssignEnvironment(AssignPointerMap(DefineAsRegister(result)));
1807 } else if (val->HasRange() && val->range()->IsInSmiRange()) {
1808 return DefineAsRegister(new(zone()) LSmiTag(value));
1809 } else { 1809 } else {
1810 LOperand* temp1 = TempRegister(); 1810 LOperand* temp1 = TempRegister();
1811 LOperand* temp2 = TempRegister(); 1811 LOperand* temp2 = TempRegister();
1812 LNumberTagI* result = new(zone()) LNumberTagI(value, temp1, temp2); 1812 LNumberTagI* result = new(zone()) LNumberTagI(value, temp1, temp2);
1813 return AssignEnvironment(AssignPointerMap(DefineAsRegister(result))); 1813 return AssignEnvironment(AssignPointerMap(DefineAsRegister(result)));
1814 } 1814 }
1815 } else if (to.IsSmi()) { 1815 } else if (to.IsSmi()) {
1816 HValue* val = instr->value(); 1816 HValue* val = instr->value();
1817 LOperand* value = UseRegister(val); 1817 LOperand* value = UseRegister(val);
1818 LInstruction* result = val->CheckFlag(HInstruction::kUint32) 1818 LInstruction* result = DefineAsRegister(new(zone()) LSmiTag(value));
1819 ? DefineAsRegister(new(zone()) LUint32ToSmi(value)) 1819 if (instr->CheckFlag(HValue::kCanOverflow)) {
1820 : DefineAsRegister(new(zone()) LInteger32ToSmi(value)); 1820 result = AssignEnvironment(result);
1821 if (val->HasRange() && val->range()->IsInSmiRange()) {
1822 return result;
1823 } 1821 }
1824 return AssignEnvironment(result); 1822 return result;
1825 } else { 1823 } else {
1826 ASSERT(to.IsDouble()); 1824 ASSERT(to.IsDouble());
1827 if (instr->value()->CheckFlag(HInstruction::kUint32)) { 1825 if (instr->value()->CheckFlag(HInstruction::kUint32)) {
1828 return DefineAsRegister( 1826 return DefineAsRegister(
1829 new(zone()) LUint32ToDouble(UseRegister(instr->value()))); 1827 new(zone()) LUint32ToDouble(UseRegister(instr->value())));
1830 } else { 1828 } else {
1831 return DefineAsRegister( 1829 return DefineAsRegister(
1832 new(zone()) LInteger32ToDouble(Use(instr->value()))); 1830 new(zone()) LInteger32ToDouble(Use(instr->value())));
1833 } 1831 }
1834 } 1832 }
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after
2435 2433
2436 2434
2437 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2435 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2438 LOperand* object = UseRegister(instr->object()); 2436 LOperand* object = UseRegister(instr->object());
2439 LOperand* index = UseRegister(instr->index()); 2437 LOperand* index = UseRegister(instr->index());
2440 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); 2438 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index));
2441 } 2439 }
2442 2440
2443 2441
2444 } } // namespace v8::internal 2442 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mips/lithium-mips.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698