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 3148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3159 // Non-instance prototype: Fetch prototype from constructor field | 3159 // Non-instance prototype: Fetch prototype from constructor field |
3160 // in the function's map. | 3160 // in the function's map. |
3161 __ bind(&non_instance); | 3161 __ bind(&non_instance); |
3162 __ mov(result, FieldOperand(result, Map::kConstructorOffset)); | 3162 __ mov(result, FieldOperand(result, Map::kConstructorOffset)); |
3163 | 3163 |
3164 // All done. | 3164 // All done. |
3165 __ bind(&done); | 3165 __ bind(&done); |
3166 } | 3166 } |
3167 | 3167 |
3168 | 3168 |
3169 void LCodeGen::DoLoadElements(LLoadElements* instr) { | |
3170 Register result = ToRegister(instr->result()); | |
3171 Register input = ToRegister(instr->object()); | |
3172 __ mov(result, FieldOperand(input, JSObject::kElementsOffset)); | |
3173 if (FLAG_debug_code) { | |
3174 Label done, ok, fail; | |
3175 __ cmp(FieldOperand(result, HeapObject::kMapOffset), | |
3176 Immediate(factory()->fixed_array_map())); | |
3177 __ j(equal, &done, Label::kNear); | |
3178 __ cmp(FieldOperand(result, HeapObject::kMapOffset), | |
3179 Immediate(factory()->fixed_cow_array_map())); | |
3180 __ j(equal, &done, Label::kNear); | |
3181 Register temp((result.is(eax)) ? ebx : eax); | |
3182 __ push(temp); | |
3183 __ mov(temp, FieldOperand(result, HeapObject::kMapOffset)); | |
3184 __ movzx_b(temp, FieldOperand(temp, Map::kBitField2Offset)); | |
3185 __ and_(temp, Map::kElementsKindMask); | |
3186 __ shr(temp, Map::kElementsKindShift); | |
3187 __ cmp(temp, GetInitialFastElementsKind()); | |
3188 __ j(less, &fail, Label::kNear); | |
3189 __ cmp(temp, TERMINAL_FAST_ELEMENTS_KIND); | |
3190 __ j(less_equal, &ok, Label::kNear); | |
3191 __ cmp(temp, FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND); | |
3192 __ j(less, &fail, Label::kNear); | |
3193 __ cmp(temp, LAST_EXTERNAL_ARRAY_ELEMENTS_KIND); | |
3194 __ j(less_equal, &ok, Label::kNear); | |
3195 __ bind(&fail); | |
3196 __ Abort("Check for fast or external elements failed."); | |
3197 __ bind(&ok); | |
3198 __ pop(temp); | |
3199 __ bind(&done); | |
3200 } | |
3201 } | |
3202 | |
3203 | |
3204 void LCodeGen::DoLoadExternalArrayPointer( | 3169 void LCodeGen::DoLoadExternalArrayPointer( |
3205 LLoadExternalArrayPointer* instr) { | 3170 LLoadExternalArrayPointer* instr) { |
3206 Register result = ToRegister(instr->result()); | 3171 Register result = ToRegister(instr->result()); |
3207 Register input = ToRegister(instr->object()); | 3172 Register input = ToRegister(instr->object()); |
3208 __ mov(result, FieldOperand(input, | 3173 __ mov(result, FieldOperand(input, |
3209 ExternalArray::kExternalPointerOffset)); | 3174 ExternalArray::kExternalPointerOffset)); |
3210 } | 3175 } |
3211 | 3176 |
3212 | 3177 |
3213 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { | 3178 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { |
(...skipping 3426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6640 FixedArray::kHeaderSize - kPointerSize)); | 6605 FixedArray::kHeaderSize - kPointerSize)); |
6641 __ bind(&done); | 6606 __ bind(&done); |
6642 } | 6607 } |
6643 | 6608 |
6644 | 6609 |
6645 #undef __ | 6610 #undef __ |
6646 | 6611 |
6647 } } // namespace v8::internal | 6612 } } // namespace v8::internal |
6648 | 6613 |
6649 #endif // V8_TARGET_ARCH_IA32 | 6614 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |