[vmkit-commits] [vmkit] r65339 - in /vmkit/trunk/lib/JnJVM/VMCore: JavaClass.cpp JavaClass.h

Nicolas Geoffray nicolas.geoffray at lip6.fr
Mon Feb 23 13:21:50 PST 2009


Author: geoffray
Date: Mon Feb 23 15:21:49 2009
New Revision: 65339

URL: http://llvm.org/viewvc/llvm-project?rev=65339&view=rev
Log:
Provide static functions to create jni function names.


Modified:
    vmkit/trunk/lib/JnJVM/VMCore/JavaClass.cpp
    vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h

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

==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaClass.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaClass.cpp Mon Feb 23 15:21:49 2009
@@ -1092,9 +1092,10 @@
   return cl;
 }
 
-void JavaMethod::jniConsFromMeth(char* buf) const {
-  const UTF8* jniConsClName = classDef->name;
-  const UTF8* jniConsName = name;
+void JavaMethod::jniConsFromMeth(char* buf, const UTF8* jniConsClName,
+                                 const UTF8* jniConsName,
+                                 const UTF8* jniConsType,
+                                 bool synthetic) {
   sint32 clen = jniConsClName->size;
   sint32 mnlen = jniConsName->size;
 
@@ -1135,10 +1136,10 @@
 
 }
 
-void JavaMethod::jniConsFromMethOverloaded(char* buf) const {
-  const UTF8* jniConsClName = classDef->name;
-  const UTF8* jniConsName = name;
-  const UTF8* jniConsType = type;
+void JavaMethod::jniConsFromMethOverloaded(char* buf, const UTF8* jniConsClName,
+                                           const UTF8* jniConsName,
+                                           const UTF8* jniConsType,
+                                           bool synthetic) {
   sint32 clen = jniConsClName->size;
   sint32 mnlen = jniConsName->size;
 
@@ -1204,7 +1205,7 @@
     }
   }
 
-  if (isSynthetic(access)) {
+  if (synthetic) {
     ptr[0] = 'S';
     ++ptr;
   }

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

==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h Mon Feb 23 15:21:49 2009
@@ -1032,12 +1032,30 @@
   /// jniConsFromMeth - Construct the JNI name of this method as if
   /// there is no other function in the class with the same name.
   ///
-  void jniConsFromMeth(char* buf) const;
+  void jniConsFromMeth(char* buf) const {
+    jniConsFromMeth(buf, classDef->name, name, type, isSynthetic(access));
+  }
 
   /// jniConsFromMethOverloaded - Construct the JNI name of this method
   /// as if its name is overloaded in the class.
   ///
-  void jniConsFromMethOverloaded(char* buf) const;
+  void jniConsFromMethOverloaded(char* buf) const {
+    jniConsFromMethOverloaded(buf, classDef->name, name, type,
+                              isSynthetic(access));
+  }
+  
+  /// jniConsFromMeth - Construct the non-overloaded JNI name with
+  /// the given name and type.
+  ///
+  static void jniConsFromMeth(char* buf, const UTF8* clName, const UTF8* name,
+                              const UTF8* sign, bool synthetic);
+
+  /// jniConsFromMethOverloaded - Construct the overloaded JNI name with
+  /// the given name and type.
+  ///
+  static void jniConsFromMethOverloaded(char* buf, const UTF8* clName,
+                                        const UTF8* name, const UTF8* sign,
+                                        bool synthetic);
   
   /// getParameterTypes - Get the java.lang.Class of the parameters of
   /// the method, with the given class loader.





More information about the vmkit-commits mailing list