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 1855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1866 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result))); | 1866 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result))); |
1867 } else if (val->HasRange() && val->range()->IsInSmiRange()) { | 1867 } else if (val->HasRange() && val->range()->IsInSmiRange()) { |
1868 return DefineSameAsFirst(new(zone()) LSmiTag(value)); | 1868 return DefineSameAsFirst(new(zone()) LSmiTag(value)); |
1869 } else { | 1869 } else { |
1870 LNumberTagI* result = new(zone()) LNumberTagI(value); | 1870 LNumberTagI* result = new(zone()) LNumberTagI(value); |
1871 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result))); | 1871 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result))); |
1872 } | 1872 } |
1873 } else if (to.IsSmi()) { | 1873 } else if (to.IsSmi()) { |
1874 HValue* val = instr->value(); | 1874 HValue* val = instr->value(); |
1875 LOperand* value = UseRegister(val); | 1875 LOperand* value = UseRegister(val); |
1876 LInstruction* result = | 1876 LInstruction* result = NULL; |
1877 DefineAsRegister(new(zone()) LInteger32ToSmi(value)); | 1877 if (val->CheckFlag(HInstruction::kUint32)) { |
1878 if (val->HasRange() && val->range()->IsInSmiRange()) { | 1878 result = DefineAsRegister(new(zone()) LUint32ToSmi(value)); |
1879 return result; | 1879 if (val->HasRange() && val->range()->IsInSmiRange() && |
| 1880 val->range()->upper() != kMaxInt) { |
| 1881 return result; |
| 1882 } |
| 1883 } else { |
| 1884 result = DefineAsRegister(new(zone()) LInteger32ToSmi(value)); |
| 1885 if (val->HasRange() && val->range()->IsInSmiRange()) { |
| 1886 return result; |
| 1887 } |
1880 } | 1888 } |
1881 return AssignEnvironment(result); | 1889 return AssignEnvironment(result); |
1882 } else { | 1890 } else { |
1883 if (instr->value()->CheckFlag(HInstruction::kUint32)) { | 1891 if (instr->value()->CheckFlag(HInstruction::kUint32)) { |
1884 LOperand* temp = FixedTemp(xmm1); | 1892 LOperand* temp = FixedTemp(xmm1); |
1885 return DefineAsRegister( | 1893 return DefineAsRegister( |
1886 new(zone()) LUint32ToDouble(UseRegister(instr->value()), temp)); | 1894 new(zone()) LUint32ToDouble(UseRegister(instr->value()), temp)); |
1887 } else { | 1895 } else { |
1888 ASSERT(to.IsDouble()); | 1896 ASSERT(to.IsDouble()); |
1889 LOperand* value = Use(instr->value()); | 1897 LOperand* value = Use(instr->value()); |
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2525 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2533 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2526 LOperand* object = UseRegister(instr->object()); | 2534 LOperand* object = UseRegister(instr->object()); |
2527 LOperand* index = UseTempRegister(instr->index()); | 2535 LOperand* index = UseTempRegister(instr->index()); |
2528 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2536 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
2529 } | 2537 } |
2530 | 2538 |
2531 | 2539 |
2532 } } // namespace v8::internal | 2540 } } // namespace v8::internal |
2533 | 2541 |
2534 #endif // V8_TARGET_ARCH_X64 | 2542 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |