Author: [email protected]
Date: Sun Jul  5 23:57:32 2009
New Revision: 2359

Modified:
    branches/bleeding_edge/src/objects-debug.cc
    branches/bleeding_edge/src/objects.cc

Log:
Fix win32 build by moving template function definition.

Modified: branches/bleeding_edge/src/objects-debug.cc
==============================================================================
--- branches/bleeding_edge/src/objects-debug.cc (original)
+++ branches/bleeding_edge/src/objects-debug.cc Sun Jul  5 23:57:32 2009
@@ -744,28 +744,6 @@
    ASSERT(IsProxy());
  }

-template<typename Shape, typename Key>
-void Dictionary<Shape, Key>::Print() {
-  int capacity = HashTable<Shape, Key>::Capacity();
-  for (int i = 0; i < capacity; i++) {
-    Object* k = HashTable<Shape, Key>::KeyAt(i);
-    if (HashTable<Shape, Key>::IsKey(k)) {
-      PrintF(" ");
-      if (k->IsString()) {
-        String::cast(k)->StringPrint();
-      } else {
-        k->ShortPrint();
-      }
-      PrintF(": ");
-      ValueAt(i)->ShortPrint();
-      PrintF("\n");
-    }
-  }
-}
-
-// Template instantiations.
-template void Dictionary<NumberDictionaryShape, uint32_t>::Print();
-template void Dictionary<StringDictionaryShape, String*>::Print();

  void AccessorInfo::AccessorInfoVerify() {
    CHECK(IsAccessorInfo());

Modified: branches/bleeding_edge/src/objects.cc
==============================================================================
--- branches/bleeding_edge/src/objects.cc       (original)
+++ branches/bleeding_edge/src/objects.cc       Sun Jul  5 23:57:32 2009
@@ -5747,6 +5747,34 @@
        (length / (2 * NumberDictionary::kEntrySize));
  }

+
+// Certain compilers request function template instantiation when they
+// see the definition of the other template functions in the
+// class. This requires us to have the template functions put
+// together, so even though this function belongs in objects-debug.cc,
+// we keep it here instead to satisfy certain compilers.
+#ifdef DEBUG
+template<typename Shape, typename Key>
+void Dictionary<Shape, Key>::Print() {
+  int capacity = HashTable<Shape, Key>::Capacity();
+  for (int i = 0; i < capacity; i++) {
+    Object* k = HashTable<Shape, Key>::KeyAt(i);
+    if (HashTable<Shape, Key>::IsKey(k)) {
+      PrintF(" ");
+      if (k->IsString()) {
+        String::cast(k)->StringPrint();
+      } else {
+        k->ShortPrint();
+      }
+      PrintF(": ");
+      ValueAt(i)->ShortPrint();
+      PrintF("\n");
+    }
+  }
+}
+#endif
+
+
  template<typename Shape, typename Key>
  void Dictionary<Shape, Key>::CopyValuesTo(FixedArray* elements) {
    int pos = 0;

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to