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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/heap/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/elements-kind.cc
diff --git a/src/elements-kind.cc b/src/elements-kind.cc
index 200fea600a7623d9816925fd0421110d638842e3..c669917c42612e8665c9731b1a8b6bddc0c0b9c2 100644
--- a/src/elements-kind.cc
+++ b/src/elements-kind.cc
@@ -54,8 +54,14 @@ int ElementsKindToShiftSize(ElementsKind elements_kind) {
int GetDefaultHeaderSizeForElementsKind(ElementsKind elements_kind) {
STATIC_ASSERT(FixedArray::kHeaderSize == FixedDoubleArray::kHeaderSize);
- return IsExternalArrayElementsKind(elements_kind)
- ? 0 : (FixedArray::kHeaderSize - kHeapObjectTag);
+
+ if (IsExternalArrayElementsKind(elements_kind)) {
+ return 0;
+ } else if (IsFixedTypedArrayElementsKind(elements_kind)) {
+ return FixedTypedArrayBase::kDataOffset - kHeapObjectTag;
+ } else {
+ return FixedArray::kHeaderSize - kHeapObjectTag;
+ }
}
« 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