OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
(...skipping 4009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4020 | 4020 |
4021 HeapObject* object; | 4021 HeapObject* object; |
4022 AllocationResult allocation = AllocateRaw( | 4022 AllocationResult allocation = AllocateRaw( |
4023 size, space, OLD_SPACE, | 4023 size, space, OLD_SPACE, |
4024 array_type == kExternalFloat64Array ? kDoubleAligned : kWordAligned); | 4024 array_type == kExternalFloat64Array ? kDoubleAligned : kWordAligned); |
4025 if (!allocation.To(&object)) return allocation; | 4025 if (!allocation.To(&object)) return allocation; |
4026 | 4026 |
4027 object->set_map(MapForFixedTypedArray(array_type)); | 4027 object->set_map(MapForFixedTypedArray(array_type)); |
4028 FixedTypedArrayBase* elements = FixedTypedArrayBase::cast(object); | 4028 FixedTypedArrayBase* elements = FixedTypedArrayBase::cast(object); |
4029 elements->set_base_pointer(elements, SKIP_WRITE_BARRIER); | 4029 elements->set_base_pointer(elements, SKIP_WRITE_BARRIER); |
| 4030 elements->set_external_pointer( |
| 4031 ExternalReference::fixed_typed_array_base_data_offset().address(), |
| 4032 SKIP_WRITE_BARRIER); |
4030 elements->set_length(length); | 4033 elements->set_length(length); |
4031 if (initialize) memset(elements->DataPtr(), 0, elements->DataSize()); | 4034 if (initialize) memset(elements->DataPtr(), 0, elements->DataSize()); |
4032 return elements; | 4035 return elements; |
4033 } | 4036 } |
4034 | 4037 |
4035 | 4038 |
4036 AllocationResult Heap::AllocateCode(int object_size, bool immovable) { | 4039 AllocationResult Heap::AllocateCode(int object_size, bool immovable) { |
4037 DCHECK(IsAligned(static_cast<intptr_t>(object_size), kCodeAlignment)); | 4040 DCHECK(IsAligned(static_cast<intptr_t>(object_size), kCodeAlignment)); |
4038 AllocationResult allocation = | 4041 AllocationResult allocation = |
4039 AllocateRaw(object_size, CODE_SPACE, CODE_SPACE); | 4042 AllocateRaw(object_size, CODE_SPACE, CODE_SPACE); |
(...skipping 2875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6915 *object_type = "CODE_TYPE"; \ | 6918 *object_type = "CODE_TYPE"; \ |
6916 *object_sub_type = "CODE_AGE/" #name; \ | 6919 *object_sub_type = "CODE_AGE/" #name; \ |
6917 return true; | 6920 return true; |
6918 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) | 6921 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) |
6919 #undef COMPARE_AND_RETURN_NAME | 6922 #undef COMPARE_AND_RETURN_NAME |
6920 } | 6923 } |
6921 return false; | 6924 return false; |
6922 } | 6925 } |
6923 } // namespace internal | 6926 } // namespace internal |
6924 } // namespace v8 | 6927 } // namespace v8 |
OLD | NEW |