Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: src/elements.h

Issue 1191313003: More cleanup related to setting array.length (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/builtins.cc ('k') | src/elements.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « src/builtins.cc ('k') | src/elements.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698