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

Side by Side Diff: src/elements-kind.cc

Issue 1176263004: Introduce a base pointer field in FixedTypedArrayBase and teach GC about it (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « no previous file | src/heap/heap.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/elements-kind.h" 5 #include "src/elements-kind.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/base/lazy-instance.h" 8 #include "src/base/lazy-instance.h"
9 #include "src/elements.h" 9 #include "src/elements.h"
10 #include "src/objects.h" 10 #include "src/objects.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 case SLOPPY_ARGUMENTS_ELEMENTS: 47 case SLOPPY_ARGUMENTS_ELEMENTS:
48 return kPointerSizeLog2; 48 return kPointerSizeLog2;
49 } 49 }
50 UNREACHABLE(); 50 UNREACHABLE();
51 return 0; 51 return 0;
52 } 52 }
53 53
54 54
55 int GetDefaultHeaderSizeForElementsKind(ElementsKind elements_kind) { 55 int GetDefaultHeaderSizeForElementsKind(ElementsKind elements_kind) {
56 STATIC_ASSERT(FixedArray::kHeaderSize == FixedDoubleArray::kHeaderSize); 56 STATIC_ASSERT(FixedArray::kHeaderSize == FixedDoubleArray::kHeaderSize);
57 return IsExternalArrayElementsKind(elements_kind) 57
58 ? 0 : (FixedArray::kHeaderSize - kHeapObjectTag); 58 if (IsExternalArrayElementsKind(elements_kind)) {
59 return 0;
60 } else if (IsFixedTypedArrayElementsKind(elements_kind)) {
61 return FixedTypedArrayBase::kDataOffset - kHeapObjectTag;
62 } else {
63 return FixedArray::kHeaderSize - kHeapObjectTag;
64 }
59 } 65 }
60 66
61 67
62 const char* ElementsKindToString(ElementsKind kind) { 68 const char* ElementsKindToString(ElementsKind kind) {
63 ElementsAccessor* accessor = ElementsAccessor::ForKind(kind); 69 ElementsAccessor* accessor = ElementsAccessor::ForKind(kind);
64 return accessor->name(); 70 return accessor->name();
65 } 71 }
66 72
67 73
68 struct InitializeFastElementsKindSequence { 74 struct InitializeFastElementsKindSequence {
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 default: 196 default:
191 return false; 197 return false;
192 } 198 }
193 } 199 }
194 return false; 200 return false;
195 } 201 }
196 202
197 203
198 } // namespace internal 204 } // namespace internal
199 } // namespace v8 205 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698