OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 friend class v8::ImplementationUtilities; | 160 friend class v8::ImplementationUtilities; |
161 }; | 161 }; |
162 | 162 |
163 | 163 |
164 // ---------------------------------------------------------------------------- | 164 // ---------------------------------------------------------------------------- |
165 // Handle operations. | 165 // Handle operations. |
166 // They might invoke garbage collection. The result is an handle to | 166 // They might invoke garbage collection. The result is an handle to |
167 // an object of expected type, or the handle is an error if running out | 167 // an object of expected type, or the handle is an error if running out |
168 // of space or encountering an internal error. | 168 // of space or encountering an internal error. |
169 | 169 |
170 void NormalizeProperties(Handle<JSObject> object, | |
171 PropertyNormalizationMode mode, | |
172 int expected_additional_properties); | |
173 Handle<NumberDictionary> NormalizeElements(Handle<JSObject> object); | |
174 void TransformToFastProperties(Handle<JSObject> object, | |
175 int unused_property_fields); | |
176 MUST_USE_RESULT Handle<NumberDictionary> NumberDictionarySet( | |
177 Handle<NumberDictionary> dictionary, | |
178 uint32_t index, | |
179 Handle<Object> value, | |
180 PropertyDetails details); | |
181 | |
182 // Flattens a string. | 170 // Flattens a string. |
183 void FlattenString(Handle<String> str); | 171 void FlattenString(Handle<String> str); |
184 | 172 |
185 // Flattens a string and returns the underlying external or sequential | 173 // Flattens a string and returns the underlying external or sequential |
186 // string. | 174 // string. |
187 Handle<String> FlattenGetString(Handle<String> str); | 175 Handle<String> FlattenGetString(Handle<String> str); |
188 | 176 |
189 Handle<Object> SetProperty(Handle<JSReceiver> object, | |
190 Handle<String> key, | |
191 Handle<Object> value, | |
192 PropertyAttributes attributes, | |
193 StrictModeFlag strict_mode); | |
194 | |
195 Handle<Object> SetProperty(Handle<Object> object, | 177 Handle<Object> SetProperty(Handle<Object> object, |
196 Handle<Object> key, | 178 Handle<Object> key, |
197 Handle<Object> value, | 179 Handle<Object> value, |
198 PropertyAttributes attributes, | 180 PropertyAttributes attributes, |
199 StrictModeFlag strict_mode); | 181 StrictModeFlag strict_mode); |
200 | 182 |
201 Handle<Object> ForceSetProperty(Handle<JSObject> object, | 183 Handle<Object> ForceSetProperty(Handle<JSObject> object, |
202 Handle<Object> key, | 184 Handle<Object> key, |
203 Handle<Object> value, | 185 Handle<Object> value, |
204 PropertyAttributes attributes); | 186 PropertyAttributes attributes); |
205 | 187 |
206 Handle<Object> SetNormalizedProperty(Handle<JSObject> object, | |
207 Handle<String> key, | |
208 Handle<Object> value, | |
209 PropertyDetails details); | |
210 | |
211 Handle<Object> ForceDeleteProperty(Handle<JSObject> object, | 188 Handle<Object> ForceDeleteProperty(Handle<JSObject> object, |
212 Handle<Object> key); | 189 Handle<Object> key); |
213 | 190 |
214 Handle<Object> SetLocalPropertyIgnoreAttributes( | |
215 Handle<JSObject> object, | |
216 Handle<String> key, | |
217 Handle<Object> value, | |
218 PropertyAttributes attributes); | |
219 | |
220 // Used to set local properties on the object we totally control | |
221 // and which therefore has no accessors and alikes. | |
222 void SetLocalPropertyNoThrow(Handle<JSObject> object, | |
223 Handle<String> key, | |
224 Handle<Object> value, | |
225 PropertyAttributes attributes = NONE); | |
226 | |
227 MUST_USE_RESULT Handle<Object> SetElement(Handle<JSObject> object, | |
228 uint32_t index, | |
229 Handle<Object> value, | |
230 StrictModeFlag strict_mode); | |
231 | |
232 Handle<Object> SetOwnElement(Handle<JSObject> object, | |
233 uint32_t index, | |
234 Handle<Object> value, | |
235 StrictModeFlag strict_mode); | |
236 | |
237 Handle<Object> TransitionElementsKind(Handle<JSObject> object, | |
238 ElementsKind to_kind); | |
239 | |
240 Handle<Object> GetProperty(Handle<JSReceiver> obj, | 191 Handle<Object> GetProperty(Handle<JSReceiver> obj, |
241 const char* name); | 192 const char* name); |
242 | 193 |
243 Handle<Object> GetProperty(Handle<Object> obj, | 194 Handle<Object> GetProperty(Handle<Object> obj, |
244 Handle<Object> key); | 195 Handle<Object> key); |
245 | 196 |
246 Handle<Object> GetPropertyWithInterceptor(Handle<JSObject> receiver, | 197 Handle<Object> GetPropertyWithInterceptor(Handle<JSObject> receiver, |
247 Handle<JSObject> holder, | 198 Handle<JSObject> holder, |
248 Handle<String> name, | 199 Handle<String> name, |
249 PropertyAttributes* attributes); | 200 PropertyAttributes* attributes); |
250 | 201 |
251 Handle<Object> GetPrototype(Handle<Object> obj); | |
252 | |
253 Handle<Object> SetPrototype(Handle<JSObject> obj, Handle<Object> value); | 202 Handle<Object> SetPrototype(Handle<JSObject> obj, Handle<Object> value); |
254 | 203 |
255 // Sets a hidden property on an object. Returns obj on success, undefined | |
256 // if trying to set the property on a detached proxy. | |
257 Handle<Object> SetHiddenProperty(Handle<JSObject> obj, | |
258 Handle<String> key, | |
259 Handle<Object> value); | |
260 | |
261 int GetIdentityHash(Handle<JSReceiver> obj); | |
262 | |
263 Handle<Object> DeleteElement(Handle<JSObject> obj, uint32_t index); | |
264 Handle<Object> DeleteProperty(Handle<JSObject> obj, Handle<String> prop); | |
265 | |
266 Handle<Object> LookupSingleCharacterStringFromCode(uint32_t index); | 204 Handle<Object> LookupSingleCharacterStringFromCode(uint32_t index); |
267 | 205 |
268 Handle<JSObject> Copy(Handle<JSObject> obj); | 206 Handle<JSObject> Copy(Handle<JSObject> obj); |
269 | 207 |
270 Handle<Object> SetAccessor(Handle<JSObject> obj, Handle<AccessorInfo> info); | 208 Handle<Object> SetAccessor(Handle<JSObject> obj, Handle<AccessorInfo> info); |
271 | 209 |
272 Handle<FixedArray> AddKeysFromJSArray(Handle<FixedArray>, | 210 Handle<FixedArray> AddKeysFromJSArray(Handle<FixedArray>, |
273 Handle<JSArray> array); | 211 Handle<JSArray> array); |
274 | 212 |
275 // Get the JS object corresponding to the given script; create it | 213 // Get the JS object corresponding to the given script; create it |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 // Computes the union of keys and return the result. | 247 // Computes the union of keys and return the result. |
310 // Used for implementing "for (n in object) { }" | 248 // Used for implementing "for (n in object) { }" |
311 Handle<FixedArray> UnionOfKeys(Handle<FixedArray> first, | 249 Handle<FixedArray> UnionOfKeys(Handle<FixedArray> first, |
312 Handle<FixedArray> second); | 250 Handle<FixedArray> second); |
313 | 251 |
314 Handle<String> SubString(Handle<String> str, | 252 Handle<String> SubString(Handle<String> str, |
315 int start, | 253 int start, |
316 int end, | 254 int end, |
317 PretenureFlag pretenure = NOT_TENURED); | 255 PretenureFlag pretenure = NOT_TENURED); |
318 | 256 |
319 | |
320 // Sets the expected number of properties for the function's instances. | 257 // Sets the expected number of properties for the function's instances. |
321 void SetExpectedNofProperties(Handle<JSFunction> func, int nof); | 258 void SetExpectedNofProperties(Handle<JSFunction> func, int nof); |
322 | 259 |
323 // Sets the prototype property for a function instance. | 260 // Sets the prototype property for a function instance. |
324 void SetPrototypeProperty(Handle<JSFunction> func, Handle<JSObject> value); | 261 void SetPrototypeProperty(Handle<JSFunction> func, Handle<JSObject> value); |
325 | 262 |
326 // Sets the expected number of properties based on estimate from compiler. | 263 // Sets the expected number of properties based on estimate from compiler. |
327 void SetExpectedNofPropertiesFromEstimate(Handle<SharedFunctionInfo> shared, | 264 void SetExpectedNofPropertiesFromEstimate(Handle<SharedFunctionInfo> shared, |
328 int estimate); | 265 int estimate); |
329 | 266 |
330 | 267 |
331 Handle<JSGlobalProxy> ReinitializeJSGlobalProxy( | 268 Handle<JSGlobalProxy> ReinitializeJSGlobalProxy( |
332 Handle<JSFunction> constructor, | 269 Handle<JSFunction> constructor, |
333 Handle<JSGlobalProxy> global); | 270 Handle<JSGlobalProxy> global); |
334 | 271 |
335 Handle<Object> SetPrototype(Handle<JSFunction> function, | 272 Handle<Object> SetPrototype(Handle<JSFunction> function, |
336 Handle<Object> prototype); | 273 Handle<Object> prototype); |
337 | 274 |
338 Handle<Object> PreventExtensions(Handle<JSObject> object); | |
339 | |
340 Handle<ObjectHashSet> ObjectHashSetAdd(Handle<ObjectHashSet> table, | 275 Handle<ObjectHashSet> ObjectHashSetAdd(Handle<ObjectHashSet> table, |
341 Handle<Object> key); | 276 Handle<Object> key); |
342 | 277 |
343 Handle<ObjectHashSet> ObjectHashSetRemove(Handle<ObjectHashSet> table, | 278 Handle<ObjectHashSet> ObjectHashSetRemove(Handle<ObjectHashSet> table, |
344 Handle<Object> key); | 279 Handle<Object> key); |
345 | 280 |
346 Handle<ObjectHashTable> PutIntoObjectHashTable(Handle<ObjectHashTable> table, | 281 Handle<ObjectHashTable> PutIntoObjectHashTable(Handle<ObjectHashTable> table, |
347 Handle<Object> key, | 282 Handle<Object> key, |
348 Handle<Object> value); | 283 Handle<Object> value); |
349 | 284 |
350 class NoHandleAllocation BASE_EMBEDDED { | 285 class NoHandleAllocation BASE_EMBEDDED { |
351 public: | 286 public: |
352 #ifndef DEBUG | 287 #ifndef DEBUG |
353 NoHandleAllocation() {} | 288 NoHandleAllocation() {} |
354 ~NoHandleAllocation() {} | 289 ~NoHandleAllocation() {} |
355 #else | 290 #else |
356 inline NoHandleAllocation(); | 291 inline NoHandleAllocation(); |
357 inline ~NoHandleAllocation(); | 292 inline ~NoHandleAllocation(); |
358 private: | 293 private: |
359 int level_; | 294 int level_; |
360 #endif | 295 #endif |
361 }; | 296 }; |
362 | 297 |
363 } } // namespace v8::internal | 298 } } // namespace v8::internal |
364 | 299 |
365 #endif // V8_HANDLES_H_ | 300 #endif // V8_HANDLES_H_ |
OLD | NEW |