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 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 template<typename S, typename P> | 645 template<typename S, typename P> |
646 V8_INLINE(void MakeWeak( | 646 V8_INLINE(void MakeWeak( |
647 P* parameters, | 647 P* parameters, |
648 typename WeakReferenceCallbacks<S, P>::Revivable callback)); | 648 typename WeakReferenceCallbacks<S, P>::Revivable callback)); |
649 | 649 |
650 template<typename P> | 650 template<typename P> |
651 V8_INLINE(void MakeWeak( | 651 V8_INLINE(void MakeWeak( |
652 P* parameters, | 652 P* parameters, |
653 typename WeakReferenceCallbacks<T, P>::Revivable callback)); | 653 typename WeakReferenceCallbacks<T, P>::Revivable callback)); |
654 | 654 |
655 // TODO(dcarney): deprecate | |
656 template<typename S, typename P> | 655 template<typename S, typename P> |
657 V8_INLINE(void MakeWeak( | 656 V8_DEPRECATED(void MakeWeak( |
658 Isolate* isolate, | 657 Isolate* isolate, |
659 P* parameters, | 658 P* parameters, |
660 typename WeakReferenceCallbacks<S, P>::Revivable callback)) { | 659 typename WeakReferenceCallbacks<S, P>::Revivable callback)); |
661 MakeWeak<S, P>(parameters, callback); | |
662 } | |
663 | 660 |
664 // TODO(dcarney): deprecate | |
665 template<typename P> | 661 template<typename P> |
666 V8_INLINE(void MakeWeak( | 662 V8_DEPRECATED(void MakeWeak( |
667 Isolate* isolate, | 663 Isolate* isolate, |
668 P* parameters, | 664 P* parameters, |
669 typename WeakReferenceCallbacks<T, P>::Revivable callback)) { | 665 typename WeakReferenceCallbacks<T, P>::Revivable callback)); |
670 MakeWeak<P>(parameters, callback); | |
671 } | |
672 | 666 |
673 V8_INLINE(void ClearWeak()); | 667 V8_INLINE(void ClearWeak()); |
674 | 668 |
675 // TODO(dcarney): deprecate | 669 // TODO(dcarney): deprecate |
676 V8_INLINE(void ClearWeak(Isolate* isolate)) { ClearWeak(); } | 670 V8_INLINE(void ClearWeak(Isolate* isolate)) { ClearWeak(); } |
677 | 671 |
678 /** | 672 /** |
679 * Marks the reference to this object independent. Garbage collector is free | 673 * Marks the reference to this object independent. Garbage collector is free |
680 * to ignore any object groups containing this object. Weak callback for an | 674 * to ignore any object groups containing this object. Weak callback for an |
681 * independent handle should not assume that it will be preceded by a global | 675 * independent handle should not assume that it will be preceded by a global |
(...skipping 4909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5591 template <class T> | 5585 template <class T> |
5592 template <typename P> | 5586 template <typename P> |
5593 void Persistent<T>::MakeWeak( | 5587 void Persistent<T>::MakeWeak( |
5594 P* parameters, | 5588 P* parameters, |
5595 typename WeakReferenceCallbacks<T, P>::Revivable callback) { | 5589 typename WeakReferenceCallbacks<T, P>::Revivable callback) { |
5596 MakeWeak<T, P>(parameters, callback); | 5590 MakeWeak<T, P>(parameters, callback); |
5597 } | 5591 } |
5598 | 5592 |
5599 | 5593 |
5600 template <class T> | 5594 template <class T> |
| 5595 template <typename S, typename P> |
| 5596 void Persistent<T>::MakeWeak( |
| 5597 Isolate* isolate, |
| 5598 P* parameters, |
| 5599 typename WeakReferenceCallbacks<S, P>::Revivable callback) { |
| 5600 MakeWeak<S, P>(parameters, callback); |
| 5601 } |
| 5602 |
| 5603 |
| 5604 template <class T> |
| 5605 template<typename P> |
| 5606 void Persistent<T>::MakeWeak( |
| 5607 Isolate* isolate, |
| 5608 P* parameters, |
| 5609 typename WeakReferenceCallbacks<T, P>::Revivable callback) { |
| 5610 MakeWeak<P>(parameters, callback); |
| 5611 } |
| 5612 |
| 5613 |
| 5614 template <class T> |
5601 void Persistent<T>::ClearWeak() { | 5615 void Persistent<T>::ClearWeak() { |
5602 V8::ClearWeak(reinterpret_cast<internal::Object**>(this->val_)); | 5616 V8::ClearWeak(reinterpret_cast<internal::Object**>(this->val_)); |
5603 } | 5617 } |
5604 | 5618 |
5605 | 5619 |
5606 template <class T> | 5620 template <class T> |
5607 void Persistent<T>::MarkIndependent() { | 5621 void Persistent<T>::MarkIndependent() { |
5608 typedef internal::Internals I; | 5622 typedef internal::Internals I; |
5609 if (this->IsEmpty()) return; | 5623 if (this->IsEmpty()) return; |
5610 I::UpdateNodeFlag(reinterpret_cast<internal::Object**>(this->val_), | 5624 I::UpdateNodeFlag(reinterpret_cast<internal::Object**>(this->val_), |
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6369 | 6383 |
6370 | 6384 |
6371 } // namespace v8 | 6385 } // namespace v8 |
6372 | 6386 |
6373 | 6387 |
6374 #undef V8EXPORT | 6388 #undef V8EXPORT |
6375 #undef TYPE_CHECK | 6389 #undef TYPE_CHECK |
6376 | 6390 |
6377 | 6391 |
6378 #endif // V8_H_ | 6392 #endif // V8_H_ |
OLD | NEW |