[vmkit-commits] [vmkit] r81767 - in /vmkit/trunk: include/mvm/Threads/Thread.h lib/JnJVM/VMCore/JavaThread.cpp lib/JnJVM/VMCore/JavaThread.h lib/Mvm/CommonThread/ctthread.cpp

Nicolas Geoffray nicolas.geoffray at lip6.fr
Mon Sep 14 09:20:07 PDT 2009


Author: geoffray
Date: Mon Sep 14 11:20:07 2009
New Revision: 81767

URL: http://llvm.org/viewvc/llvm-project?rev=81767&view=rev
Log:
Move the startNative and endNative functions in the mvm::Thread class.


Modified:
    vmkit/trunk/include/mvm/Threads/Thread.h
    vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp
    vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h
    vmkit/trunk/lib/Mvm/CommonThread/ctthread.cpp

Modified: vmkit/trunk/include/mvm/Threads/Thread.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Threads/Thread.h?rev=81767&r1=81766&r2=81767&view=diff

==============================================================================
--- vmkit/trunk/include/mvm/Threads/Thread.h (original)
+++ vmkit/trunk/include/mvm/Threads/Thread.h Mon Sep 14 11:20:07 2009
@@ -10,6 +10,7 @@
 #ifndef MVM_THREAD_H
 #define MVM_THREAD_H
 
+#include <cassert>
 #include <stdlib.h>
 #include <vector>
 
@@ -279,6 +280,18 @@
   /// calls.
   ///
   std::vector<void*> addresses;
+
+  /// startNative - Record that we are entering native code.
+  ///
+  void startNative(int level) __attribute__ ((noinline));
+
+  /// endNative - Record that we are leaving native code.
+  ///
+  void endNative() {
+    assert(!(addresses.size() % 2) && "Wrong stack");    
+    addresses.pop_back();
+  }
+
 };
 
 

Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp?rev=81767&r1=81766&r2=81767&view=diff

==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp Mon Sep 14 11:20:07 2009
@@ -80,19 +80,6 @@
   __cxa_throw(exc, 0, 0);
 }
 
-void JavaThread::startNative(int level) {
-  // Caller of this function.
-  void** cur = (void**)FRAME_PTR();
-  
-  while (level--)
-    cur = (void**)cur[0];
-
-  // When entering, the number of addresses should be odd.
-  assert((addresses.size() % 2) && "Wrong stack");
-  
-  addresses.push_back(cur);
-}
-
 void JavaThread::startJNI(int level) {
   // Caller of this function.
   void** cur = (void**)FRAME_PTR();

Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h?rev=81767&r1=81766&r2=81767&view=diff

==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h Mon Sep 14 11:20:07 2009
@@ -210,12 +210,8 @@
     addresses.pop_back();
     throwPendingException();
   }
-
-  /// startNative - Record that we are entering native code.
-  ///
-  void startNative(int level) __attribute__ ((noinline));
   
-  /// startNative - Record that we are entering native code.
+  /// startJNI - Record that we are entering native code.
   ///
   void startJNI(int level) __attribute__ ((noinline));
 
@@ -223,13 +219,6 @@
   ///
   void startJava() __attribute__ ((noinline));
   
-  /// endNative - Record that we are leaving native code.
-  ///
-  void endNative() {
-    assert(!(addresses.size() % 2) && "Wrong stack");    
-    addresses.pop_back();
-  }
-
   void endJNI() {
     assert(!(addresses.size() % 2) && "Wrong stack");    
   

Modified: vmkit/trunk/lib/Mvm/CommonThread/ctthread.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/CommonThread/ctthread.cpp?rev=81767&r1=81766&r2=81767&view=diff

==============================================================================
--- vmkit/trunk/lib/Mvm/CommonThread/ctthread.cpp (original)
+++ vmkit/trunk/lib/Mvm/CommonThread/ctthread.cpp Mon Sep 14 11:20:07 2009
@@ -48,6 +48,18 @@
   Collector::traceStackThread();
 }
 
+void Thread::startNative(int level) {
+  // Caller of this function.
+  void** cur = (void**)FRAME_PTR();
+  
+  while (level--)
+    cur = (void**)cur[0];
+
+  // When entering, the number of addresses should be odd.
+  assert((addresses.size() % 2) && "Wrong stack");
+  
+  addresses.push_back(cur);
+}
 
 uintptr_t Thread::baseAddr = 0;
 





More information about the vmkit-commits mailing list