[vmkit-commits] [vmkit] r135868 - in /vmkit/trunk: include/mvm/MethodInfo.h lib/Mvm/Runtime/MethodInfo.cpp

Nicolas Geoffray nicolas.geoffray at lip6.fr
Sun Jul 24 05:55:59 PDT 2011


Author: geoffray
Date: Sun Jul 24 07:55:59 2011
New Revision: 135868

URL: http://llvm.org/viewvc/llvm-project?rev=135868&view=rev
Log:
Do not call dladdr when initialzing the frames, but when printing them.


Modified:
    vmkit/trunk/include/mvm/MethodInfo.h
    vmkit/trunk/lib/Mvm/Runtime/MethodInfo.cpp

Modified: vmkit/trunk/include/mvm/MethodInfo.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/MethodInfo.h?rev=135868&r1=135867&r2=135868&view=diff
==============================================================================
--- vmkit/trunk/include/mvm/MethodInfo.h (original)
+++ vmkit/trunk/include/mvm/MethodInfo.h Sun Jul 24 07:55:59 2011
@@ -17,7 +17,7 @@
 
 class MethodInfo : public PermanentObject {
 public:
-  virtual void print(void* ip, void* addr) = 0;
+  virtual void print(void* ip, void* addr);
   virtual void scan(uintptr_t closure, void* ip, void* addr) = 0;
   virtual bool isHighLevelMethod() {
     return false;
@@ -57,21 +57,8 @@
   }
 };
 
-class StaticCamlMethodInfo : public CamlMethodInfo {
-  const char* name;
-public:
-  virtual void print(void* ip, void* addr);
-  StaticCamlMethodInfo(CamlFrame* CF, const char* n) :
-    CamlMethodInfo(CF) {
-    Owner = NULL;
-    MetaInfo = NULL;
-    name = n;
-  }
-};
-
 class DefaultMethodInfo : public MethodInfo {
 public:
-  virtual void print(void* ip, void* addr);
   virtual void scan(uintptr_t closure, void* ip, void* addr);
   static DefaultMethodInfo DM;
     

Modified: vmkit/trunk/lib/Mvm/Runtime/MethodInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Runtime/MethodInfo.cpp?rev=135868&r1=135867&r2=135868&view=diff
==============================================================================
--- vmkit/trunk/lib/Mvm/Runtime/MethodInfo.cpp (original)
+++ vmkit/trunk/lib/Mvm/Runtime/MethodInfo.cpp Sun Jul 24 07:55:59 2011
@@ -26,11 +26,7 @@
   }
 }
 
-void StaticCamlMethodInfo::print(void* ip, void* addr) {
-  fprintf(stderr, "; %p (%p) in %s static method\n", ip, addr, name);
-}
-
-void DefaultMethodInfo::print(void* ip, void* addr) {
+void MethodInfo::print(void* ip, void* addr) {
   Dl_info info;
   int res = dladdr(ip, &info);
   if (res != 0 && info.dli_sname != NULL) {
@@ -95,13 +91,10 @@
   CamlFrames* frames = NULL;
   while ((frames = allFrames[i++]) != NULL) {
     CamlFrameDecoder decoder(frames);
-    Dl_info info;
     while (decoder.hasNext()) {
       CamlFrame* frame = decoder.next();
-      int res = dladdr(frame->ReturnAddress, &info);
-      assert(res != 0 && "No frame");
-      StaticCamlMethodInfo* MI = new(*StaticAllocator, "StaticCamlMethodInfo")
-          StaticCamlMethodInfo(frame, info.dli_sname);
+      CamlMethodInfo* MI =
+          new(*StaticAllocator, "CamlMethodInfo") CamlMethodInfo(frame);
       addMethodInfo(MI, frame->ReturnAddress);
     }
   }





More information about the vmkit-commits mailing list