Reviewers: dcarney, jochen,

Message:
PTAL


Description:
Pass an Isolate to v8::VisitHandlesWithClassIds

The Isolate version of v8::VisitHandlesWithClassIds is needed
for https://codereview.chromium.org/651713002/

Please review this at https://codereview.chromium.org/664473002/

Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+18, -1 lines):
  M include/v8.h
  M src/api.cc
  M test/cctest/test-api.cc


Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index b231912eeb2ae91f19e8890206055ffb9a987b9a..2fe81d89ca94269ab8e1d039c103581e98da94d5 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -5294,6 +5294,13 @@ class V8_EXPORT V8 {
   static void VisitHandlesWithClassIds(PersistentHandleVisitor* visitor);

   /**
+ * Iterates through all the persistent handles in isolate's heap that have
+   * class_ids.
+   */
+  static void VisitHandlesWithClassIds(
+      Isolate* isolate, PersistentHandleVisitor* visitor);
+
+  /**
* Iterates through all the persistent handles in the current isolate's heap * that have class_ids and are candidates to be marked as partially dependent * handles. This will visit handles to young objects created since the last
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index fe56c2b8904d590a2861f2d991625a574bd82373..e9900f35a5055e039144d1658caed4c85c6a82f0 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -5115,6 +5115,16 @@ class VisitorAdapter : public i::ObjectVisitor {
 };


+void v8::V8::VisitHandlesWithClassIds(v8::Isolate* exported_isolate,
+    PersistentHandleVisitor* visitor) {
+  i::Isolate* isolate = reinterpret_cast<i::Isolate*>(exported_isolate);
+  i::DisallowHeapAllocation no_allocation;
+
+  VisitorAdapter visitor_adapter(visitor);
+  isolate->global_handles()->IterateAllRootsWithClassIds(&visitor_adapter);
+}
+
+
 void v8::V8::VisitHandlesWithClassIds(PersistentHandleVisitor* visitor) {
   i::Isolate* isolate = i::Isolate::Current();
   i::DisallowHeapAllocation no_allocation;
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index b458418f43a66147a814dbd669ec58b1043f88c4..b73095728159d2c968e5eefff11925654e56364a 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -20284,7 +20284,7 @@ TEST(PersistentHandleVisitor) {
   CHECK_EQ(42, object.WrapperClassId());

   Visitor42 visitor(&object);
-  v8::V8::VisitHandlesWithClassIds(&visitor);
+  v8::V8::VisitHandlesWithClassIds(isolate, &visitor);
   CHECK_EQ(1, visitor.counter_);

   object.Reset();


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to