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 954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
965 static void AllocateEmptyJSArray(MacroAssembler* masm, | 965 static void AllocateEmptyJSArray(MacroAssembler* masm, |
966 Register array_function, | 966 Register array_function, |
967 Register result, | 967 Register result, |
968 Register scratch1, | 968 Register scratch1, |
969 Register scratch2, | 969 Register scratch2, |
970 Register scratch3, | 970 Register scratch3, |
971 Label* gc_required) { | 971 Label* gc_required) { |
972 const int initial_capacity = JSArray::kPreallocatedArrayElements; | 972 const int initial_capacity = JSArray::kPreallocatedArrayElements; |
973 STATIC_ASSERT(initial_capacity >= 0); | 973 STATIC_ASSERT(initial_capacity >= 0); |
974 | 974 |
975 __ LoadGlobalInitialConstructedArrayMap(array_function, scratch2, scratch1); | 975 __ LoadInitialArrayMap(array_function, scratch2, scratch1); |
976 | 976 |
977 // Allocate the JSArray object together with space for a fixed array with the | 977 // Allocate the JSArray object together with space for a fixed array with the |
978 // requested elements. | 978 // requested elements. |
979 int size = JSArray::kSize; | 979 int size = JSArray::kSize; |
980 if (initial_capacity > 0) { | 980 if (initial_capacity > 0) { |
981 size += FixedArray::SizeFor(initial_capacity); | 981 size += FixedArray::SizeFor(initial_capacity); |
982 } | 982 } |
983 __ AllocateInNewSpace(size, | 983 __ AllocateInNewSpace(size, |
984 result, | 984 result, |
985 scratch2, | 985 scratch2, |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1064 // register elements_array is scratched. | 1064 // register elements_array is scratched. |
1065 static void AllocateJSArray(MacroAssembler* masm, | 1065 static void AllocateJSArray(MacroAssembler* masm, |
1066 Register array_function, // Array function. | 1066 Register array_function, // Array function. |
1067 Register array_size, // As a smi, cannot be 0. | 1067 Register array_size, // As a smi, cannot be 0. |
1068 Register result, | 1068 Register result, |
1069 Register elements_array, | 1069 Register elements_array, |
1070 Register elements_array_end, | 1070 Register elements_array_end, |
1071 Register scratch, | 1071 Register scratch, |
1072 bool fill_with_hole, | 1072 bool fill_with_hole, |
1073 Label* gc_required) { | 1073 Label* gc_required) { |
1074 __ LoadGlobalInitialConstructedArrayMap(array_function, | 1074 __ LoadInitialArrayMap(array_function, scratch, elements_array); |
1075 scratch, | |
1076 elements_array); | |
1077 | 1075 |
1078 if (FLAG_debug_code) { // Assert that array size is not zero. | 1076 if (FLAG_debug_code) { // Assert that array size is not zero. |
1079 __ testq(array_size, array_size); | 1077 __ testq(array_size, array_size); |
1080 __ Assert(not_zero, "array size is unexpectedly 0"); | 1078 __ Assert(not_zero, "array size is unexpectedly 0"); |
1081 } | 1079 } |
1082 | 1080 |
1083 // Allocate the JSArray object together with space for a FixedArray with the | 1081 // Allocate the JSArray object together with space for a FixedArray with the |
1084 // requested elements. | 1082 // requested elements. |
1085 SmiIndex index = | 1083 SmiIndex index = |
1086 masm->SmiToIndex(kScratchRegister, array_size, kPointerSizeLog2); | 1084 masm->SmiToIndex(kScratchRegister, array_size, kPointerSizeLog2); |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1579 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); | 1577 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); |
1580 generator.Generate(); | 1578 generator.Generate(); |
1581 } | 1579 } |
1582 | 1580 |
1583 | 1581 |
1584 #undef __ | 1582 #undef __ |
1585 | 1583 |
1586 } } // namespace v8::internal | 1584 } } // namespace v8::internal |
1587 | 1585 |
1588 #endif // V8_TARGET_ARCH_X64 | 1586 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |