| 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/elements.h" | 9 #include "src/elements.h" |
| 9 #include "src/objects.h" | 10 #include "src/objects.h" |
| 10 | 11 |
| 11 namespace v8 { | 12 namespace v8 { |
| 12 namespace internal { | 13 namespace internal { |
| 13 | 14 |
| 14 | 15 |
| 15 int ElementsKindToShiftSize(ElementsKind elements_kind) { | 16 int ElementsKindToShiftSize(ElementsKind elements_kind) { |
| 16 switch (elements_kind) { | 17 switch (elements_kind) { |
| 17 case EXTERNAL_INT8_ELEMENTS: | 18 case EXTERNAL_INT8_ELEMENTS: |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 STATIC_ASSERT(FAST_SMI_ELEMENTS + kFastElementsKindPackedToHoley == | 96 STATIC_ASSERT(FAST_SMI_ELEMENTS + kFastElementsKindPackedToHoley == |
| 96 FAST_HOLEY_SMI_ELEMENTS); | 97 FAST_HOLEY_SMI_ELEMENTS); |
| 97 STATIC_ASSERT(FAST_DOUBLE_ELEMENTS + kFastElementsKindPackedToHoley == | 98 STATIC_ASSERT(FAST_DOUBLE_ELEMENTS + kFastElementsKindPackedToHoley == |
| 98 FAST_HOLEY_DOUBLE_ELEMENTS); | 99 FAST_HOLEY_DOUBLE_ELEMENTS); |
| 99 STATIC_ASSERT(FAST_ELEMENTS + kFastElementsKindPackedToHoley == | 100 STATIC_ASSERT(FAST_ELEMENTS + kFastElementsKindPackedToHoley == |
| 100 FAST_HOLEY_ELEMENTS); | 101 FAST_HOLEY_ELEMENTS); |
| 101 } | 102 } |
| 102 }; | 103 }; |
| 103 | 104 |
| 104 | 105 |
| 105 static LazyInstance<ElementsKind*, | 106 static base::LazyInstance<ElementsKind*, |
| 106 InitializeFastElementsKindSequence>::type | 107 InitializeFastElementsKindSequence>::type |
| 107 fast_elements_kind_sequence = LAZY_INSTANCE_INITIALIZER; | 108 fast_elements_kind_sequence = LAZY_INSTANCE_INITIALIZER; |
| 108 | 109 |
| 109 | 110 |
| 110 ElementsKind GetFastElementsKindFromSequenceIndex(int sequence_number) { | 111 ElementsKind GetFastElementsKindFromSequenceIndex(int sequence_number) { |
| 111 ASSERT(sequence_number >= 0 && | 112 ASSERT(sequence_number >= 0 && |
| 112 sequence_number < kFastElementsKindCount); | 113 sequence_number < kFastElementsKindCount); |
| 113 return fast_elements_kind_sequence.Get()[sequence_number]; | 114 return fast_elements_kind_sequence.Get()[sequence_number]; |
| 114 } | 115 } |
| 115 | 116 |
| 116 | 117 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 return false; | 202 return false; |
| 202 default: | 203 default: |
| 203 return false; | 204 return false; |
| 204 } | 205 } |
| 205 } | 206 } |
| 206 return false; | 207 return false; |
| 207 } | 208 } |
| 208 | 209 |
| 209 | 210 |
| 210 } } // namespace v8::internal | 211 } } // namespace v8::internal |
| OLD | NEW |