| 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 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 887 static void AllocateEmptyJSArray(MacroAssembler* masm, | 887 static void AllocateEmptyJSArray(MacroAssembler* masm, |
| 888 Register array_function, | 888 Register array_function, |
| 889 Register result, | 889 Register result, |
| 890 Register scratch1, | 890 Register scratch1, |
| 891 Register scratch2, | 891 Register scratch2, |
| 892 Register scratch3, | 892 Register scratch3, |
| 893 Label* gc_required) { | 893 Label* gc_required) { |
| 894 const int initial_capacity = JSArray::kPreallocatedArrayElements; | 894 const int initial_capacity = JSArray::kPreallocatedArrayElements; |
| 895 STATIC_ASSERT(initial_capacity >= 0); | 895 STATIC_ASSERT(initial_capacity >= 0); |
| 896 | 896 |
| 897 __ LoadGlobalInitialConstructedArrayMap(array_function, scratch2, scratch1); | 897 __ LoadInitialArrayMap(array_function, scratch2, scratch1); |
| 898 | 898 |
| 899 // Allocate the JSArray object together with space for a fixed array with the | 899 // Allocate the JSArray object together with space for a fixed array with the |
| 900 // requested elements. | 900 // requested elements. |
| 901 int size = JSArray::kSize; | 901 int size = JSArray::kSize; |
| 902 if (initial_capacity > 0) { | 902 if (initial_capacity > 0) { |
| 903 size += FixedArray::SizeFor(initial_capacity); | 903 size += FixedArray::SizeFor(initial_capacity); |
| 904 } | 904 } |
| 905 __ AllocateInNewSpace(size, | 905 __ AllocateInNewSpace(size, |
| 906 result, | 906 result, |
| 907 scratch2, | 907 scratch2, |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 990 Register result, | 990 Register result, |
| 991 Register elements_array, | 991 Register elements_array, |
| 992 Register elements_array_end, | 992 Register elements_array_end, |
| 993 Register scratch, | 993 Register scratch, |
| 994 bool fill_with_hole, | 994 bool fill_with_hole, |
| 995 Label* gc_required) { | 995 Label* gc_required) { |
| 996 ASSERT(scratch.is(edi)); // rep stos destination | 996 ASSERT(scratch.is(edi)); // rep stos destination |
| 997 ASSERT(!fill_with_hole || array_size.is(ecx)); // rep stos count | 997 ASSERT(!fill_with_hole || array_size.is(ecx)); // rep stos count |
| 998 ASSERT(!fill_with_hole || !result.is(eax)); // result is never eax | 998 ASSERT(!fill_with_hole || !result.is(eax)); // result is never eax |
| 999 | 999 |
| 1000 __ LoadGlobalInitialConstructedArrayMap(array_function, | 1000 __ LoadInitialArrayMap(array_function, scratch, elements_array); |
| 1001 scratch, | |
| 1002 elements_array); | |
| 1003 | 1001 |
| 1004 // Allocate the JSArray object together with space for a FixedArray with the | 1002 // Allocate the JSArray object together with space for a FixedArray with the |
| 1005 // requested elements. | 1003 // requested elements. |
| 1006 STATIC_ASSERT(kSmiTagSize == 1 && kSmiTag == 0); | 1004 STATIC_ASSERT(kSmiTagSize == 1 && kSmiTag == 0); |
| 1007 __ AllocateInNewSpace(JSArray::kSize + FixedArray::kHeaderSize, | 1005 __ AllocateInNewSpace(JSArray::kSize + FixedArray::kHeaderSize, |
| 1008 times_half_pointer_size, // array_size is a smi. | 1006 times_half_pointer_size, // array_size is a smi. |
| 1009 array_size, | 1007 array_size, |
| 1010 result, | 1008 result, |
| 1011 elements_array_end, | 1009 elements_array_end, |
| 1012 scratch, | 1010 scratch, |
| (...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1687 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); | 1685 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); |
| 1688 generator.Generate(); | 1686 generator.Generate(); |
| 1689 } | 1687 } |
| 1690 | 1688 |
| 1691 | 1689 |
| 1692 #undef __ | 1690 #undef __ |
| 1693 } | 1691 } |
| 1694 } // namespace v8::internal | 1692 } // namespace v8::internal |
| 1695 | 1693 |
| 1696 #endif // V8_TARGET_ARCH_IA32 | 1694 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |