Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(523)

Unified Diff: include/v8.h

Issue 677403002: Revert 'Introduce phantom weak handles in the API and use them internally for debug info' (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index 7c666ff356a0f88c3b5c27d26c3298618a0532ec..f70f45769bb5ca58ff6d178b7129f92448301e8c 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -516,18 +516,6 @@ template <class T> class PersistentBase {
P* parameter,
typename WeakCallbackData<S, P>::Callback callback);
- // Phantom persistents work like weak persistents, except that the pointer to
- // the object being collected is not available in the finalization callback.
- // This enables the garbage collector to collect the object and any objects
- // it references transitively in one GC cycle.
- template <typename P>
- V8_INLINE void SetPhantom(P* parameter,
- typename WeakCallbackData<T, P>::Callback callback);
-
- template <typename S, typename P>
- V8_INLINE void SetPhantom(P* parameter,
- typename WeakCallbackData<S, P>::Callback callback);
-
template<typename P>
V8_INLINE P* ClearWeak();
@@ -5342,15 +5330,14 @@ class V8_EXPORT V8 {
private:
V8();
- enum WeakHandleType { PhantomHandle, NonphantomHandle };
-
static internal::Object** GlobalizeReference(internal::Isolate* isolate,
internal::Object** handle);
static internal::Object** CopyPersistent(internal::Object** handle);
static void DisposeGlobal(internal::Object** global_handle);
typedef WeakCallbackData<Value, void>::Callback WeakCallback;
- static void MakeWeak(internal::Object** global_handle, void* data,
- WeakCallback weak_callback, WeakHandleType phantom);
+ static void MakeWeak(internal::Object** global_handle,
+ void* data,
+ WeakCallback weak_callback);
static void* ClearWeak(internal::Object** global_handle);
static void Eternalize(Isolate* isolate,
Value* handle,
@@ -6213,8 +6200,9 @@ void PersistentBase<T>::SetWeak(
typename WeakCallbackData<S, P>::Callback callback) {
TYPE_CHECK(S, T);
typedef typename WeakCallbackData<Value, void>::Callback Callback;
- V8::MakeWeak(reinterpret_cast<internal::Object**>(this->val_), parameter,
- reinterpret_cast<Callback>(callback), V8::NonphantomHandle);
+ V8::MakeWeak(reinterpret_cast<internal::Object**>(this->val_),
+ parameter,
+ reinterpret_cast<Callback>(callback));
}
@@ -6228,26 +6216,7 @@ void PersistentBase<T>::SetWeak(
template <class T>
-template <typename S, typename P>
-void PersistentBase<T>::SetPhantom(
- P* parameter, typename WeakCallbackData<S, P>::Callback callback) {
- TYPE_CHECK(S, T);
- typedef typename WeakCallbackData<Value, void>::Callback Callback;
- V8::MakeWeak(reinterpret_cast<internal::Object**>(this->val_), parameter,
- reinterpret_cast<Callback>(callback), V8::PhantomHandle);
-}
-
-
-template <class T>
-template <typename P>
-void PersistentBase<T>::SetPhantom(
- P* parameter, typename WeakCallbackData<T, P>::Callback callback) {
- SetPhantom<T, P>(parameter, callback);
-}
-
-
-template <class T>
-template <typename P>
+template<typename P>
P* PersistentBase<T>::ClearWeak() {
return reinterpret_cast<P*>(
V8::ClearWeak(reinterpret_cast<internal::Object**>(this->val_)));
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698