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 #ifndef V8_ELEMENTS_H_ | 5 #ifndef V8_ELEMENTS_H_ |
6 #define V8_ELEMENTS_H_ | 6 #define V8_ELEMENTS_H_ |
7 | 7 |
8 #include "src/elements-kind.h" | 8 #include "src/elements-kind.h" |
9 #include "src/heap/heap.h" | 9 #include "src/heap/heap.h" |
10 #include "src/isolate.h" | 10 #include "src/isolate.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 } | 69 } |
70 | 70 |
71 // Modifies the length data property as specified for JSArrays and resizes the | 71 // Modifies the length data property as specified for JSArrays and resizes the |
72 // underlying backing store accordingly. The method honors the semantics of | 72 // underlying backing store accordingly. The method honors the semantics of |
73 // changing array sizes as defined in EcmaScript 5.1 15.4.5.2, i.e. array that | 73 // changing array sizes as defined in EcmaScript 5.1 15.4.5.2, i.e. array that |
74 // have non-deletable elements can only be shrunk to the size of highest | 74 // have non-deletable elements can only be shrunk to the size of highest |
75 // element that is non-deletable. | 75 // element that is non-deletable. |
76 virtual void SetLength(Handle<JSArray> holder, uint32_t new_length) = 0; | 76 virtual void SetLength(Handle<JSArray> holder, uint32_t new_length) = 0; |
77 | 77 |
78 // Deletes an element in an object. | 78 // Deletes an element in an object. |
79 virtual void Delete(Handle<JSObject> holder, uint32_t key, | 79 virtual void Delete(Handle<JSObject> holder, uint32_t index) = 0; |
80 LanguageMode language_mode) = 0; | |
81 | 80 |
82 // If kCopyToEnd is specified as the copy_size to CopyElements, it copies all | 81 // If kCopyToEnd is specified as the copy_size to CopyElements, it copies all |
83 // of elements from source after source_start to the destination array. | 82 // of elements from source after source_start to the destination array. |
84 static const int kCopyToEnd = -1; | 83 static const int kCopyToEnd = -1; |
85 // If kCopyToEndAndInitializeToHole is specified as the copy_size to | 84 // If kCopyToEndAndInitializeToHole is specified as the copy_size to |
86 // CopyElements, it copies all of elements from source after source_start to | 85 // CopyElements, it copies all of elements from source after source_start to |
87 // destination array, padding any remaining uninitialized elements in the | 86 // destination array, padding any remaining uninitialized elements in the |
88 // destination array with the hole. | 87 // destination array with the hole. |
89 static const int kCopyToEndAndInitializeToHole = -2; | 88 static const int kCopyToEndAndInitializeToHole = -2; |
90 | 89 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 void CheckArrayAbuse(Handle<JSObject> obj, const char* op, uint32_t key, | 182 void CheckArrayAbuse(Handle<JSObject> obj, const char* op, uint32_t key, |
184 bool allow_appending = false); | 183 bool allow_appending = false); |
185 | 184 |
186 MUST_USE_RESULT MaybeHandle<Object> ArrayConstructInitializeElements( | 185 MUST_USE_RESULT MaybeHandle<Object> ArrayConstructInitializeElements( |
187 Handle<JSArray> array, | 186 Handle<JSArray> array, |
188 Arguments* args); | 187 Arguments* args); |
189 | 188 |
190 } } // namespace v8::internal | 189 } } // namespace v8::internal |
191 | 190 |
192 #endif // V8_ELEMENTS_H_ | 191 #endif // V8_ELEMENTS_H_ |
OLD | NEW |