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 externally unreachable. | |
Michael Starzinger
2012/11/05 10:47:27
The comment should not describe the underlying imp
haraken
2012/11/05 12:42:07
Done.
| |
407 * Scavenger GC treats this object unreachable if all objects | |
408 * in the object group which this object belongs to are neither | |
409 * strongly reachable nor weakly reachable. This mark is cleared | |
410 * after each scavenger GC. If this object is not in the new | |
411 * space, this API has no effect. | |
412 */ | |
413 inline void MarkExternallyUnreachable(); | |
Michael Starzinger
2012/11/05 10:47:27
As discussed offline: The name of this flag is not
haraken
2012/11/05 12:42:07
Done.
| |
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. |
Michael Starzinger
2012/11/05 10:47:27
Maybe we should add this comment here ...
Object
haraken
2012/11/05 12:42:07
Done.
| |
3258 * See v8-profiler.h for RetainedObjectInfo interface description. | 3268 * See v8-profiler.h for RetainedObjectInfo interface description. |
3259 */ | 3269 */ |
3260 static void AddObjectGroup(Persistent<Value>* objects, | 3270 static void AddObjectGroup(Persistent<Value>* objects, |
3261 size_t length, | 3271 size_t length, |
3262 RetainedObjectInfo* info = NULL); | 3272 RetainedObjectInfo* info = NULL); |
3263 | 3273 |
3264 /** | 3274 /** |
3265 * Allows the host application to declare implicit references between | 3275 * Allows the host application to declare implicit references between |
3266 * the objects: if |parent| is alive, all |children| are alive too. | 3276 * the objects: if |parent| is alive, all |children| are alive too. |
3267 * After each garbage collection, all implicit references | 3277 * After each garbage collection, all implicit references |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3486 private: | 3496 private: |
3487 V8(); | 3497 V8(); |
3488 | 3498 |
3489 static internal::Object** GlobalizeReference(internal::Object** handle); | 3499 static internal::Object** GlobalizeReference(internal::Object** handle); |
3490 static void DisposeGlobal(internal::Object** global_handle); | 3500 static void DisposeGlobal(internal::Object** global_handle); |
3491 static void MakeWeak(internal::Object** global_handle, | 3501 static void MakeWeak(internal::Object** global_handle, |
3492 void* data, | 3502 void* data, |
3493 WeakReferenceCallback); | 3503 WeakReferenceCallback); |
3494 static void ClearWeak(internal::Object** global_handle); | 3504 static void ClearWeak(internal::Object** global_handle); |
3495 static void MarkIndependent(internal::Object** global_handle); | 3505 static void MarkIndependent(internal::Object** global_handle); |
3506 static void MarkExternallyUnreachable(internal::Object** global_handle); | |
3496 static bool IsGlobalIndependent(internal::Object** global_handle); | 3507 static bool IsGlobalIndependent(internal::Object** global_handle); |
3497 static bool IsGlobalNearDeath(internal::Object** global_handle); | 3508 static bool IsGlobalNearDeath(internal::Object** global_handle); |
3498 static bool IsGlobalWeak(internal::Object** global_handle); | 3509 static bool IsGlobalWeak(internal::Object** global_handle); |
3499 static void SetWrapperClassId(internal::Object** global_handle, | 3510 static void SetWrapperClassId(internal::Object** global_handle, |
3500 uint16_t class_id); | 3511 uint16_t class_id); |
3501 static uint16_t GetWrapperClassId(internal::Object** global_handle); | 3512 static uint16_t GetWrapperClassId(internal::Object** global_handle); |
3502 | 3513 |
3503 template <class T> friend class Handle; | 3514 template <class T> friend class Handle; |
3504 template <class T> friend class Local; | 3515 template <class T> friend class Local; |
3505 template <class T> friend class Persistent; | 3516 template <class T> friend class Persistent; |
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4257 void Persistent<T>::ClearWeak() { | 4268 void Persistent<T>::ClearWeak() { |
4258 V8::ClearWeak(reinterpret_cast<internal::Object**>(**this)); | 4269 V8::ClearWeak(reinterpret_cast<internal::Object**>(**this)); |
4259 } | 4270 } |
4260 | 4271 |
4261 template <class T> | 4272 template <class T> |
4262 void Persistent<T>::MarkIndependent() { | 4273 void Persistent<T>::MarkIndependent() { |
4263 V8::MarkIndependent(reinterpret_cast<internal::Object**>(**this)); | 4274 V8::MarkIndependent(reinterpret_cast<internal::Object**>(**this)); |
4264 } | 4275 } |
4265 | 4276 |
4266 template <class T> | 4277 template <class T> |
4278 void Persistent<T>::MarkExternallyUnreachable() { | |
4279 V8::MarkExternallyUnreachable(reinterpret_cast<internal::Object**>(**this)); | |
4280 } | |
4281 | |
4282 template <class T> | |
4267 void Persistent<T>::SetWrapperClassId(uint16_t class_id) { | 4283 void Persistent<T>::SetWrapperClassId(uint16_t class_id) { |
4268 V8::SetWrapperClassId(reinterpret_cast<internal::Object**>(**this), class_id); | 4284 V8::SetWrapperClassId(reinterpret_cast<internal::Object**>(**this), class_id); |
4269 } | 4285 } |
4270 | 4286 |
4271 template <class T> | 4287 template <class T> |
4272 uint16_t Persistent<T>::WrapperClassId() const { | 4288 uint16_t Persistent<T>::WrapperClassId() const { |
4273 return V8::GetWrapperClassId(reinterpret_cast<internal::Object**>(**this)); | 4289 return V8::GetWrapperClassId(reinterpret_cast<internal::Object**>(**this)); |
4274 } | 4290 } |
4275 | 4291 |
4276 Arguments::Arguments(internal::Object** implicit_args, | 4292 Arguments::Arguments(internal::Object** implicit_args, |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4696 | 4712 |
4697 | 4713 |
4698 } // namespace v8 | 4714 } // namespace v8 |
4699 | 4715 |
4700 | 4716 |
4701 #undef V8EXPORT | 4717 #undef V8EXPORT |
4702 #undef TYPE_CHECK | 4718 #undef TYPE_CHECK |
4703 | 4719 |
4704 | 4720 |
4705 #endif // V8_H_ | 4721 #endif // V8_H_ |
OLD | NEW |