| 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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 | 395 |
| 396 /** | 396 /** |
| 397 * Marks the reference to this object independent. Garbage collector | 397 * Marks the reference to this object independent. Garbage collector |
| 398 * is free to ignore any object groups containing this object. | 398 * is free to ignore any object groups containing this object. |
| 399 * Weak callback for an independent handle should not | 399 * Weak callback for an independent handle should not |
| 400 * assume that it will be preceded by a global GC prologue callback | 400 * assume that it will be preceded by a global GC prologue callback |
| 401 * or followed by a global GC epilogue callback. | 401 * or followed by a global GC epilogue callback. |
| 402 */ | 402 */ |
| 403 inline void MarkIndependent(); | 403 inline void MarkIndependent(); |
| 404 | 404 |
| 405 /** |
| 406 * Marks the reference to this object partially dependent. Partially |
| 407 * dependent handles only depend on other partially dependent handles and |
| 408 * these dependencies are provided through object groups. It provides a way |
| 409 * to build smaller object groups for young objects that represent only a |
| 410 * subset of all external dependencies. This mark is automatically cleared |
| 411 * after each garbage collection. |
| 412 */ |
| 413 inline void MarkPartiallyDependent(); |
| 414 |
| 405 /** Returns true if this handle was previously marked as independent. */ | 415 /** Returns true if this handle was previously marked as independent. */ |
| 406 inline bool IsIndependent() const; | 416 inline bool IsIndependent() const; |
| 407 | 417 |
| 408 /** Checks if the handle holds the only reference to an object. */ | 418 /** Checks if the handle holds the only reference to an object. */ |
| 409 inline bool IsNearDeath() const; | 419 inline bool IsNearDeath() const; |
| 410 | 420 |
| 411 /** Returns true if the handle's reference is weak. */ | 421 /** Returns true if the handle's reference is weak. */ |
| 412 inline bool IsWeak() const; | 422 inline bool IsWeak() const; |
| 413 | 423 |
| 414 /** | 424 /** |
| (...skipping 2832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3247 * Removes callback that was installed by AddCallCompletedCallback. | 3257 * Removes callback that was installed by AddCallCompletedCallback. |
| 3248 */ | 3258 */ |
| 3249 static void RemoveCallCompletedCallback(CallCompletedCallback callback); | 3259 static void RemoveCallCompletedCallback(CallCompletedCallback callback); |
| 3250 | 3260 |
| 3251 /** | 3261 /** |
| 3252 * Allows the host application to group objects together. If one | 3262 * Allows the host application to group objects together. If one |
| 3253 * object in the group is alive, all objects in the group are alive. | 3263 * object in the group is alive, all objects in the group are alive. |
| 3254 * After each garbage collection, object groups are removed. It is | 3264 * After each garbage collection, object groups are removed. It is |
| 3255 * intended to be used in the before-garbage-collection callback | 3265 * intended to be used in the before-garbage-collection callback |
| 3256 * function, for instance to simulate DOM tree connections among JS | 3266 * function, for instance to simulate DOM tree connections among JS |
| 3257 * wrapper objects. | 3267 * wrapper objects. Object groups for all dependent handles need to |
| 3268 * be provided for kGCTypeMarkSweepCompact collections, for all other |
| 3269 * garbage collection types it is sufficient to provide object groups |
| 3270 * for partially dependent handles only. |
| 3258 * See v8-profiler.h for RetainedObjectInfo interface description. | 3271 * See v8-profiler.h for RetainedObjectInfo interface description. |
| 3259 */ | 3272 */ |
| 3260 static void AddObjectGroup(Persistent<Value>* objects, | 3273 static void AddObjectGroup(Persistent<Value>* objects, |
| 3261 size_t length, | 3274 size_t length, |
| 3262 RetainedObjectInfo* info = NULL); | 3275 RetainedObjectInfo* info = NULL); |
| 3263 | 3276 |
| 3264 /** | 3277 /** |
| 3265 * Allows the host application to declare implicit references between | 3278 * Allows the host application to declare implicit references between |
| 3266 * the objects: if |parent| is alive, all |children| are alive too. | 3279 * the objects: if |parent| is alive, all |children| are alive too. |
| 3267 * After each garbage collection, all implicit references | 3280 * After each garbage collection, all implicit references |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3486 private: | 3499 private: |
| 3487 V8(); | 3500 V8(); |
| 3488 | 3501 |
| 3489 static internal::Object** GlobalizeReference(internal::Object** handle); | 3502 static internal::Object** GlobalizeReference(internal::Object** handle); |
| 3490 static void DisposeGlobal(internal::Object** global_handle); | 3503 static void DisposeGlobal(internal::Object** global_handle); |
| 3491 static void MakeWeak(internal::Object** global_handle, | 3504 static void MakeWeak(internal::Object** global_handle, |
| 3492 void* data, | 3505 void* data, |
| 3493 WeakReferenceCallback); | 3506 WeakReferenceCallback); |
| 3494 static void ClearWeak(internal::Object** global_handle); | 3507 static void ClearWeak(internal::Object** global_handle); |
| 3495 static void MarkIndependent(internal::Object** global_handle); | 3508 static void MarkIndependent(internal::Object** global_handle); |
| 3509 static void MarkPartiallyDependent(internal::Object** global_handle); |
| 3496 static bool IsGlobalIndependent(internal::Object** global_handle); | 3510 static bool IsGlobalIndependent(internal::Object** global_handle); |
| 3497 static bool IsGlobalNearDeath(internal::Object** global_handle); | 3511 static bool IsGlobalNearDeath(internal::Object** global_handle); |
| 3498 static bool IsGlobalWeak(internal::Object** global_handle); | 3512 static bool IsGlobalWeak(internal::Object** global_handle); |
| 3499 static void SetWrapperClassId(internal::Object** global_handle, | 3513 static void SetWrapperClassId(internal::Object** global_handle, |
| 3500 uint16_t class_id); | 3514 uint16_t class_id); |
| 3501 static uint16_t GetWrapperClassId(internal::Object** global_handle); | 3515 static uint16_t GetWrapperClassId(internal::Object** global_handle); |
| 3502 | 3516 |
| 3503 template <class T> friend class Handle; | 3517 template <class T> friend class Handle; |
| 3504 template <class T> friend class Local; | 3518 template <class T> friend class Local; |
| 3505 template <class T> friend class Persistent; | 3519 template <class T> friend class Persistent; |
| (...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4257 void Persistent<T>::ClearWeak() { | 4271 void Persistent<T>::ClearWeak() { |
| 4258 V8::ClearWeak(reinterpret_cast<internal::Object**>(**this)); | 4272 V8::ClearWeak(reinterpret_cast<internal::Object**>(**this)); |
| 4259 } | 4273 } |
| 4260 | 4274 |
| 4261 template <class T> | 4275 template <class T> |
| 4262 void Persistent<T>::MarkIndependent() { | 4276 void Persistent<T>::MarkIndependent() { |
| 4263 V8::MarkIndependent(reinterpret_cast<internal::Object**>(**this)); | 4277 V8::MarkIndependent(reinterpret_cast<internal::Object**>(**this)); |
| 4264 } | 4278 } |
| 4265 | 4279 |
| 4266 template <class T> | 4280 template <class T> |
| 4281 void Persistent<T>::MarkPartiallyDependent() { |
| 4282 V8::MarkPartiallyDependent(reinterpret_cast<internal::Object**>(**this)); |
| 4283 } |
| 4284 |
| 4285 template <class T> |
| 4267 void Persistent<T>::SetWrapperClassId(uint16_t class_id) { | 4286 void Persistent<T>::SetWrapperClassId(uint16_t class_id) { |
| 4268 V8::SetWrapperClassId(reinterpret_cast<internal::Object**>(**this), class_id); | 4287 V8::SetWrapperClassId(reinterpret_cast<internal::Object**>(**this), class_id); |
| 4269 } | 4288 } |
| 4270 | 4289 |
| 4271 template <class T> | 4290 template <class T> |
| 4272 uint16_t Persistent<T>::WrapperClassId() const { | 4291 uint16_t Persistent<T>::WrapperClassId() const { |
| 4273 return V8::GetWrapperClassId(reinterpret_cast<internal::Object**>(**this)); | 4292 return V8::GetWrapperClassId(reinterpret_cast<internal::Object**>(**this)); |
| 4274 } | 4293 } |
| 4275 | 4294 |
| 4276 Arguments::Arguments(internal::Object** implicit_args, | 4295 Arguments::Arguments(internal::Object** implicit_args, |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4696 | 4715 |
| 4697 | 4716 |
| 4698 } // namespace v8 | 4717 } // namespace v8 |
| 4699 | 4718 |
| 4700 | 4719 |
| 4701 #undef V8EXPORT | 4720 #undef V8EXPORT |
| 4702 #undef TYPE_CHECK | 4721 #undef TYPE_CHECK |
| 4703 | 4722 |
| 4704 | 4723 |
| 4705 #endif // V8_H_ | 4724 #endif // V8_H_ |
| OLD | NEW |