| 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 Handle<JSObject> holder, | 138 Handle<JSObject> holder, |
| 139 uint32_t key) { | 139 uint32_t key) { |
| 140 return GetAccessorPair(receiver, holder, key, handle(holder->elements())); | 140 return GetAccessorPair(receiver, holder, key, handle(holder->elements())); |
| 141 } | 141 } |
| 142 | 142 |
| 143 // Modifies the length data property as specified for JSArrays and resizes the | 143 // Modifies the length data property as specified for JSArrays and resizes the |
| 144 // underlying backing store accordingly. The method honors the semantics of | 144 // underlying backing store accordingly. The method honors the semantics of |
| 145 // changing array sizes as defined in EcmaScript 5.1 15.4.5.2, i.e. array that | 145 // changing array sizes as defined in EcmaScript 5.1 15.4.5.2, i.e. array that |
| 146 // have non-deletable elements can only be shrunk to the size of highest | 146 // have non-deletable elements can only be shrunk to the size of highest |
| 147 // element that is non-deletable. | 147 // element that is non-deletable. |
| 148 MUST_USE_RESULT virtual Handle<Object> SetLength( | 148 MUST_USE_RESULT virtual MaybeHandle<Object> SetLength( |
| 149 Handle<JSArray> holder, | 149 Handle<JSArray> holder, |
| 150 Handle<Object> new_length) = 0; | 150 Handle<Object> new_length) = 0; |
| 151 | 151 |
| 152 // Modifies both the length and capacity of a JSArray, resizing the underlying | 152 // Modifies both the length and capacity of a JSArray, resizing the underlying |
| 153 // backing store as necessary. This method does NOT honor the semantics of | 153 // backing store as necessary. This method does NOT honor the semantics of |
| 154 // EcmaScript 5.1 15.4.5.2, arrays can be shrunk beyond non-deletable | 154 // EcmaScript 5.1 15.4.5.2, arrays can be shrunk beyond non-deletable |
| 155 // elements. This method should only be called for array expansion OR by | 155 // elements. This method should only be called for array expansion OR by |
| 156 // runtime JavaScript code that use InternalArrays and don't care about | 156 // runtime JavaScript code that use InternalArrays and don't care about |
| 157 // EcmaScript 5.1 semantics. | 157 // EcmaScript 5.1 semantics. |
| 158 virtual void SetCapacityAndLength( | 158 virtual void SetCapacityAndLength( |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 private: | 250 private: |
| 251 static ElementsAccessor** elements_accessors_; | 251 static ElementsAccessor** elements_accessors_; |
| 252 const char* name_; | 252 const char* name_; |
| 253 | 253 |
| 254 DISALLOW_COPY_AND_ASSIGN(ElementsAccessor); | 254 DISALLOW_COPY_AND_ASSIGN(ElementsAccessor); |
| 255 }; | 255 }; |
| 256 | 256 |
| 257 void CheckArrayAbuse(Handle<JSObject> obj, const char* op, uint32_t key, | 257 void CheckArrayAbuse(Handle<JSObject> obj, const char* op, uint32_t key, |
| 258 bool allow_appending = false); | 258 bool allow_appending = false); |
| 259 | 259 |
| 260 Handle<Object> ArrayConstructInitializeElements(Handle<JSArray> array, | 260 MUST_USE_RESULT MaybeHandle<Object> ArrayConstructInitializeElements( |
| 261 Arguments* args); | 261 Handle<JSArray> array, |
| 262 Arguments* args); |
| 262 | 263 |
| 263 } } // namespace v8::internal | 264 } } // namespace v8::internal |
| 264 | 265 |
| 265 #endif // V8_ELEMENTS_H_ | 266 #endif // V8_ELEMENTS_H_ |
| OLD | NEW |