| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 124 |
| 125 // Returns a shared ElementsAccessor for the specified ElementsKind. | 125 // Returns a shared ElementsAccessor for the specified ElementsKind. |
| 126 static ElementsAccessor* ForKind(ElementsKind elements_kind) { | 126 static ElementsAccessor* ForKind(ElementsKind elements_kind) { |
| 127 ASSERT(elements_kind < kElementsKindCount); | 127 ASSERT(elements_kind < kElementsKindCount); |
| 128 return elements_accessors_[elements_kind]; | 128 return elements_accessors_[elements_kind]; |
| 129 } | 129 } |
| 130 | 130 |
| 131 static ElementsAccessor* ForArray(FixedArrayBase* array); | 131 static ElementsAccessor* ForArray(FixedArrayBase* array); |
| 132 | 132 |
| 133 static void InitializeOncePerProcess(); | 133 static void InitializeOncePerProcess(); |
| 134 static void TearDown(); |
| 134 | 135 |
| 135 protected: | 136 protected: |
| 136 friend class NonStrictArgumentsElementsAccessor; | 137 friend class NonStrictArgumentsElementsAccessor; |
| 137 | 138 |
| 138 virtual uint32_t GetCapacity(FixedArrayBase* backing_store) = 0; | 139 virtual uint32_t GetCapacity(FixedArrayBase* backing_store) = 0; |
| 139 | 140 |
| 140 // Element handlers distinguish between indexes and keys when they manipulate | 141 // Element handlers distinguish between indexes and keys when they manipulate |
| 141 // elements. Indexes refer to elements in terms of their location in the | 142 // elements. Indexes refer to elements in terms of their location in the |
| 142 // underlying storage's backing store representation, and are between 0 and | 143 // underlying storage's backing store representation, and are between 0 and |
| 143 // GetCapacity. Keys refer to elements in terms of the value that would be | 144 // GetCapacity. Keys refer to elements in terms of the value that would be |
| (...skipping 17 matching lines...) Expand all Loading... |
| 161 uint32_t from_start, | 162 uint32_t from_start, |
| 162 FixedArray* to_obj, | 163 FixedArray* to_obj, |
| 163 ElementsKind to_kind, | 164 ElementsKind to_kind, |
| 164 uint32_t to_start, | 165 uint32_t to_start, |
| 165 int copy_size); | 166 int copy_size); |
| 166 | 167 |
| 167 | 168 |
| 168 } } // namespace v8::internal | 169 } } // namespace v8::internal |
| 169 | 170 |
| 170 #endif // V8_ELEMENTS_H_ | 171 #endif // V8_ELEMENTS_H_ |
| OLD | NEW |