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

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

Issue 1159453004: Add SIMD 128 alignment support to Heap. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Only mark aligned object memory as MSAN uninitialized. 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 | « src/globals.h ('k') | src/heap/spaces-inl.h » ('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/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 1977 matching lines...) Expand 10 before | Expand all | Expand 10 after
1988 #endif 1988 #endif
1989 1989
1990 1990
1991 int Heap::GetMaximumFillToAlign(AllocationAlignment alignment) { 1991 int Heap::GetMaximumFillToAlign(AllocationAlignment alignment) {
1992 switch (alignment) { 1992 switch (alignment) {
1993 case kWordAligned: 1993 case kWordAligned:
1994 return 0; 1994 return 0;
1995 case kDoubleAligned: 1995 case kDoubleAligned:
1996 case kDoubleUnaligned: 1996 case kDoubleUnaligned:
1997 return kDoubleSize - kPointerSize; 1997 return kDoubleSize - kPointerSize;
1998 case kSimd128Unaligned:
1999 return kSimd128Size - kPointerSize;
1998 default: 2000 default:
1999 UNREACHABLE(); 2001 UNREACHABLE();
2000 } 2002 }
2001 return 0; 2003 return 0;
2002 } 2004 }
2003 2005
2004 2006
2005 int Heap::GetFillToAlign(Address address, AllocationAlignment alignment) { 2007 int Heap::GetFillToAlign(Address address, AllocationAlignment alignment) {
2006 intptr_t offset = OffsetFrom(address); 2008 intptr_t offset = OffsetFrom(address);
2007 if (alignment == kDoubleAligned && (offset & kDoubleAlignmentMask) != 0) 2009 if (alignment == kDoubleAligned && (offset & kDoubleAlignmentMask) != 0)
2008 return kPointerSize; 2010 return kPointerSize;
2009 if (alignment == kDoubleUnaligned && (offset & kDoubleAlignmentMask) == 0) 2011 if (alignment == kDoubleUnaligned && (offset & kDoubleAlignmentMask) == 0)
2010 return kDoubleSize - kPointerSize; // No fill if double is always aligned. 2012 return kDoubleSize - kPointerSize; // No fill if double is always aligned.
2013 if (alignment == kSimd128Unaligned) {
2014 return (kSimd128Size - (static_cast<int>(offset) + kPointerSize)) &
2015 kSimd128AlignmentMask;
2016 }
2011 return 0; 2017 return 0;
2012 } 2018 }
2013 2019
2014 2020
2015 HeapObject* Heap::PrecedeWithFiller(HeapObject* object, int filler_size) { 2021 HeapObject* Heap::PrecedeWithFiller(HeapObject* object, int filler_size) {
2016 CreateFillerObjectAt(object->address(), filler_size); 2022 CreateFillerObjectAt(object->address(), filler_size);
2017 return HeapObject::FromAddress(object->address() + filler_size); 2023 return HeapObject::FromAddress(object->address() + filler_size);
2018 } 2024 }
2019 2025
2020 2026
(...skipping 4645 matching lines...) Expand 10 before | Expand all | Expand 10 after
6666 *object_type = "CODE_TYPE"; \ 6672 *object_type = "CODE_TYPE"; \
6667 *object_sub_type = "CODE_AGE/" #name; \ 6673 *object_sub_type = "CODE_AGE/" #name; \
6668 return true; 6674 return true;
6669 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) 6675 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME)
6670 #undef COMPARE_AND_RETURN_NAME 6676 #undef COMPARE_AND_RETURN_NAME
6671 } 6677 }
6672 return false; 6678 return false;
6673 } 6679 }
6674 } // namespace internal 6680 } // namespace internal
6675 } // namespace v8 6681 } // namespace v8
OLDNEW
« no previous file with comments | « src/globals.h ('k') | src/heap/spaces-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698