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 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 inline void ClearWeak(); | 406 inline void ClearWeak(); |
407 | 407 |
408 /** | 408 /** |
409 * Marks the reference to this object independent. Garbage collector | 409 * Marks the reference to this object independent. Garbage collector |
410 * is free to ignore any object groups containing this object. | 410 * is free to ignore any object groups containing this object. |
411 * Weak callback for an independent handle should not | 411 * Weak callback for an independent handle should not |
412 * assume that it will be preceded by a global GC prologue callback | 412 * assume that it will be preceded by a global GC prologue callback |
413 * or followed by a global GC epilogue callback. | 413 * or followed by a global GC epilogue callback. |
414 */ | 414 */ |
415 inline void MarkIndependent(); | 415 inline void MarkIndependent(); |
| 416 inline void MarkIndependent(Isolate* isolate); |
416 | 417 |
417 /** | 418 /** |
418 * Marks the reference to this object partially dependent. Partially | 419 * Marks the reference to this object partially dependent. Partially |
419 * dependent handles only depend on other partially dependent handles and | 420 * dependent handles only depend on other partially dependent handles and |
420 * these dependencies are provided through object groups. It provides a way | 421 * these dependencies are provided through object groups. It provides a way |
421 * to build smaller object groups for young objects that represent only a | 422 * to build smaller object groups for young objects that represent only a |
422 * subset of all external dependencies. This mark is automatically cleared | 423 * subset of all external dependencies. This mark is automatically cleared |
423 * after each garbage collection. | 424 * after each garbage collection. |
424 */ | 425 */ |
425 inline void MarkPartiallyDependent(); | 426 inline void MarkPartiallyDependent(); |
| 427 inline void MarkPartiallyDependent(Isolate* isolate); |
426 | 428 |
427 /** Returns true if this handle was previously marked as independent. */ | 429 /** Returns true if this handle was previously marked as independent. */ |
428 inline bool IsIndependent() const; | 430 inline bool IsIndependent() const; |
429 inline bool IsIndependent(Isolate* isolate) const; | 431 inline bool IsIndependent(Isolate* isolate) const; |
430 | 432 |
431 /** Checks if the handle holds the only reference to an object. */ | 433 /** Checks if the handle holds the only reference to an object. */ |
432 inline bool IsNearDeath() const; | 434 inline bool IsNearDeath() const; |
433 | 435 |
434 /** Returns true if the handle's reference is weak. */ | 436 /** Returns true if the handle's reference is weak. */ |
435 inline bool IsWeak() const; | 437 inline bool IsWeak() const; |
(...skipping 3090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3526 | 3528 |
3527 static internal::Object** GlobalizeReference(internal::Object** handle); | 3529 static internal::Object** GlobalizeReference(internal::Object** handle); |
3528 static void DisposeGlobal(internal::Object** global_handle); | 3530 static void DisposeGlobal(internal::Object** global_handle); |
3529 static void DisposeGlobal(internal::Isolate* isolate, | 3531 static void DisposeGlobal(internal::Isolate* isolate, |
3530 internal::Object** global_handle); | 3532 internal::Object** global_handle); |
3531 static void MakeWeak(internal::Object** global_handle, | 3533 static void MakeWeak(internal::Object** global_handle, |
3532 void* data, | 3534 void* data, |
3533 WeakReferenceCallback); | 3535 WeakReferenceCallback); |
3534 static void ClearWeak(internal::Object** global_handle); | 3536 static void ClearWeak(internal::Object** global_handle); |
3535 static void MarkIndependent(internal::Object** global_handle); | 3537 static void MarkIndependent(internal::Object** global_handle); |
| 3538 static void MarkIndependent(internal::Isolate* isolate, |
| 3539 internal::Object** global_handle); |
3536 static void MarkPartiallyDependent(internal::Object** global_handle); | 3540 static void MarkPartiallyDependent(internal::Object** global_handle); |
| 3541 static void MarkPartiallyDependent(internal::Isolate* isolate, |
| 3542 internal::Object** global_handle); |
3537 static bool IsGlobalIndependent(internal::Object** global_handle); | 3543 static bool IsGlobalIndependent(internal::Object** global_handle); |
3538 static bool IsGlobalIndependent(internal::Isolate* isolate, | 3544 static bool IsGlobalIndependent(internal::Isolate* isolate, |
3539 internal::Object** global_handle); | 3545 internal::Object** global_handle); |
3540 static bool IsGlobalNearDeath(internal::Object** global_handle); | 3546 static bool IsGlobalNearDeath(internal::Object** global_handle); |
3541 static bool IsGlobalWeak(internal::Object** global_handle); | 3547 static bool IsGlobalWeak(internal::Object** global_handle); |
3542 static void SetWrapperClassId(internal::Object** global_handle, | 3548 static void SetWrapperClassId(internal::Object** global_handle, |
3543 uint16_t class_id); | 3549 uint16_t class_id); |
3544 static uint16_t GetWrapperClassId(internal::Object** global_handle); | 3550 static uint16_t GetWrapperClassId(internal::Object** global_handle); |
3545 | 3551 |
3546 template <class T> friend class Handle; | 3552 template <class T> friend class Handle; |
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4329 void Persistent<T>::ClearWeak() { | 4335 void Persistent<T>::ClearWeak() { |
4330 V8::ClearWeak(reinterpret_cast<internal::Object**>(**this)); | 4336 V8::ClearWeak(reinterpret_cast<internal::Object**>(**this)); |
4331 } | 4337 } |
4332 | 4338 |
4333 template <class T> | 4339 template <class T> |
4334 void Persistent<T>::MarkIndependent() { | 4340 void Persistent<T>::MarkIndependent() { |
4335 V8::MarkIndependent(reinterpret_cast<internal::Object**>(**this)); | 4341 V8::MarkIndependent(reinterpret_cast<internal::Object**>(**this)); |
4336 } | 4342 } |
4337 | 4343 |
4338 template <class T> | 4344 template <class T> |
| 4345 void Persistent<T>::MarkIndependent(Isolate* isolate) { |
| 4346 V8::MarkIndependent(reinterpret_cast<internal::Isolate*>(isolate), |
| 4347 reinterpret_cast<internal::Object**>(**this)); |
| 4348 } |
| 4349 |
| 4350 template <class T> |
4339 void Persistent<T>::MarkPartiallyDependent() { | 4351 void Persistent<T>::MarkPartiallyDependent() { |
4340 V8::MarkPartiallyDependent(reinterpret_cast<internal::Object**>(**this)); | 4352 V8::MarkPartiallyDependent(reinterpret_cast<internal::Object**>(**this)); |
4341 } | 4353 } |
4342 | 4354 |
4343 template <class T> | 4355 template <class T> |
| 4356 void Persistent<T>::MarkPartiallyDependent(Isolate* isolate) { |
| 4357 V8::MarkPartiallyDependent(reinterpret_cast<internal::Isolate*>(isolate), |
| 4358 reinterpret_cast<internal::Object**>(**this)); |
| 4359 } |
| 4360 |
| 4361 template <class T> |
4344 void Persistent<T>::SetWrapperClassId(uint16_t class_id) { | 4362 void Persistent<T>::SetWrapperClassId(uint16_t class_id) { |
4345 V8::SetWrapperClassId(reinterpret_cast<internal::Object**>(**this), class_id); | 4363 V8::SetWrapperClassId(reinterpret_cast<internal::Object**>(**this), class_id); |
4346 } | 4364 } |
4347 | 4365 |
4348 template <class T> | 4366 template <class T> |
4349 uint16_t Persistent<T>::WrapperClassId() const { | 4367 uint16_t Persistent<T>::WrapperClassId() const { |
4350 return V8::GetWrapperClassId(reinterpret_cast<internal::Object**>(**this)); | 4368 return V8::GetWrapperClassId(reinterpret_cast<internal::Object**>(**this)); |
4351 } | 4369 } |
4352 | 4370 |
4353 Arguments::Arguments(internal::Object** implicit_args, | 4371 Arguments::Arguments(internal::Object** implicit_args, |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4791 | 4809 |
4792 | 4810 |
4793 } // namespace v8 | 4811 } // namespace v8 |
4794 | 4812 |
4795 | 4813 |
4796 #undef V8EXPORT | 4814 #undef V8EXPORT |
4797 #undef TYPE_CHECK | 4815 #undef TYPE_CHECK |
4798 | 4816 |
4799 | 4817 |
4800 #endif // V8_H_ | 4818 #endif // V8_H_ |
OLD | NEW |