| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 // backing store as necessary. This method does NOT honor the semantics of | 95 // backing store as necessary. This method does NOT honor the semantics of |
| 96 // EcmaScript 5.1 15.4.5.2, arrays can be shrunk beyond non-deletable | 96 // EcmaScript 5.1 15.4.5.2, arrays can be shrunk beyond non-deletable |
| 97 // elements. This method should only be called for array expansion OR by | 97 // elements. This method should only be called for array expansion OR by |
| 98 // runtime JavaScript code that use InternalArrays and don't care about | 98 // runtime JavaScript code that use InternalArrays and don't care about |
| 99 // EcmaScript 5.1 semantics. | 99 // EcmaScript 5.1 semantics. |
| 100 virtual void SetCapacityAndLength( | 100 virtual void SetCapacityAndLength( |
| 101 Handle<JSArray> array, | 101 Handle<JSArray> array, |
| 102 int capacity, | 102 int capacity, |
| 103 int length) = 0; | 103 int length) = 0; |
| 104 | 104 |
| 105 // Deletes an element in an object, returning a new elements backing store. | 105 // Deletes an element in an object. |
| 106 MUST_USE_RESULT virtual MaybeHandle<Object> Delete( | 106 virtual void Delete(Handle<JSObject> holder, uint32_t key, |
| 107 Handle<JSObject> holder, uint32_t key, LanguageMode language_mode) = 0; | 107 LanguageMode language_mode) = 0; |
| 108 | 108 |
| 109 // If kCopyToEnd is specified as the copy_size to CopyElements, it copies all | 109 // If kCopyToEnd is specified as the copy_size to CopyElements, it copies all |
| 110 // of elements from source after source_start to the destination array. | 110 // of elements from source after source_start to the destination array. |
| 111 static const int kCopyToEnd = -1; | 111 static const int kCopyToEnd = -1; |
| 112 // If kCopyToEndAndInitializeToHole is specified as the copy_size to | 112 // If kCopyToEndAndInitializeToHole is specified as the copy_size to |
| 113 // CopyElements, it copies all of elements from source after source_start to | 113 // CopyElements, it copies all of elements from source after source_start to |
| 114 // destination array, padding any remaining uninitialized elements in the | 114 // destination array, padding any remaining uninitialized elements in the |
| 115 // destination array with the hole. | 115 // destination array with the hole. |
| 116 static const int kCopyToEndAndInitializeToHole = -2; | 116 static const int kCopyToEndAndInitializeToHole = -2; |
| 117 | 117 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 void CheckArrayAbuse(Handle<JSObject> obj, const char* op, uint32_t key, | 197 void CheckArrayAbuse(Handle<JSObject> obj, const char* op, uint32_t key, |
| 198 bool allow_appending = false); | 198 bool allow_appending = false); |
| 199 | 199 |
| 200 MUST_USE_RESULT MaybeHandle<Object> ArrayConstructInitializeElements( | 200 MUST_USE_RESULT MaybeHandle<Object> ArrayConstructInitializeElements( |
| 201 Handle<JSArray> array, | 201 Handle<JSArray> array, |
| 202 Arguments* args); | 202 Arguments* args); |
| 203 | 203 |
| 204 } } // namespace v8::internal | 204 } } // namespace v8::internal |
| 205 | 205 |
| 206 #endif // V8_ELEMENTS_H_ | 206 #endif // V8_ELEMENTS_H_ |
| OLD | NEW |