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/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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 case DICTIONARY_ELEMENTS: | 46 case DICTIONARY_ELEMENTS: |
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 return IsExternalArrayElementsKind(elements_kind) | 57 return IsExternalArrayElementsKind(elements_kind) |
57 ? 0 : (FixedArray::kHeaderSize - kSmiTagSize); | 58 ? 0 : (FixedArray::kHeaderSize - kHeapObjectTag); |
58 } | 59 } |
59 | 60 |
60 | 61 |
61 const char* ElementsKindToString(ElementsKind kind) { | 62 const char* ElementsKindToString(ElementsKind kind) { |
62 ElementsAccessor* accessor = ElementsAccessor::ForKind(kind); | 63 ElementsAccessor* accessor = ElementsAccessor::ForKind(kind); |
63 return accessor->name(); | 64 return accessor->name(); |
64 } | 65 } |
65 | 66 |
66 | 67 |
67 void PrintElementsKind(FILE* out, ElementsKind kind) { | 68 void PrintElementsKind(FILE* out, ElementsKind kind) { |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 return false; | 203 return false; |
203 default: | 204 default: |
204 return false; | 205 return false; |
205 } | 206 } |
206 } | 207 } |
207 return false; | 208 return false; |
208 } | 209 } |
209 | 210 |
210 | 211 |
211 } } // namespace v8::internal | 212 } } // namespace v8::internal |
OLD | NEW |