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 4012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4023 __ bind(&value_is_smi); | 4023 __ bind(&value_is_smi); |
4024 | 4024 |
4025 // Check for the empty array, and preallocate a small backing store if | 4025 // Check for the empty array, and preallocate a small backing store if |
4026 // possible. | 4026 // possible. |
4027 __ mov(edi, FieldOperand(edx, JSObject::kElementsOffset)); | 4027 __ mov(edi, FieldOperand(edx, JSObject::kElementsOffset)); |
4028 __ cmp(edi, Immediate(masm->isolate()->factory()->empty_fixed_array())); | 4028 __ cmp(edi, Immediate(masm->isolate()->factory()->empty_fixed_array())); |
4029 __ j(not_equal, &check_capacity); | 4029 __ j(not_equal, &check_capacity); |
4030 | 4030 |
4031 int size = FixedDoubleArray::SizeFor(JSArray::kPreallocatedArrayElements); | 4031 int size = FixedDoubleArray::SizeFor(JSArray::kPreallocatedArrayElements); |
4032 __ AllocateInNewSpace(size, edi, ebx, ecx, &prepare_slow, TAG_OBJECT); | 4032 __ AllocateInNewSpace(size, edi, ebx, ecx, &prepare_slow, TAG_OBJECT); |
| 4033 |
4033 // Restore the key, which is known to be the array length. | 4034 // Restore the key, which is known to be the array length. |
4034 __ mov(ecx, Immediate(0)); | 4035 __ mov(ecx, Immediate(0)); |
4035 | 4036 |
4036 // eax: value | 4037 // eax: value |
4037 // ecx: key | 4038 // ecx: key |
4038 // edx: receiver | 4039 // edx: receiver |
4039 // edi: elements | 4040 // edi: elements |
4040 // Initialize the new FixedDoubleArray. Leave elements unitialized for | 4041 // Initialize the new FixedDoubleArray. Leave elements unitialized for |
4041 // efficiency, they are guaranteed to be initialized before use. | 4042 // efficiency, they are guaranteed to be initialized before use. |
4042 __ mov(FieldOperand(edi, JSObject::kMapOffset), | 4043 __ mov(FieldOperand(edi, JSObject::kMapOffset), |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4078 __ jmp(ic_slow, RelocInfo::CODE_TARGET); | 4079 __ jmp(ic_slow, RelocInfo::CODE_TARGET); |
4079 } | 4080 } |
4080 } | 4081 } |
4081 | 4082 |
4082 | 4083 |
4083 #undef __ | 4084 #undef __ |
4084 | 4085 |
4085 } } // namespace v8::internal | 4086 } } // namespace v8::internal |
4086 | 4087 |
4087 #endif // V8_TARGET_ARCH_IA32 | 4088 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |