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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
137 static const int kCopyToEndAndInitializeToHole = -2; | 137 static const int kCopyToEndAndInitializeToHole = -2; |
138 | 138 |
139 // Copy elements from one backing store to another. Typically, callers specify | 139 // Copy elements from one backing store to another. Typically, callers specify |
140 // the source JSObject or JSArray in source_holder. If the holder's backing | 140 // the source JSObject or JSArray in source_holder. If the holder's backing |
141 // store is available, it can be passed in source and source_holder is | 141 // store is available, it can be passed in source and source_holder is |
142 // ignored. | 142 // ignored. |
143 MUST_USE_RESULT virtual MaybeObject* CopyElements( | 143 MUST_USE_RESULT virtual MaybeObject* CopyElements( |
144 JSObject* source_holder, | 144 JSObject* source_holder, |
145 uint32_t source_start, | 145 uint32_t source_start, |
146 FixedArrayBase* destination, | 146 FixedArrayBase* destination, |
147 ElementsKind destination_kind, | 147 ElementsKind from_kind, |
danno
2012/11/29 15:42:28
from_kind -> source_kind, perhaps group with other
| |
148 uint32_t destination_start, | 148 uint32_t destination_start, |
149 int copy_size, | 149 int copy_size, |
150 FixedArrayBase* source = NULL) = 0; | 150 FixedArrayBase* source = NULL) = 0; |
151 | 151 |
152 MUST_USE_RESULT MaybeObject* CopyElements(JSObject* from_holder, | 152 MUST_USE_RESULT MaybeObject* CopyElements(JSObject* from_holder, |
153 FixedArrayBase* to, | 153 FixedArrayBase* to, |
154 ElementsKind to_kind, | 154 ElementsKind from_kind, |
155 FixedArrayBase* from = NULL) { | 155 FixedArrayBase* from = NULL) { |
156 return CopyElements(from_holder, 0, to, to_kind, 0, | 156 return CopyElements(from_holder, 0, to, from_kind, 0, |
157 kCopyToEndAndInitializeToHole, from); | 157 kCopyToEndAndInitializeToHole, from); |
158 } | 158 } |
159 | 159 |
160 MUST_USE_RESULT virtual MaybeObject* AddElementsToFixedArray( | 160 MUST_USE_RESULT virtual MaybeObject* AddElementsToFixedArray( |
161 Object* receiver, | 161 Object* receiver, |
162 JSObject* holder, | 162 JSObject* holder, |
163 FixedArray* to, | 163 FixedArray* to, |
164 FixedArrayBase* from = NULL) = 0; | 164 FixedArrayBase* from = NULL) = 0; |
165 | 165 |
166 // Returns a shared ElementsAccessor for the specified ElementsKind. | 166 // Returns a shared ElementsAccessor for the specified ElementsKind. |
(...skipping 26 matching lines...) Expand all Loading... | |
193 private: | 193 private: |
194 static ElementsAccessor** elements_accessors_; | 194 static ElementsAccessor** elements_accessors_; |
195 const char* name_; | 195 const char* name_; |
196 | 196 |
197 DISALLOW_COPY_AND_ASSIGN(ElementsAccessor); | 197 DISALLOW_COPY_AND_ASSIGN(ElementsAccessor); |
198 }; | 198 }; |
199 | 199 |
200 } } // namespace v8::internal | 200 } } // namespace v8::internal |
201 | 201 |
202 #endif // V8_ELEMENTS_H_ | 202 #endif // V8_ELEMENTS_H_ |
OLD | NEW |