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 2839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2850 // Non-instance prototype: Fetch prototype from constructor field | 2850 // Non-instance prototype: Fetch prototype from constructor field |
2851 // in initial map. | 2851 // in initial map. |
2852 __ bind(&non_instance); | 2852 __ bind(&non_instance); |
2853 __ lw(result, FieldMemOperand(result, Map::kConstructorOffset)); | 2853 __ lw(result, FieldMemOperand(result, Map::kConstructorOffset)); |
2854 | 2854 |
2855 // All done. | 2855 // All done. |
2856 __ bind(&done); | 2856 __ bind(&done); |
2857 } | 2857 } |
2858 | 2858 |
2859 | 2859 |
2860 void LCodeGen::DoLoadElements(LLoadElements* instr) { | |
2861 Register result = ToRegister(instr->result()); | |
2862 Register input = ToRegister(instr->object()); | |
2863 Register scratch = scratch0(); | |
2864 | |
2865 __ lw(result, FieldMemOperand(input, JSObject::kElementsOffset)); | |
2866 if (FLAG_debug_code) { | |
2867 Label done, fail; | |
2868 __ lw(scratch, FieldMemOperand(result, HeapObject::kMapOffset)); | |
2869 __ LoadRoot(at, Heap::kFixedArrayMapRootIndex); | |
2870 __ Branch(USE_DELAY_SLOT, &done, eq, scratch, Operand(at)); | |
2871 __ LoadRoot(at, Heap::kFixedCOWArrayMapRootIndex); // In the delay slot. | |
2872 __ Branch(&done, eq, scratch, Operand(at)); | |
2873 // |scratch| still contains |input|'s map. | |
2874 __ lbu(scratch, FieldMemOperand(scratch, Map::kBitField2Offset)); | |
2875 __ Ext(scratch, scratch, Map::kElementsKindShift, | |
2876 Map::kElementsKindBitCount); | |
2877 __ Branch(&fail, lt, scratch, | |
2878 Operand(GetInitialFastElementsKind())); | |
2879 __ Branch(&done, le, scratch, | |
2880 Operand(TERMINAL_FAST_ELEMENTS_KIND)); | |
2881 __ Branch(&fail, lt, scratch, | |
2882 Operand(FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND)); | |
2883 __ Branch(&done, le, scratch, | |
2884 Operand(LAST_EXTERNAL_ARRAY_ELEMENTS_KIND)); | |
2885 __ bind(&fail); | |
2886 __ Abort("Check for fast or external elements failed."); | |
2887 __ bind(&done); | |
2888 } | |
2889 } | |
2890 | |
2891 | |
2892 void LCodeGen::DoLoadExternalArrayPointer( | 2860 void LCodeGen::DoLoadExternalArrayPointer( |
2893 LLoadExternalArrayPointer* instr) { | 2861 LLoadExternalArrayPointer* instr) { |
2894 Register to_reg = ToRegister(instr->result()); | 2862 Register to_reg = ToRegister(instr->result()); |
2895 Register from_reg = ToRegister(instr->object()); | 2863 Register from_reg = ToRegister(instr->object()); |
2896 __ lw(to_reg, FieldMemOperand(from_reg, | 2864 __ lw(to_reg, FieldMemOperand(from_reg, |
2897 ExternalArray::kExternalPointerOffset)); | 2865 ExternalArray::kExternalPointerOffset)); |
2898 } | 2866 } |
2899 | 2867 |
2900 | 2868 |
2901 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { | 2869 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { |
(...skipping 2883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5785 __ Subu(scratch, result, scratch); | 5753 __ Subu(scratch, result, scratch); |
5786 __ lw(result, FieldMemOperand(scratch, | 5754 __ lw(result, FieldMemOperand(scratch, |
5787 FixedArray::kHeaderSize - kPointerSize)); | 5755 FixedArray::kHeaderSize - kPointerSize)); |
5788 __ bind(&done); | 5756 __ bind(&done); |
5789 } | 5757 } |
5790 | 5758 |
5791 | 5759 |
5792 #undef __ | 5760 #undef __ |
5793 | 5761 |
5794 } } // namespace v8::internal | 5762 } } // namespace v8::internal |
OLD | NEW |