| 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 1975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1986 #endif | 1986 #endif |
| 1987 | 1987 |
| 1988 | 1988 |
| 1989 int Heap::GetMaximumFillToAlign(AllocationAlignment alignment) { | 1989 int Heap::GetMaximumFillToAlign(AllocationAlignment alignment) { |
| 1990 switch (alignment) { | 1990 switch (alignment) { |
| 1991 case kWordAligned: | 1991 case kWordAligned: |
| 1992 return 0; | 1992 return 0; |
| 1993 case kDoubleAligned: | 1993 case kDoubleAligned: |
| 1994 case kDoubleUnaligned: | 1994 case kDoubleUnaligned: |
| 1995 return kDoubleSize - kPointerSize; | 1995 return kDoubleSize - kPointerSize; |
| 1996 case kSimd128Unaligned: | |
| 1997 return kSimd128Size - kPointerSize; | |
| 1998 default: | 1996 default: |
| 1999 UNREACHABLE(); | 1997 UNREACHABLE(); |
| 2000 } | 1998 } |
| 2001 return 0; | 1999 return 0; |
| 2002 } | 2000 } |
| 2003 | 2001 |
| 2004 | 2002 |
| 2005 int Heap::GetFillToAlign(Address address, AllocationAlignment alignment) { | 2003 int Heap::GetFillToAlign(Address address, AllocationAlignment alignment) { |
| 2006 intptr_t offset = OffsetFrom(address); | 2004 intptr_t offset = OffsetFrom(address); |
| 2007 if (alignment == kDoubleAligned && (offset & kDoubleAlignmentMask) != 0) | 2005 if (alignment == kDoubleAligned && (offset & kDoubleAlignmentMask) != 0) |
| 2008 return kPointerSize; | 2006 return kPointerSize; |
| 2009 if (alignment == kDoubleUnaligned && (offset & kDoubleAlignmentMask) == 0) | 2007 if (alignment == kDoubleUnaligned && (offset & kDoubleAlignmentMask) == 0) |
| 2010 return kDoubleSize - kPointerSize; // No fill if double is always aligned. | 2008 return kDoubleSize - kPointerSize; // No fill if double is always aligned. |
| 2011 if (alignment == kSimd128Unaligned) { | |
| 2012 return (kSimd128Size - (static_cast<int>(offset) + kPointerSize)) & | |
| 2013 kSimd128AlignmentMask; | |
| 2014 } | |
| 2015 return 0; | 2009 return 0; |
| 2016 } | 2010 } |
| 2017 | 2011 |
| 2018 | 2012 |
| 2019 HeapObject* Heap::PrecedeWithFiller(HeapObject* object, int filler_size) { | 2013 HeapObject* Heap::PrecedeWithFiller(HeapObject* object, int filler_size) { |
| 2020 CreateFillerObjectAt(object->address(), filler_size); | 2014 CreateFillerObjectAt(object->address(), filler_size); |
| 2021 return HeapObject::FromAddress(object->address() + filler_size); | 2015 return HeapObject::FromAddress(object->address() + filler_size); |
| 2022 } | 2016 } |
| 2023 | 2017 |
| 2024 | 2018 |
| (...skipping 4618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6643 *object_type = "CODE_TYPE"; \ | 6637 *object_type = "CODE_TYPE"; \ |
| 6644 *object_sub_type = "CODE_AGE/" #name; \ | 6638 *object_sub_type = "CODE_AGE/" #name; \ |
| 6645 return true; | 6639 return true; |
| 6646 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) | 6640 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) |
| 6647 #undef COMPARE_AND_RETURN_NAME | 6641 #undef COMPARE_AND_RETURN_NAME |
| 6648 } | 6642 } |
| 6649 return false; | 6643 return false; |
| 6650 } | 6644 } |
| 6651 } | 6645 } |
| 6652 } // namespace v8::internal | 6646 } // namespace v8::internal |
| OLD | NEW |