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

Unified Diff: Source/bindings/v8/V8GCController.cpp

Issue 15670010: Blink side changes to toggle between the old and new GC visitor API. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fixed Created 7 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/V8GCController.cpp
diff --git a/Source/bindings/v8/V8GCController.cpp b/Source/bindings/v8/V8GCController.cpp
index 10a56b4b30672335f9173a06ced969060d16c8bd..eb6abe5fa2bf6294f540ffb941095cf9f0caf41e 100644
--- a/Source/bindings/v8/V8GCController.cpp
+++ b/Source/bindings/v8/V8GCController.cpp
@@ -109,8 +109,17 @@ public:
UNUSED_PARAM(m_isolate);
}
+#ifdef V8_USE_OLD_STYLE_PERSISTENT_HANDLE_VISITORS
virtual void VisitPersistentHandle(v8::Persistent<v8::Value> value, uint16_t classId) OVERRIDE
{
+ VisitPersistentHandle(&value, classId);
+ }
+
+ virtual void VisitPersistentHandle(v8::Persistent<v8::Value>* value, uint16_t classId)
+#else
+ virtual void VisitPersistentHandle(v8::Persistent<v8::Value>* value, uint16_t classId) OVERRIDE
+#endif
+ {
// A minor DOM GC can collect only Nodes.
if (classId != v8DOMNodeClassId)
return;
@@ -126,13 +135,13 @@ public:
if (m_nodesInNewSpace.size() >= wrappersHandledByEachMinorGC)
return;
- ASSERT(value->IsObject());
+ ASSERT((*value)->IsObject());
#ifdef V8_USE_UNSAFE_HANDLES
- v8::Persistent<v8::Object> wrapper = v8::Persistent<v8::Object>::Cast(value);
+ v8::Persistent<v8::Object> wrapper = v8::Persistent<v8::Object>::Cast(*value);
#else
- v8::Persistent<v8::Object>& wrapper = v8::Persistent<v8::Object>::Cast(value);
+ v8::Persistent<v8::Object>& wrapper = v8::Persistent<v8::Object>::Cast(*value);
#endif
- ASSERT(V8DOMWrapper::maybeDOMWrapper(value));
+ ASSERT(V8DOMWrapper::maybeDOMWrapper(*value));
ASSERT(V8Node::HasInstanceInAnyWorld(wrapper, m_isolate));
Node* node = V8Node::toNative(wrapper);
// A minor DOM GC can handle only node wrappers in the main world.
@@ -238,21 +247,30 @@ public:
{
}
+#ifdef V8_USE_OLD_STYLE_PERSISTENT_HANDLE_VISITORS
virtual void VisitPersistentHandle(v8::Persistent<v8::Value> value, uint16_t classId) OVERRIDE
{
- ASSERT(value->IsObject());
+ VisitPersistentHandle(&value, classId);
+ }
+
+ virtual void VisitPersistentHandle(v8::Persistent<v8::Value>* value, uint16_t classId)
+#else
+ virtual void VisitPersistentHandle(v8::Persistent<v8::Value>* value, uint16_t classId) OVERRIDE
+#endif
+ {
+ ASSERT((*value)->IsObject());
#ifdef V8_USE_UNSAFE_HANDLES
- v8::Persistent<v8::Object> wrapper = v8::Persistent<v8::Object>::Cast(value);
+ v8::Persistent<v8::Object> wrapper = v8::Persistent<v8::Object>::Cast(*value);
#else
- v8::Persistent<v8::Object>& wrapper = v8::Persistent<v8::Object>::Cast(value);
+ v8::Persistent<v8::Object>& wrapper = v8::Persistent<v8::Object>::Cast(*value);
#endif
if (classId != v8DOMNodeClassId && classId != v8DOMObjectClassId)
return;
- ASSERT(V8DOMWrapper::maybeDOMWrapper(value));
+ ASSERT(V8DOMWrapper::maybeDOMWrapper(*value));
- if (value.IsIndependent(m_isolate))
+ if (value->IsIndependent(m_isolate))
return;
WrapperTypeInfo* type = toWrapperTypeInfo(wrapper);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698