changes
authorbdemsky <bdemsky>
Sat, 16 Apr 2011 07:29:52 +0000 (07:29 +0000)
committerbdemsky <bdemsky>
Sat, 16 Apr 2011 07:29:52 +0000 (07:29 +0000)
Robust/src/IR/Flat/BuildCode.java
Robust/src/Runtime/jni/jni-private.h
Robust/src/Runtime/jni/jni-stuff.c

index 48126a483497d2e9a60c490843a8db145e0b3ce7..8319a245693300f4a4590e308b86480f981caeff 100644 (file)
@@ -457,6 +457,7 @@ public class BuildCode {
     outmethod.println("#include \"methodheaders.h\"");
     outmethod.println("#include \"virtualtable.h\"");
     outmethod.println("#include \"runtime.h\"");
+    outmethod.println("#include \"jni-private.h\"");
 
     // always include: compiler directives will leave out
     // instrumentation when option is not set
@@ -1849,9 +1850,9 @@ public class BuildCode {
       }
     }
     if (GENERATEPRECISEGC) {
-      outmethod.println("stopforgc((struct garbagelist *)___params___)");
+      outmethod.println("stopforgc((struct garbagelist *)___params___);");
     }
-    if (md.getReturnType()!=null) {
+    if (!md.getReturnType().isVoid()) {
       if (md.getReturnType().isPtr()) 
        outmethod.print("jobject retval=");
       else
@@ -1873,9 +1874,9 @@ public class BuildCode {
     }
     outmethod.println(");");
     if (GENERATEPRECISEGC) {
-      outmethod.println("restartaftergc()");
+      outmethod.println("restartaftergc();");
     }
-    if (md.getReturnType()!=null) {
+    if (!md.getReturnType().isVoid()) {
       if (md.getReturnType().isPtr()) {
        outmethod.println("struct ___Object___ * retobj=JNIUNWRAP(retval);");
        outmethod.println("JNIPOPFRAME();");
@@ -1884,8 +1885,11 @@ public class BuildCode {
        outmethod.println("JNIPOPFRAME();");
        outmethod.println("return retval;");
       }
-    }
+    } else
+      outmethod.println("JNIPOPFRAME();");
+    
     outmethod.println("}");
+    outmethod.println("");
   }
 
   protected void generateFlatMethod(FlatMethod fm, PrintWriter output) {
index 77b82992a77df8a8a845fc52ff5723c28d3c308f..3319a9ee4ca96a0ea6d72dc0c6129175fc51225f 100644 (file)
@@ -10,7 +10,7 @@ struct _jfieldID {
   char *fieldname;
 };
 
-struct _jobject {
+struct __jobject {
   void * ref;
 };
 
@@ -28,11 +28,11 @@ struct c_class {
 struct jnireferences {
   struct jnireferences * next;
   int index;
-  struct _jobject array[MAXJNIREFS];
+  struct __jobject array[MAXJNIREFS];
 };
 
 #ifndef MAC
-struct _jobject * getwrapped(void * objptr);
+struct __jobject * getwrapper(void * objptr);
 void jnipushframe();
 void jnipopframe();
 extern __thread struct jnireferences * jnirefs;
index 648989f47018f7553a7c589e9574c504d07cd7ea..9f2ebbec8780dc5b52bb3d908af34a29f5dc5259 100644 (file)
@@ -6,10 +6,10 @@
 #ifndef MAC
 __thread struct jnireferences * jnirefs;
 
-struct _jobject * getwrapped(void * objptr) {
+struct __jobject * getwrapper(void * objptr) {
   if ((jnirefs->index)>=MAXJNIREFS)
     printf("OVERFLOW IN JOBJECT\n");
-  struct _jobject *ptr=&jnirefs->array[jnirefs->index++];
+  struct __jobject *ptr=&jnirefs->array[jnirefs->index++];
   ptr->ref=objptr;
   return ptr;
 }