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