From ea72a27202990792d32493835c2f9f0592e4b8df Mon Sep 17 00:00:00 2001 From: bdemsky Date: Sat, 16 Apr 2011 07:29:52 +0000 Subject: [PATCH] changes --- Robust/src/IR/Flat/BuildCode.java | 14 +++++++++----- Robust/src/Runtime/jni/jni-private.h | 6 +++--- Robust/src/Runtime/jni/jni-stuff.c | 4 ++-- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/Robust/src/IR/Flat/BuildCode.java b/Robust/src/IR/Flat/BuildCode.java index 48126a48..8319a245 100644 --- a/Robust/src/IR/Flat/BuildCode.java +++ b/Robust/src/IR/Flat/BuildCode.java @@ -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) { diff --git a/Robust/src/Runtime/jni/jni-private.h b/Robust/src/Runtime/jni/jni-private.h index 77b82992..3319a9ee 100644 --- a/Robust/src/Runtime/jni/jni-private.h +++ b/Robust/src/Runtime/jni/jni-private.h @@ -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; diff --git a/Robust/src/Runtime/jni/jni-stuff.c b/Robust/src/Runtime/jni/jni-stuff.c index 648989f4..9f2ebbec 100644 --- a/Robust/src/Runtime/jni/jni-stuff.c +++ b/Robust/src/Runtime/jni/jni-stuff.c @@ -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; } -- 2.34.1