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 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
923 static void AllocateEmptyJSArray(MacroAssembler* masm, | 923 static void AllocateEmptyJSArray(MacroAssembler* masm, |
924 Register array_function, | 924 Register array_function, |
925 Register result, | 925 Register result, |
926 Register scratch1, | 926 Register scratch1, |
927 Register scratch2, | 927 Register scratch2, |
928 Register scratch3, | 928 Register scratch3, |
929 Label* gc_required) { | 929 Label* gc_required) { |
930 const int initial_capacity = JSArray::kPreallocatedArrayElements; | 930 const int initial_capacity = JSArray::kPreallocatedArrayElements; |
931 STATIC_ASSERT(initial_capacity >= 0); | 931 STATIC_ASSERT(initial_capacity >= 0); |
932 | 932 |
933 __ LoadGlobalInitialConstructedArrayMap(array_function, scratch2, scratch1); | 933 __ LoadInitialArrayMap(array_function, scratch2, scratch1); |
934 | 934 |
935 // Allocate the JSArray object together with space for a fixed array with the | 935 // Allocate the JSArray object together with space for a fixed array with the |
936 // requested elements. | 936 // requested elements. |
937 int size = JSArray::kSize; | 937 int size = JSArray::kSize; |
938 if (initial_capacity > 0) { | 938 if (initial_capacity > 0) { |
939 size += FixedArray::SizeFor(initial_capacity); | 939 size += FixedArray::SizeFor(initial_capacity); |
940 } | 940 } |
941 __ AllocateInNewSpace(size, | 941 __ AllocateInNewSpace(size, |
942 result, | 942 result, |
943 scratch2, | 943 scratch2, |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1026 Register result, | 1026 Register result, |
1027 Register elements_array, | 1027 Register elements_array, |
1028 Register elements_array_end, | 1028 Register elements_array_end, |
1029 Register scratch, | 1029 Register scratch, |
1030 bool fill_with_hole, | 1030 bool fill_with_hole, |
1031 Label* gc_required) { | 1031 Label* gc_required) { |
1032 ASSERT(scratch.is(edi)); // rep stos destination | 1032 ASSERT(scratch.is(edi)); // rep stos destination |
1033 ASSERT(!fill_with_hole || array_size.is(ecx)); // rep stos count | 1033 ASSERT(!fill_with_hole || array_size.is(ecx)); // rep stos count |
1034 ASSERT(!fill_with_hole || !result.is(eax)); // result is never eax | 1034 ASSERT(!fill_with_hole || !result.is(eax)); // result is never eax |
1035 | 1035 |
1036 __ LoadGlobalInitialConstructedArrayMap(array_function, | 1036 __ LoadInitialArrayMap(array_function, scratch, elements_array); |
1037 scratch, | |
1038 elements_array); | |
1039 | 1037 |
1040 // Allocate the JSArray object together with space for a FixedArray with the | 1038 // Allocate the JSArray object together with space for a FixedArray with the |
1041 // requested elements. | 1039 // requested elements. |
1042 STATIC_ASSERT(kSmiTagSize == 1 && kSmiTag == 0); | 1040 STATIC_ASSERT(kSmiTagSize == 1 && kSmiTag == 0); |
1043 __ AllocateInNewSpace(JSArray::kSize + FixedArray::kHeaderSize, | 1041 __ AllocateInNewSpace(JSArray::kSize + FixedArray::kHeaderSize, |
1044 times_half_pointer_size, // array_size is a smi. | 1042 times_half_pointer_size, // array_size is a smi. |
1045 array_size, | 1043 array_size, |
1046 result, | 1044 result, |
1047 elements_array_end, | 1045 elements_array_end, |
1048 scratch, | 1046 scratch, |
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1723 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); | 1721 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); |
1724 generator.Generate(); | 1722 generator.Generate(); |
1725 } | 1723 } |
1726 | 1724 |
1727 | 1725 |
1728 #undef __ | 1726 #undef __ |
1729 } | 1727 } |
1730 } // namespace v8::internal | 1728 } // namespace v8::internal |
1731 | 1729 |
1732 #endif // V8_TARGET_ARCH_IA32 | 1730 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |