| 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 "elements-kind.h" | 5 #include "elements-kind.h" | 
| 6 | 6 | 
| 7 #include "api.h" | 7 #include "api.h" | 
| 8 #include "elements.h" | 8 #include "elements.h" | 
| 9 #include "objects.h" | 9 #include "objects.h" | 
| 10 | 10 | 
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 44     case FAST_HOLEY_ELEMENTS: | 44     case FAST_HOLEY_ELEMENTS: | 
| 45     case DICTIONARY_ELEMENTS: | 45     case DICTIONARY_ELEMENTS: | 
| 46     case SLOPPY_ARGUMENTS_ELEMENTS: | 46     case SLOPPY_ARGUMENTS_ELEMENTS: | 
| 47       return kPointerSizeLog2; | 47       return kPointerSizeLog2; | 
| 48   } | 48   } | 
| 49   UNREACHABLE(); | 49   UNREACHABLE(); | 
| 50   return 0; | 50   return 0; | 
| 51 } | 51 } | 
| 52 | 52 | 
| 53 | 53 | 
|  | 54 int GetDefaultHeaderSizeForElementsKind(ElementsKind elements_kind) { | 
|  | 55   return IsExternalArrayElementsKind(elements_kind) | 
|  | 56       ? 0 : (FixedArray::kHeaderSize - kSmiTagSize); | 
|  | 57 } | 
|  | 58 | 
|  | 59 | 
| 54 const char* ElementsKindToString(ElementsKind kind) { | 60 const char* ElementsKindToString(ElementsKind kind) { | 
| 55   ElementsAccessor* accessor = ElementsAccessor::ForKind(kind); | 61   ElementsAccessor* accessor = ElementsAccessor::ForKind(kind); | 
| 56   return accessor->name(); | 62   return accessor->name(); | 
| 57 } | 63 } | 
| 58 | 64 | 
| 59 | 65 | 
| 60 void PrintElementsKind(FILE* out, ElementsKind kind) { | 66 void PrintElementsKind(FILE* out, ElementsKind kind) { | 
| 61   PrintF(out, "%s", ElementsKindToString(kind)); | 67   PrintF(out, "%s", ElementsKindToString(kind)); | 
| 62 } | 68 } | 
| 63 | 69 | 
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 195         return false; | 201         return false; | 
| 196       default: | 202       default: | 
| 197         return false; | 203         return false; | 
| 198     } | 204     } | 
| 199   } | 205   } | 
| 200   return false; | 206   return false; | 
| 201 } | 207 } | 
| 202 | 208 | 
| 203 | 209 | 
| 204 } }  // namespace v8::internal | 210 } }  // namespace v8::internal | 
| OLD | NEW | 
|---|