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 3989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4000 | 4000 |
4001 HeapObject* object; | 4001 HeapObject* object; |
4002 AllocationResult allocation = AllocateRaw( | 4002 AllocationResult allocation = AllocateRaw( |
4003 size, space, OLD_SPACE, | 4003 size, space, OLD_SPACE, |
4004 array_type == kExternalFloat64Array ? kDoubleAligned : kWordAligned); | 4004 array_type == kExternalFloat64Array ? kDoubleAligned : kWordAligned); |
4005 if (!allocation.To(&object)) return allocation; | 4005 if (!allocation.To(&object)) return allocation; |
4006 | 4006 |
4007 object->set_map(MapForFixedTypedArray(array_type)); | 4007 object->set_map(MapForFixedTypedArray(array_type)); |
4008 FixedTypedArrayBase* elements = FixedTypedArrayBase::cast(object); | 4008 FixedTypedArrayBase* elements = FixedTypedArrayBase::cast(object); |
4009 elements->set_base_pointer(elements, SKIP_WRITE_BARRIER); | 4009 elements->set_base_pointer(elements, SKIP_WRITE_BARRIER); |
4010 elements->set_external_pointer( | |
4011 reinterpret_cast<void*>(FixedTypedArrayBase::kDataOffset - | |
4012 kHeapObjectTag), | |
Jarin
2015/07/22 09:00:20
Can't you say ExternalReference::fixed_typed_array
jochen (gone - plz use gerrit)
2015/07/22 09:08:13
done
| |
4013 SKIP_WRITE_BARRIER); | |
4010 elements->set_length(length); | 4014 elements->set_length(length); |
4011 if (initialize) memset(elements->DataPtr(), 0, elements->DataSize()); | 4015 if (initialize) memset(elements->DataPtr(), 0, elements->DataSize()); |
4012 return elements; | 4016 return elements; |
4013 } | 4017 } |
4014 | 4018 |
4015 | 4019 |
4016 AllocationResult Heap::AllocateCode(int object_size, bool immovable) { | 4020 AllocationResult Heap::AllocateCode(int object_size, bool immovable) { |
4017 DCHECK(IsAligned(static_cast<intptr_t>(object_size), kCodeAlignment)); | 4021 DCHECK(IsAligned(static_cast<intptr_t>(object_size), kCodeAlignment)); |
4018 AllocationResult allocation = | 4022 AllocationResult allocation = |
4019 AllocateRaw(object_size, CODE_SPACE, CODE_SPACE); | 4023 AllocateRaw(object_size, CODE_SPACE, CODE_SPACE); |
(...skipping 2867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6887 *object_type = "CODE_TYPE"; \ | 6891 *object_type = "CODE_TYPE"; \ |
6888 *object_sub_type = "CODE_AGE/" #name; \ | 6892 *object_sub_type = "CODE_AGE/" #name; \ |
6889 return true; | 6893 return true; |
6890 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) | 6894 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) |
6891 #undef COMPARE_AND_RETURN_NAME | 6895 #undef COMPARE_AND_RETURN_NAME |
6892 } | 6896 } |
6893 return false; | 6897 return false; |
6894 } | 6898 } |
6895 } // namespace internal | 6899 } // namespace internal |
6896 } // namespace v8 | 6900 } // namespace v8 |
OLD | NEW |