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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 inline MaybeHandle<AccessorPair> GetAccessorPair(Handle<JSObject> holder, | 67 inline MaybeHandle<AccessorPair> GetAccessorPair(Handle<JSObject> holder, |
68 uint32_t key) { | 68 uint32_t key) { |
69 return GetAccessorPair(holder, key, handle(holder->elements())); | 69 return GetAccessorPair(holder, key, handle(holder->elements())); |
70 } | 70 } |
71 | 71 |
72 // Modifies the length data property as specified for JSArrays and resizes the | 72 // Modifies the length data property as specified for JSArrays and resizes the |
73 // underlying backing store accordingly. The method honors the semantics of | 73 // underlying backing store accordingly. The method honors the semantics of |
74 // changing array sizes as defined in EcmaScript 5.1 15.4.5.2, i.e. array that | 74 // changing array sizes as defined in EcmaScript 5.1 15.4.5.2, i.e. array that |
75 // have non-deletable elements can only be shrunk to the size of highest | 75 // have non-deletable elements can only be shrunk to the size of highest |
76 // element that is non-deletable. | 76 // element that is non-deletable. |
77 MUST_USE_RESULT virtual MaybeHandle<Object> SetLength( | 77 virtual void SetLength(Handle<JSArray> holder, uint32_t new_length) = 0; |
78 Handle<JSArray> holder, | |
79 Handle<Object> new_length) = 0; | |
80 | 78 |
81 // Modifies both the length and capacity of a JSArray, resizing the underlying | 79 // Modifies both the length and capacity of a JSArray, resizing the underlying |
82 // backing store as necessary. This method does NOT honor the semantics of | 80 // backing store as necessary. This method does NOT honor the semantics of |
83 // EcmaScript 5.1 15.4.5.2, arrays can be shrunk beyond non-deletable | 81 // EcmaScript 5.1 15.4.5.2, arrays can be shrunk beyond non-deletable |
84 // elements. This method should only be called for array expansion OR by | 82 // elements. This method should only be called for array expansion OR by |
85 // runtime JavaScript code that use InternalArrays and don't care about | 83 // runtime JavaScript code that use InternalArrays and don't care about |
86 // EcmaScript 5.1 semantics. | 84 // EcmaScript 5.1 semantics. |
87 virtual void SetCapacityAndLength( | 85 virtual void SetCapacityAndLength( |
88 Handle<JSArray> array, | 86 Handle<JSArray> array, |
89 int capacity, | 87 int capacity, |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 void CheckArrayAbuse(Handle<JSObject> obj, const char* op, uint32_t key, | 186 void CheckArrayAbuse(Handle<JSObject> obj, const char* op, uint32_t key, |
189 bool allow_appending = false); | 187 bool allow_appending = false); |
190 | 188 |
191 MUST_USE_RESULT MaybeHandle<Object> ArrayConstructInitializeElements( | 189 MUST_USE_RESULT MaybeHandle<Object> ArrayConstructInitializeElements( |
192 Handle<JSArray> array, | 190 Handle<JSArray> array, |
193 Arguments* args); | 191 Arguments* args); |
194 | 192 |
195 } } // namespace v8::internal | 193 } } // namespace v8::internal |
196 | 194 |
197 #endif // V8_ELEMENTS_H_ | 195 #endif // V8_ELEMENTS_H_ |
OLD | NEW |