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

Side by Side Diff: src/elements.h

Issue 231103002: Object::GetElements() and friends maybehandlification. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: FixedArray::UnionOfKeys() maybehandlified Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « src/debug.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 // 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 Handle<JSObject> holder, 66 Handle<JSObject> holder,
67 uint32_t key) { 67 uint32_t key) {
68 return HasElement(receiver, holder, key, handle(holder->elements())); 68 return HasElement(receiver, holder, key, handle(holder->elements()));
69 } 69 }
70 70
71 // Returns the element with the specified key or undefined if there is no such 71 // Returns the element with the specified key or undefined if there is no such
72 // element. This method doesn't iterate up the prototype chain. The caller 72 // element. This method doesn't iterate up the prototype chain. The caller
73 // can optionally pass in the backing store to use for the check, which must 73 // can optionally pass in the backing store to use for the check, which must
74 // be compatible with the ElementsKind of the ElementsAccessor. If 74 // be compatible with the ElementsKind of the ElementsAccessor. If
75 // backing_store is NULL, the holder->elements() is used as the backing store. 75 // backing_store is NULL, the holder->elements() is used as the backing store.
76 MUST_USE_RESULT virtual Handle<Object> Get( 76 MUST_USE_RESULT virtual MaybeHandle<Object> Get(
77 Handle<Object> receiver, 77 Handle<Object> receiver,
78 Handle<JSObject> holder, 78 Handle<JSObject> holder,
79 uint32_t key, 79 uint32_t key,
80 Handle<FixedArrayBase> backing_store) = 0; 80 Handle<FixedArrayBase> backing_store) = 0;
81 81
82 MUST_USE_RESULT inline Handle<Object> Get( 82 MUST_USE_RESULT inline MaybeHandle<Object> Get(
83 Handle<Object> receiver, 83 Handle<Object> receiver,
84 Handle<JSObject> holder, 84 Handle<JSObject> holder,
85 uint32_t key) { 85 uint32_t key) {
86 return Get(receiver, holder, key, handle(holder->elements())); 86 return Get(receiver, holder, key, handle(holder->elements()));
87 } 87 }
88 88
89 // Returns an element's attributes, or ABSENT if there is no such 89 // Returns an element's attributes, or ABSENT if there is no such
90 // element. This method doesn't iterate up the prototype chain. The caller 90 // element. This method doesn't iterate up the prototype chain. The caller
91 // can optionally pass in the backing store to use for the check, which must 91 // can optionally pass in the backing store to use for the check, which must
92 // be compatible with the ElementsKind of the ElementsAccessor. If 92 // be compatible with the ElementsKind of the ElementsAccessor. If
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 int copy_size) = 0; 199 int copy_size) = 0;
200 200
201 inline void CopyElements( 201 inline void CopyElements(
202 Handle<JSObject> from_holder, 202 Handle<JSObject> from_holder,
203 Handle<FixedArrayBase> to, 203 Handle<FixedArrayBase> to,
204 ElementsKind from_kind) { 204 ElementsKind from_kind) {
205 CopyElements( 205 CopyElements(
206 *from_holder, 0, from_kind, to, 0, kCopyToEndAndInitializeToHole); 206 *from_holder, 0, from_kind, to, 0, kCopyToEndAndInitializeToHole);
207 } 207 }
208 208
209 virtual Handle<FixedArray> AddElementsToFixedArray( 209 MUST_USE_RESULT virtual MaybeHandle<FixedArray> AddElementsToFixedArray(
210 Handle<Object> receiver, 210 Handle<Object> receiver,
211 Handle<JSObject> holder, 211 Handle<JSObject> holder,
212 Handle<FixedArray> to, 212 Handle<FixedArray> to,
213 Handle<FixedArrayBase> from) = 0; 213 Handle<FixedArrayBase> from) = 0;
214 214
215 inline Handle<FixedArray> AddElementsToFixedArray( 215 MUST_USE_RESULT inline MaybeHandle<FixedArray> AddElementsToFixedArray(
216 Handle<Object> receiver, 216 Handle<Object> receiver,
217 Handle<JSObject> holder, 217 Handle<JSObject> holder,
218 Handle<FixedArray> to) { 218 Handle<FixedArray> to) {
219 return AddElementsToFixedArray( 219 return AddElementsToFixedArray(
220 receiver, holder, to, handle(holder->elements())); 220 receiver, holder, to, handle(holder->elements()));
221 } 221 }
222 222
223 // Returns a shared ElementsAccessor for the specified ElementsKind. 223 // Returns a shared ElementsAccessor for the specified ElementsKind.
224 static ElementsAccessor* ForKind(ElementsKind elements_kind) { 224 static ElementsAccessor* ForKind(ElementsKind elements_kind) {
225 ASSERT(elements_kind < kElementsKindCount); 225 ASSERT(elements_kind < kElementsKindCount);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 MUST_USE_RESULT MaybeHandle<Object> ArrayConstructInitializeElements( 260 MUST_USE_RESULT MaybeHandle<Object> ArrayConstructInitializeElements(
261 Handle<JSArray> array, 261 Handle<JSArray> array,
262 Arguments* args); 262 Arguments* args);
263 263
264 } } // namespace v8::internal 264 } } // namespace v8::internal
265 265
266 #endif // V8_ELEMENTS_H_ 266 #endif // V8_ELEMENTS_H_
OLDNEW
« no previous file with comments | « src/debug.cc ('k') | src/elements.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698