OLD | NEW |
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 1869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1880 ASSERT(to.IsInteger32()); | 1880 ASSERT(to.IsInteger32()); |
1881 LOperand* value = UseRegister(instr->value()); | 1881 LOperand* value = UseRegister(instr->value()); |
1882 LDoubleToI* res = new(zone()) LDoubleToI(value); | 1882 LDoubleToI* res = new(zone()) LDoubleToI(value); |
1883 return AssignEnvironment(DefineAsRegister(res)); | 1883 return AssignEnvironment(DefineAsRegister(res)); |
1884 } | 1884 } |
1885 } else if (from.IsInteger32()) { | 1885 } else if (from.IsInteger32()) { |
1886 info()->MarkAsDeferredCalling(); | 1886 info()->MarkAsDeferredCalling(); |
1887 if (to.IsTagged()) { | 1887 if (to.IsTagged()) { |
1888 HValue* val = instr->value(); | 1888 HValue* val = instr->value(); |
1889 LOperand* value = UseRegisterAtStart(val); | 1889 LOperand* value = UseRegisterAtStart(val); |
1890 if (val->CheckFlag(HInstruction::kUint32)) { | 1890 if (!instr->CheckFlag(HValue::kCanOverflow)) { |
| 1891 return DefineAsRegister(new(zone()) LSmiTag(value)); |
| 1892 } else if (val->CheckFlag(HInstruction::kUint32)) { |
1891 LOperand* temp1 = TempRegister(); | 1893 LOperand* temp1 = TempRegister(); |
1892 LOperand* temp2 = TempRegister(); | 1894 LOperand* temp2 = TempRegister(); |
1893 LNumberTagU* result = new(zone()) LNumberTagU(value, temp1, temp2); | 1895 LNumberTagU* result = new(zone()) LNumberTagU(value, temp1, temp2); |
1894 return AssignEnvironment(AssignPointerMap(DefineAsRegister(result))); | 1896 return AssignEnvironment(AssignPointerMap(DefineAsRegister(result))); |
1895 } else if (val->HasRange() && val->range()->IsInSmiRange()) { | |
1896 return DefineAsRegister(new(zone()) LSmiTag(value)); | |
1897 } else { | 1897 } else { |
1898 LOperand* temp1 = TempRegister(); | 1898 LOperand* temp1 = TempRegister(); |
1899 LOperand* temp2 = TempRegister(); | 1899 LOperand* temp2 = TempRegister(); |
1900 LNumberTagI* result = new(zone()) LNumberTagI(value, temp1, temp2); | 1900 LNumberTagI* result = new(zone()) LNumberTagI(value, temp1, temp2); |
1901 return AssignEnvironment(AssignPointerMap(DefineAsRegister(result))); | 1901 return AssignEnvironment(AssignPointerMap(DefineAsRegister(result))); |
1902 } | 1902 } |
1903 } else if (to.IsSmi()) { | 1903 } else if (to.IsSmi()) { |
1904 HValue* val = instr->value(); | 1904 HValue* val = instr->value(); |
1905 LOperand* value = UseRegister(val); | 1905 LOperand* value = UseRegister(val); |
1906 LInstruction* result = val->CheckFlag(HInstruction::kUint32) | 1906 LInstruction* result = DefineAsRegister(new(zone()) LSmiTag(value)); |
1907 ? DefineAsRegister(new(zone()) LUint32ToSmi(value)) | 1907 if (instr->CheckFlag(HValue::kCanOverflow)) { |
1908 : DefineAsRegister(new(zone()) LInteger32ToSmi(value)); | 1908 result = AssignEnvironment(result); |
1909 if (val->HasRange() && val->range()->IsInSmiRange()) { | |
1910 return result; | |
1911 } | 1909 } |
1912 return AssignEnvironment(result); | 1910 return result; |
1913 } else { | 1911 } else { |
1914 ASSERT(to.IsDouble()); | 1912 ASSERT(to.IsDouble()); |
1915 if (instr->value()->CheckFlag(HInstruction::kUint32)) { | 1913 if (instr->value()->CheckFlag(HInstruction::kUint32)) { |
1916 return DefineAsRegister( | 1914 return DefineAsRegister( |
1917 new(zone()) LUint32ToDouble(UseRegister(instr->value()))); | 1915 new(zone()) LUint32ToDouble(UseRegister(instr->value()))); |
1918 } else { | 1916 } else { |
1919 return DefineAsRegister( | 1917 return DefineAsRegister( |
1920 new(zone()) LInteger32ToDouble(Use(instr->value()))); | 1918 new(zone()) LInteger32ToDouble(Use(instr->value()))); |
1921 } | 1919 } |
1922 } | 1920 } |
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2536 } | 2534 } |
2537 | 2535 |
2538 | 2536 |
2539 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2537 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2540 LOperand* object = UseRegister(instr->object()); | 2538 LOperand* object = UseRegister(instr->object()); |
2541 LOperand* index = UseRegister(instr->index()); | 2539 LOperand* index = UseRegister(instr->index()); |
2542 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2540 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
2543 } | 2541 } |
2544 | 2542 |
2545 } } // namespace v8::internal | 2543 } } // namespace v8::internal |
OLD | NEW |