OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 1618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1629 // There are two words between the frame pointer and the last argument. | 1629 // There are two words between the frame pointer and the last argument. |
1630 // Subtracting from length accounts for one of them add one more. | 1630 // Subtracting from length accounts for one of them add one more. |
1631 __ add(length, length, Operand(1)); | 1631 __ add(length, length, Operand(1)); |
1632 __ ldr(result, MemOperand(arguments, length, LSL, kPointerSizeLog2)); | 1632 __ ldr(result, MemOperand(arguments, length, LSL, kPointerSizeLog2)); |
1633 } | 1633 } |
1634 | 1634 |
1635 | 1635 |
1636 void LCodeGen::DoLoadKeyedFastElement(LLoadKeyedFastElement* instr) { | 1636 void LCodeGen::DoLoadKeyedFastElement(LLoadKeyedFastElement* instr) { |
1637 Register elements = ToRegister(instr->elements()); | 1637 Register elements = ToRegister(instr->elements()); |
1638 Register key = EmitLoadRegister(instr->key(), scratch0()); | 1638 Register key = EmitLoadRegister(instr->key(), scratch0()); |
1639 Register result; | 1639 Register result = ToRegister(instr->result()); |
1640 Register scratch = scratch0(); | 1640 Register scratch = scratch0(); |
1641 | 1641 ASSERT(result.is(elements)); |
1642 if (instr->load_result() != NULL) { | |
1643 result = ToRegister(instr->load_result()); | |
1644 } else { | |
1645 result = ToRegister(instr->result()); | |
1646 ASSERT(result.is(elements)); | |
1647 } | |
1648 | 1642 |
1649 // Load the result. | 1643 // Load the result. |
1650 __ add(scratch, elements, Operand(key, LSL, kPointerSizeLog2)); | 1644 __ add(scratch, elements, Operand(key, LSL, kPointerSizeLog2)); |
1651 __ ldr(result, FieldMemOperand(scratch, FixedArray::kHeaderSize)); | 1645 __ ldr(result, FieldMemOperand(scratch, FixedArray::kHeaderSize)); |
1652 | 1646 |
1653 Representation r = instr->hydrogen()->representation(); | 1647 // Check for the hole value. |
1654 if (r.IsInteger32()) { | 1648 ASSERT(r.IsTagged()); |
1655 // Untag and check for smi. | 1649 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); |
1656 __ SmiUntag(result); | 1650 __ cmp(result, scratch); |
1657 DeoptimizeIf(cs, instr->environment()); | 1651 DeoptimizeIf(eq, instr->environment()); |
1658 } else if (r.IsDouble()) { | |
1659 EmitNumberUntagD(result, | |
1660 ToDoubleRegister(instr->result()), | |
1661 instr->environment()); | |
1662 } else { | |
1663 // Check for the hole value. | |
1664 ASSERT(r.IsTagged()); | |
1665 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); | |
1666 __ cmp(result, scratch); | |
1667 DeoptimizeIf(eq, instr->environment()); | |
1668 } | |
1669 } | 1652 } |
1670 | 1653 |
1671 | 1654 |
1672 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | 1655 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
1673 ASSERT(ToRegister(instr->object()).is(r1)); | 1656 ASSERT(ToRegister(instr->object()).is(r1)); |
1674 ASSERT(ToRegister(instr->key()).is(r0)); | 1657 ASSERT(ToRegister(instr->key()).is(r0)); |
1675 | 1658 |
1676 Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize)); | 1659 Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize)); |
1677 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 1660 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
1678 } | 1661 } |
(...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2648 | 2631 |
2649 | 2632 |
2650 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { | 2633 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { |
2651 Abort("DoOsrEntry unimplemented."); | 2634 Abort("DoOsrEntry unimplemented."); |
2652 } | 2635 } |
2653 | 2636 |
2654 | 2637 |
2655 #undef __ | 2638 #undef __ |
2656 | 2639 |
2657 } } // namespace v8::internal | 2640 } } // namespace v8::internal |
OLD | NEW |