Chromium Code Reviews| 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 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 381 * refer to the object, the garbage collector will perform a | 381 * refer to the object, the garbage collector will perform a |
| 382 * callback to the given V8::WeakReferenceCallback function, passing | 382 * callback to the given V8::WeakReferenceCallback function, passing |
| 383 * it the object reference and the given parameters. | 383 * it the object reference and the given parameters. |
| 384 */ | 384 */ |
| 385 inline void MakeWeak(void* parameters, WeakReferenceCallback callback); | 385 inline void MakeWeak(void* parameters, WeakReferenceCallback callback); |
| 386 | 386 |
| 387 /** Clears the weak reference to this object.*/ | 387 /** Clears the weak reference to this object.*/ |
| 388 inline void ClearWeak(); | 388 inline void ClearWeak(); |
| 389 | 389 |
| 390 /** | 390 /** |
| 391 * Marks the reference to this object independent. Garbage collector | |
| 392 * is free to ignore any object groups containing this object. | |
|
Vitaly Repeshko
2011/05/16 21:40:37
I still think this comment should be updated.
Vyacheslav Egorov (Chromium)
2011/05/17 11:55:31
Done.
| |
| 393 */ | |
| 394 inline void MarkIndependent(); | |
| 395 | |
| 396 /** | |
| 391 *Checks if the handle holds the only reference to an object. | 397 *Checks if the handle holds the only reference to an object. |
| 392 */ | 398 */ |
| 393 inline bool IsNearDeath() const; | 399 inline bool IsNearDeath() const; |
| 394 | 400 |
| 395 /** | 401 /** |
| 396 * Returns true if the handle's reference is weak. | 402 * Returns true if the handle's reference is weak. |
| 397 */ | 403 */ |
| 398 inline bool IsWeak() const; | 404 inline bool IsWeak() const; |
| 399 | 405 |
| 400 /** | 406 /** |
| (...skipping 2698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3099 | 3105 |
| 3100 private: | 3106 private: |
| 3101 V8(); | 3107 V8(); |
| 3102 | 3108 |
| 3103 static internal::Object** GlobalizeReference(internal::Object** handle); | 3109 static internal::Object** GlobalizeReference(internal::Object** handle); |
| 3104 static void DisposeGlobal(internal::Object** global_handle); | 3110 static void DisposeGlobal(internal::Object** global_handle); |
| 3105 static void MakeWeak(internal::Object** global_handle, | 3111 static void MakeWeak(internal::Object** global_handle, |
| 3106 void* data, | 3112 void* data, |
| 3107 WeakReferenceCallback); | 3113 WeakReferenceCallback); |
| 3108 static void ClearWeak(internal::Object** global_handle); | 3114 static void ClearWeak(internal::Object** global_handle); |
| 3115 static void MarkIndependent(internal::Object** global_handle); | |
| 3109 static bool IsGlobalNearDeath(internal::Object** global_handle); | 3116 static bool IsGlobalNearDeath(internal::Object** global_handle); |
| 3110 static bool IsGlobalWeak(internal::Object** global_handle); | 3117 static bool IsGlobalWeak(internal::Object** global_handle); |
| 3111 static void SetWrapperClassId(internal::Object** global_handle, | 3118 static void SetWrapperClassId(internal::Object** global_handle, |
| 3112 uint16_t class_id); | 3119 uint16_t class_id); |
| 3113 | 3120 |
| 3114 template <class T> friend class Handle; | 3121 template <class T> friend class Handle; |
| 3115 template <class T> friend class Local; | 3122 template <class T> friend class Local; |
| 3116 template <class T> friend class Persistent; | 3123 template <class T> friend class Persistent; |
| 3117 friend class Context; | 3124 friend class Context; |
| 3118 }; | 3125 }; |
| (...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3802 parameters, | 3809 parameters, |
| 3803 callback); | 3810 callback); |
| 3804 } | 3811 } |
| 3805 | 3812 |
| 3806 template <class T> | 3813 template <class T> |
| 3807 void Persistent<T>::ClearWeak() { | 3814 void Persistent<T>::ClearWeak() { |
| 3808 V8::ClearWeak(reinterpret_cast<internal::Object**>(**this)); | 3815 V8::ClearWeak(reinterpret_cast<internal::Object**>(**this)); |
| 3809 } | 3816 } |
| 3810 | 3817 |
| 3811 template <class T> | 3818 template <class T> |
| 3819 void Persistent<T>::MarkIndependent() { | |
| 3820 V8::MarkIndependent(reinterpret_cast<internal::Object**>(**this)); | |
| 3821 } | |
| 3822 | |
| 3823 template <class T> | |
| 3812 void Persistent<T>::SetWrapperClassId(uint16_t class_id) { | 3824 void Persistent<T>::SetWrapperClassId(uint16_t class_id) { |
| 3813 V8::SetWrapperClassId(reinterpret_cast<internal::Object**>(**this), class_id); | 3825 V8::SetWrapperClassId(reinterpret_cast<internal::Object**>(**this), class_id); |
| 3814 } | 3826 } |
| 3815 | 3827 |
| 3816 Arguments::Arguments(internal::Object** implicit_args, | 3828 Arguments::Arguments(internal::Object** implicit_args, |
| 3817 internal::Object** values, int length, | 3829 internal::Object** values, int length, |
| 3818 bool is_construct_call) | 3830 bool is_construct_call) |
| 3819 : implicit_args_(implicit_args), | 3831 : implicit_args_(implicit_args), |
| 3820 values_(values), | 3832 values_(values), |
| 3821 length_(length), | 3833 length_(length), |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4089 | 4101 |
| 4090 | 4102 |
| 4091 } // namespace v8 | 4103 } // namespace v8 |
| 4092 | 4104 |
| 4093 | 4105 |
| 4094 #undef V8EXPORT | 4106 #undef V8EXPORT |
| 4095 #undef TYPE_CHECK | 4107 #undef TYPE_CHECK |
| 4096 | 4108 |
| 4097 | 4109 |
| 4098 #endif // V8_H_ | 4110 #endif // V8_H_ |
| OLD | NEW |