* src/vm/jit/trace.c (trace_java_call_exit): Workaround for
[cacao.git] / src / vm / jit / trace.c
index 9feb7c382a1ad2f81960ae43f050207ff4cd5458..1f6dc5180ec3ef1d1a7f75fecd958c3c13cac07c 100644 (file)
@@ -391,8 +391,16 @@ void trace_java_call_exit(methodinfo *m, uint64_t *return_regs)
                strcat(logtext, "->");
                val = argument_jitreturn_load(md, return_regs);
 
-               logtext =
-                       trace_java_call_print_argument(logtext, &logtextlen, &md->returntype, val);
+               /* Workaround for sun.misc.Unsafe.staticFieldBase().  In the
+                  future (exact GC) we should check if the address is on the
+                  GC heap. */
+
+               if ((m->class       == NULL) ||
+                       ((m->class->name != utf_new_char("sun/misc/Unsafe")) &&
+                        (m->name        != utf_new_char("staticFieldBase")))) {
+                       logtext =
+                               trace_java_call_print_argument(logtext, &logtextlen, &md->returntype, val);
+               }
        }
 
        log_text(logtext);