From d16bf5763441bcb34b0dc6a884e39edbd6841edf Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Sun, 27 Mar 2011 14:12:41 -0600 Subject: [PATCH] implement JVM_MaxObjectInspectionAge stub and Unsafe.getShort --- src/classpath-openjdk.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/classpath-openjdk.cpp b/src/classpath-openjdk.cpp index 46fbd7e326..13f58186ee 100644 --- a/src/classpath-openjdk.cpp +++ b/src/classpath-openjdk.cpp @@ -2115,6 +2115,16 @@ Avian_sun_misc_Unsafe_putObject set(t, o, offset, reinterpret_cast(value)); } +extern "C" JNIEXPORT int64_t JNICALL +Avian_sun_misc_Unsafe_getShort__Ljava_lang_Object_2J +(Thread*, object, uintptr_t* arguments) +{ + object o = reinterpret_cast(arguments[1]); + int64_t offset; memcpy(&offset, arguments + 2, 8); + + return cast(o, offset); +} + extern "C" JNIEXPORT int64_t JNICALL Avian_sun_misc_Unsafe_getInt__Ljava_lang_Object_2J (Thread*, object, uintptr_t* arguments) @@ -2711,7 +2721,10 @@ EXPORT(JVM_GC)() } extern "C" JNIEXPORT jlong JNICALL -EXPORT(JVM_MaxObjectInspectionAge)(void) { abort(); } +EXPORT(JVM_MaxObjectInspectionAge)(void) +{ + return 0; +} extern "C" JNIEXPORT void JNICALL EXPORT(JVM_TraceInstructions)(jboolean) { abort(); }