[llvm-commits] [vmkit] r51043 - in /vmkit/trunk/lib/JnJVM: Classpath/ClasspathVMStackWalker.cpp Classpath/ClasspathVMThrowable.cpp VMCore/JavaBacktrace.cpp VMCore/JavaJIT.h

Nicolas Geoffray nicolas.geoffray at lip6.fr
Tue May 13 07:48:23 PDT 2008


Author: geoffray
Date: Tue May 13 09:48:23 2008
New Revision: 51043

URL: http://llvm.org/viewvc/llvm-project?rev=51043&view=rev
Log:
Make ip_to_meth a function of JavaJIT


Modified:
    vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMStackWalker.cpp
    vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThrowable.cpp
    vmkit/trunk/lib/JnJVM/VMCore/JavaBacktrace.cpp
    vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.h

Modified: vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMStackWalker.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMStackWalker.cpp?rev=51043&r1=51042&r2=51043&view=diff

==============================================================================
--- vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMStackWalker.cpp (original)
+++ vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMStackWalker.cpp Tue May 13 09:48:23 2008
@@ -24,13 +24,11 @@
 
 using namespace jnjvm;
 
-extern "C" JavaMethod* ip_to_meth(int* ip);
-
 extern "C" {
 
 ArrayObject* recGetClassContext(int** stack, uint32 size, uint32 first, uint32 rec) {
   if (size != first) {
-    JavaMethod* meth = ip_to_meth(stack[first]);
+    JavaMethod* meth = JavaJIT::IPToJavaMethod(stack[first]);
     if (meth) {
       ArrayObject* res = recGetClassContext(stack, size, first + 1, rec + 1); 
       res->setAt(rec, meth->classDef->getClassDelegatee());
@@ -57,7 +55,7 @@
   CommonClass* cl = Classpath::vmStackWalker; 
 
   while (i < real_size) {
-    JavaMethod* meth = ip_to_meth(ips[i++]);
+    JavaMethod* meth = JavaJIT::IPToJavaMethod(ips[i++]);
     if (meth && meth->classDef == cl) {
       first = i;
       break;

Modified: vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThrowable.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThrowable.cpp?rev=51043&r1=51042&r2=51043&view=diff

==============================================================================
--- vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThrowable.cpp (original)
+++ vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThrowable.cpp Tue May 13 09:48:23 2008
@@ -29,8 +29,6 @@
 
 using namespace jnjvm;
 
-extern "C" JavaMethod* ip_to_meth(int* ip);
-
 extern "C" {
 
 JNIEXPORT jobject JNICALL Java_java_lang_VMThrowable_fillInStackTrace(
@@ -83,7 +81,7 @@
 #else
     int *begIp = (int*)Collector::begOf(stack[first]);
 #endif
-    JavaMethod* meth = ip_to_meth(begIp);
+    JavaMethod* meth = JavaJIT::IPToJavaMethod(begIp);
     if (meth) {
       ArrayObject* res = recGetStackTrace(stack, first + 1, rec + 1);
       res->setAt(rec, consStackElement(meth, stack[first]));
@@ -112,7 +110,7 @@
 #else
     int *begIp = (int*)Collector::begOf((void*)stack[i++]);
 #endif
-    JavaMethod* meth = ip_to_meth(begIp);
+    JavaMethod* meth = JavaJIT::IPToJavaMethod(begIp);
     if (meth && meth->classDef == cl) {
       first = i;
       break;

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

==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaBacktrace.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaBacktrace.cpp Tue May 13 09:48:23 2008
@@ -25,7 +25,7 @@
 
 using namespace jnjvm;
 
-extern "C" JavaMethod* ip_to_meth(int* begIp) {
+JavaMethod* JavaJIT::IPToJavaMethod(void* begIp) {
   mvm::Code* val = mvm::Code::getCodeFromPointer(begIp);
   if (val) {
     mvm::Method* m = val->method();

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

==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.h (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.h Tue May 13 09:48:23 2008
@@ -277,6 +277,7 @@
   static JavaObject* getCallingClassLoader();
   static void printBacktrace();
   static int getBacktrace(void** array, int size);
+  static JavaMethod* IPToJavaMethod(void* ip);
 
 #ifdef WITH_TRACER
   static llvm::Function* markAndTraceLLVM;





More information about the llvm-commits mailing list