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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 MUST_USE_RESULT Handle<Object> SetElement(Handle<JSObject> object, | 233 MUST_USE_RESULT Handle<Object> SetElement(Handle<JSObject> object, |
234 uint32_t index, | 234 uint32_t index, |
235 Handle<Object> value, | 235 Handle<Object> value, |
236 StrictModeFlag strict_mode); | 236 StrictModeFlag strict_mode); |
237 | 237 |
238 Handle<Object> SetOwnElement(Handle<JSObject> object, | 238 Handle<Object> SetOwnElement(Handle<JSObject> object, |
239 uint32_t index, | 239 uint32_t index, |
240 Handle<Object> value, | 240 Handle<Object> value, |
241 StrictModeFlag strict_mode); | 241 StrictModeFlag strict_mode); |
242 | 242 |
| 243 Handle<Object> TransitionElementsKind(Handle<JSObject> object, |
| 244 ElementsKind to_kind); |
| 245 |
243 Handle<Object> GetProperty(Handle<JSReceiver> obj, | 246 Handle<Object> GetProperty(Handle<JSReceiver> obj, |
244 const char* name); | 247 const char* name); |
245 | 248 |
246 Handle<Object> GetProperty(Handle<Object> obj, | 249 Handle<Object> GetProperty(Handle<Object> obj, |
247 Handle<Object> key); | 250 Handle<Object> key); |
248 | 251 |
249 Handle<Object> GetProperty(Handle<JSReceiver> obj, | |
250 Handle<String> name, | |
251 LookupResult* result); | |
252 | |
253 | |
254 Handle<Object> GetElement(Handle<Object> obj, | |
255 uint32_t index); | |
256 | |
257 Handle<Object> GetPropertyWithInterceptor(Handle<JSObject> receiver, | 252 Handle<Object> GetPropertyWithInterceptor(Handle<JSObject> receiver, |
258 Handle<JSObject> holder, | 253 Handle<JSObject> holder, |
259 Handle<String> name, | 254 Handle<String> name, |
260 PropertyAttributes* attributes); | 255 PropertyAttributes* attributes); |
261 | 256 |
262 Handle<Object> GetPrototype(Handle<Object> obj); | 257 Handle<Object> GetPrototype(Handle<Object> obj); |
263 | 258 |
264 Handle<Object> SetPrototype(Handle<JSObject> obj, Handle<Object> value); | 259 Handle<Object> SetPrototype(Handle<JSObject> obj, Handle<Object> value); |
265 | 260 |
266 // Sets a hidden property on an object. Returns obj on success, undefined | 261 // Sets a hidden property on an object. Returns obj on success, undefined |
(...skipping 26 matching lines...) Expand all Loading... |
293 // does not end with a new line character, this character may optionally be | 288 // does not end with a new line character, this character may optionally be |
294 // imagined. | 289 // imagined. |
295 Handle<FixedArray> CalculateLineEnds(Handle<String> string, | 290 Handle<FixedArray> CalculateLineEnds(Handle<String> string, |
296 bool with_imaginary_last_new_line); | 291 bool with_imaginary_last_new_line); |
297 int GetScriptLineNumber(Handle<Script> script, int code_position); | 292 int GetScriptLineNumber(Handle<Script> script, int code_position); |
298 // The safe version does not make heap allocations but may work much slower. | 293 // The safe version does not make heap allocations but may work much slower. |
299 int GetScriptLineNumberSafe(Handle<Script> script, int code_position); | 294 int GetScriptLineNumberSafe(Handle<Script> script, int code_position); |
300 | 295 |
301 // Computes the enumerable keys from interceptors. Used for debug mirrors and | 296 // Computes the enumerable keys from interceptors. Used for debug mirrors and |
302 // by GetKeysInFixedArrayFor below. | 297 // by GetKeysInFixedArrayFor below. |
303 v8::Handle<v8::Array> GetKeysForNamedInterceptor(Handle<JSObject> receiver, | 298 v8::Handle<v8::Array> GetKeysForNamedInterceptor(Handle<JSReceiver> receiver, |
304 Handle<JSObject> object); | 299 Handle<JSObject> object); |
305 v8::Handle<v8::Array> GetKeysForIndexedInterceptor(Handle<JSObject> receiver, | 300 v8::Handle<v8::Array> GetKeysForIndexedInterceptor(Handle<JSReceiver> receiver, |
306 Handle<JSObject> object); | 301 Handle<JSObject> object); |
307 | 302 |
308 enum KeyCollectionType { LOCAL_ONLY, INCLUDE_PROTOS }; | 303 enum KeyCollectionType { LOCAL_ONLY, INCLUDE_PROTOS }; |
309 | 304 |
310 // Computes the enumerable keys for a JSObject. Used for implementing | 305 // Computes the enumerable keys for a JSObject. Used for implementing |
311 // "for (n in object) { }". | 306 // "for (n in object) { }". |
312 Handle<FixedArray> GetKeysInFixedArrayFor(Handle<JSObject> object, | 307 Handle<FixedArray> GetKeysInFixedArrayFor(Handle<JSReceiver> object, |
313 KeyCollectionType type); | 308 KeyCollectionType type, |
314 Handle<JSArray> GetKeysFor(Handle<JSObject> object); | 309 bool* threw); |
| 310 Handle<JSArray> GetKeysFor(Handle<JSReceiver> object, bool* threw); |
315 Handle<FixedArray> GetEnumPropertyKeys(Handle<JSObject> object, | 311 Handle<FixedArray> GetEnumPropertyKeys(Handle<JSObject> object, |
316 bool cache_result); | 312 bool cache_result); |
317 | 313 |
318 // Computes the union of keys and return the result. | 314 // Computes the union of keys and return the result. |
319 // Used for implementing "for (n in object) { }" | 315 // Used for implementing "for (n in object) { }" |
320 Handle<FixedArray> UnionOfKeys(Handle<FixedArray> first, | 316 Handle<FixedArray> UnionOfKeys(Handle<FixedArray> first, |
321 Handle<FixedArray> second); | 317 Handle<FixedArray> second); |
322 | 318 |
323 Handle<String> SubString(Handle<String> str, | 319 Handle<String> SubString(Handle<String> str, |
324 int start, | 320 int start, |
(...skipping 14 matching lines...) Expand all Loading... |
339 | 335 |
340 Handle<JSGlobalProxy> ReinitializeJSGlobalProxy( | 336 Handle<JSGlobalProxy> ReinitializeJSGlobalProxy( |
341 Handle<JSFunction> constructor, | 337 Handle<JSFunction> constructor, |
342 Handle<JSGlobalProxy> global); | 338 Handle<JSGlobalProxy> global); |
343 | 339 |
344 Handle<Object> SetPrototype(Handle<JSFunction> function, | 340 Handle<Object> SetPrototype(Handle<JSFunction> function, |
345 Handle<Object> prototype); | 341 Handle<Object> prototype); |
346 | 342 |
347 Handle<Object> PreventExtensions(Handle<JSObject> object); | 343 Handle<Object> PreventExtensions(Handle<JSObject> object); |
348 | 344 |
| 345 Handle<ObjectHashSet> ObjectHashSetAdd(Handle<ObjectHashSet> table, |
| 346 Handle<Object> key); |
| 347 |
| 348 Handle<ObjectHashSet> ObjectHashSetRemove(Handle<ObjectHashSet> table, |
| 349 Handle<Object> key); |
| 350 |
349 Handle<ObjectHashTable> PutIntoObjectHashTable(Handle<ObjectHashTable> table, | 351 Handle<ObjectHashTable> PutIntoObjectHashTable(Handle<ObjectHashTable> table, |
350 Handle<JSReceiver> key, | 352 Handle<Object> key, |
351 Handle<Object> value); | 353 Handle<Object> value); |
352 | 354 |
353 // Does lazy compilation of the given function. Returns true on success and | |
354 // false if the compilation resulted in a stack overflow. | |
355 enum ClearExceptionFlag { KEEP_EXCEPTION, CLEAR_EXCEPTION }; | |
356 | |
357 bool EnsureCompiled(Handle<SharedFunctionInfo> shared, | |
358 ClearExceptionFlag flag); | |
359 | |
360 bool CompileLazyShared(Handle<SharedFunctionInfo> shared, | |
361 ClearExceptionFlag flag); | |
362 | |
363 bool CompileLazy(Handle<JSFunction> function, ClearExceptionFlag flag); | |
364 | |
365 bool CompileOptimized(Handle<JSFunction> function, | |
366 int osr_ast_id, | |
367 ClearExceptionFlag flag); | |
368 | |
369 class NoHandleAllocation BASE_EMBEDDED { | 355 class NoHandleAllocation BASE_EMBEDDED { |
370 public: | 356 public: |
371 #ifndef DEBUG | 357 #ifndef DEBUG |
372 NoHandleAllocation() {} | 358 NoHandleAllocation() {} |
373 ~NoHandleAllocation() {} | 359 ~NoHandleAllocation() {} |
374 #else | 360 #else |
375 inline NoHandleAllocation(); | 361 inline NoHandleAllocation(); |
376 inline ~NoHandleAllocation(); | 362 inline ~NoHandleAllocation(); |
377 private: | 363 private: |
378 int level_; | 364 int level_; |
379 #endif | 365 #endif |
380 }; | 366 }; |
381 | 367 |
382 } } // namespace v8::internal | 368 } } // namespace v8::internal |
383 | 369 |
384 #endif // V8_HANDLES_H_ | 370 #endif // V8_HANDLES_H_ |
OLD | NEW |