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 1692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1703 Representation from = instr->from(); | 1703 Representation from = instr->from(); |
1704 Representation to = instr->to(); | 1704 Representation to = instr->to(); |
1705 if (from.IsTagged()) { | 1705 if (from.IsTagged()) { |
1706 if (to.IsDouble()) { | 1706 if (to.IsDouble()) { |
1707 LOperand* value = UseRegister(instr->value()); | 1707 LOperand* value = UseRegister(instr->value()); |
1708 LNumberUntagD* res = new(zone()) LNumberUntagD(value); | 1708 LNumberUntagD* res = new(zone()) LNumberUntagD(value); |
1709 return AssignEnvironment(DefineAsRegister(res)); | 1709 return AssignEnvironment(DefineAsRegister(res)); |
1710 } else { | 1710 } else { |
1711 ASSERT(to.IsInteger32()); | 1711 ASSERT(to.IsInteger32()); |
1712 LOperand* value = UseRegisterAtStart(instr->value()); | 1712 LOperand* value = UseRegisterAtStart(instr->value()); |
1713 bool needs_check = !instr->value()->type().IsSmi(); | 1713 if (instr->value()->IsValueTaggedSmi()) { |
1714 LInstruction* res = NULL; | 1714 res = DefineAsRegister(new(zone()) LSmiUntag(value, false)); |
1715 if (!needs_check) { | |
1716 res = DefineAsRegister(new(zone()) LSmiUntag(value, needs_check)); | |
1717 } else { | 1715 } else { |
1718 LOperand* temp1 = TempRegister(); | 1716 LOperand* temp1 = TempRegister(); |
1719 LOperand* temp2 = instr->CanTruncateToInt32() ? TempRegister() | 1717 LOperand* temp2 = instr->CanTruncateToInt32() ? TempRegister() |
1720 : NULL; | 1718 : NULL; |
1721 LOperand* temp3 = instr->CanTruncateToInt32() ? FixedTemp(d11) | 1719 LOperand* temp3 = instr->CanTruncateToInt32() ? FixedTemp(d11) |
1722 : NULL; | 1720 : NULL; |
1723 res = DefineSameAsFirst(new(zone()) LTaggedToI(value, | 1721 res = DefineSameAsFirst(new(zone()) LTaggedToI(value, |
1724 temp1, | 1722 temp1, |
1725 temp2, | 1723 temp2, |
1726 temp3)); | 1724 temp3)); |
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2395 | 2393 |
2396 | 2394 |
2397 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2395 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2398 LOperand* object = UseRegister(instr->object()); | 2396 LOperand* object = UseRegister(instr->object()); |
2399 LOperand* index = UseRegister(instr->index()); | 2397 LOperand* index = UseRegister(instr->index()); |
2400 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2398 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
2401 } | 2399 } |
2402 | 2400 |
2403 | 2401 |
2404 } } // namespace v8::internal | 2402 } } // namespace v8::internal |
OLD | NEW |