Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(342)

Side by Side Diff: src/heap/heap.cc

Issue 1248483007: Store offset between fixed typed array base and data start in object (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/elements-kind.cc ('k') | src/hydrogen.cc » ('j') | src/ia32/lithium-codegen-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698