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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 /** Returns true if this handle was previously marked as independent. */ | 405 /** Returns true if this handle was previously marked as independent. */ |
406 inline bool IsIndependent() const; | 406 inline bool IsIndependent() const; |
| 407 inline bool IsIndependent(Isolate* isolate) const; |
407 | 408 |
408 /** Checks if the handle holds the only reference to an object. */ | 409 /** Checks if the handle holds the only reference to an object. */ |
409 inline bool IsNearDeath() const; | 410 inline bool IsNearDeath() const; |
410 | 411 |
411 /** Returns true if the handle's reference is weak. */ | 412 /** Returns true if the handle's reference is weak. */ |
412 inline bool IsWeak() const; | 413 inline bool IsWeak() const; |
413 | 414 |
414 /** | 415 /** |
415 * Assigns a wrapper class ID to the handle. See RetainedObjectInfo | 416 * Assigns a wrapper class ID to the handle. See RetainedObjectInfo |
416 * interface description in v8-profiler.h for details. | 417 * interface description in v8-profiler.h for details. |
(...skipping 3070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3487 V8(); | 3488 V8(); |
3488 | 3489 |
3489 static internal::Object** GlobalizeReference(internal::Object** handle); | 3490 static internal::Object** GlobalizeReference(internal::Object** handle); |
3490 static void DisposeGlobal(internal::Object** global_handle); | 3491 static void DisposeGlobal(internal::Object** global_handle); |
3491 static void MakeWeak(internal::Object** global_handle, | 3492 static void MakeWeak(internal::Object** global_handle, |
3492 void* data, | 3493 void* data, |
3493 WeakReferenceCallback); | 3494 WeakReferenceCallback); |
3494 static void ClearWeak(internal::Object** global_handle); | 3495 static void ClearWeak(internal::Object** global_handle); |
3495 static void MarkIndependent(internal::Object** global_handle); | 3496 static void MarkIndependent(internal::Object** global_handle); |
3496 static bool IsGlobalIndependent(internal::Object** global_handle); | 3497 static bool IsGlobalIndependent(internal::Object** global_handle); |
| 3498 static bool IsGlobalIndependent(internal::Isolate* isolate, |
| 3499 internal::Object** global_handle); |
3497 static bool IsGlobalNearDeath(internal::Object** global_handle); | 3500 static bool IsGlobalNearDeath(internal::Object** global_handle); |
3498 static bool IsGlobalWeak(internal::Object** global_handle); | 3501 static bool IsGlobalWeak(internal::Object** global_handle); |
3499 static void SetWrapperClassId(internal::Object** global_handle, | 3502 static void SetWrapperClassId(internal::Object** global_handle, |
3500 uint16_t class_id); | 3503 uint16_t class_id); |
3501 static uint16_t GetWrapperClassId(internal::Object** global_handle); | 3504 static uint16_t GetWrapperClassId(internal::Object** global_handle); |
3502 | 3505 |
3503 template <class T> friend class Handle; | 3506 template <class T> friend class Handle; |
3504 template <class T> friend class Local; | 3507 template <class T> friend class Local; |
3505 template <class T> friend class Persistent; | 3508 template <class T> friend class Persistent; |
3506 friend class Context; | 3509 friend class Context; |
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4216 | 4219 |
4217 | 4220 |
4218 template <class T> | 4221 template <class T> |
4219 bool Persistent<T>::IsIndependent() const { | 4222 bool Persistent<T>::IsIndependent() const { |
4220 if (this->IsEmpty()) return false; | 4223 if (this->IsEmpty()) return false; |
4221 return V8::IsGlobalIndependent(reinterpret_cast<internal::Object**>(**this)); | 4224 return V8::IsGlobalIndependent(reinterpret_cast<internal::Object**>(**this)); |
4222 } | 4225 } |
4223 | 4226 |
4224 | 4227 |
4225 template <class T> | 4228 template <class T> |
| 4229 bool Persistent<T>::IsIndependent(Isolate* isolate) const { |
| 4230 if (this->IsEmpty()) return false; |
| 4231 return V8::IsGlobalIndependent(reinterpret_cast<internal::Isolate*>(isolate), |
| 4232 reinterpret_cast<internal::Object**>(**this)); |
| 4233 } |
| 4234 |
| 4235 |
| 4236 template <class T> |
4226 bool Persistent<T>::IsNearDeath() const { | 4237 bool Persistent<T>::IsNearDeath() const { |
4227 if (this->IsEmpty()) return false; | 4238 if (this->IsEmpty()) return false; |
4228 return V8::IsGlobalNearDeath(reinterpret_cast<internal::Object**>(**this)); | 4239 return V8::IsGlobalNearDeath(reinterpret_cast<internal::Object**>(**this)); |
4229 } | 4240 } |
4230 | 4241 |
4231 | 4242 |
4232 template <class T> | 4243 template <class T> |
4233 bool Persistent<T>::IsWeak() const { | 4244 bool Persistent<T>::IsWeak() const { |
4234 if (this->IsEmpty()) return false; | 4245 if (this->IsEmpty()) return false; |
4235 return V8::IsGlobalWeak(reinterpret_cast<internal::Object**>(**this)); | 4246 return V8::IsGlobalWeak(reinterpret_cast<internal::Object**>(**this)); |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4696 | 4707 |
4697 | 4708 |
4698 } // namespace v8 | 4709 } // namespace v8 |
4699 | 4710 |
4700 | 4711 |
4701 #undef V8EXPORT | 4712 #undef V8EXPORT |
4702 #undef TYPE_CHECK | 4713 #undef TYPE_CHECK |
4703 | 4714 |
4704 | 4715 |
4705 #endif // V8_H_ | 4716 #endif // V8_H_ |
OLD | NEW |