| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 ? 0 : (FixedArray::kHeaderSize - kHeapObjectTag); | 58 ? 0 : (FixedArray::kHeaderSize - kHeapObjectTag); |
| 59 } | 59 } |
| 60 | 60 |
| 61 | 61 |
| 62 const char* ElementsKindToString(ElementsKind kind) { | 62 const char* ElementsKindToString(ElementsKind kind) { |
| 63 ElementsAccessor* accessor = ElementsAccessor::ForKind(kind); | 63 ElementsAccessor* accessor = ElementsAccessor::ForKind(kind); |
| 64 return accessor->name(); | 64 return accessor->name(); |
| 65 } | 65 } |
| 66 | 66 |
| 67 | 67 |
| 68 void PrintElementsKind(FILE* out, ElementsKind kind) { | |
| 69 PrintF(out, "%s", ElementsKindToString(kind)); | |
| 70 } | |
| 71 | |
| 72 | |
| 73 ElementsKind GetInitialFastElementsKind() { | 68 ElementsKind GetInitialFastElementsKind() { |
| 74 if (FLAG_packed_arrays) { | 69 if (FLAG_packed_arrays) { |
| 75 return FAST_SMI_ELEMENTS; | 70 return FAST_SMI_ELEMENTS; |
| 76 } else { | 71 } else { |
| 77 return FAST_HOLEY_SMI_ELEMENTS; | 72 return FAST_HOLEY_SMI_ELEMENTS; |
| 78 } | 73 } |
| 79 } | 74 } |
| 80 | 75 |
| 81 | 76 |
| 82 struct InitializeFastElementsKindSequence { | 77 struct InitializeFastElementsKindSequence { |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 return false; | 198 return false; |
| 204 default: | 199 default: |
| 205 return false; | 200 return false; |
| 206 } | 201 } |
| 207 } | 202 } |
| 208 return false; | 203 return false; |
| 209 } | 204 } |
| 210 | 205 |
| 211 | 206 |
| 212 } } // namespace v8::internal | 207 } } // namespace v8::internal |
| OLD | NEW |