Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

implement Unsafe.{put|get}Char

  • Loading branch information...
commit b1840a297d9d27eaf213e0d339847894271e2f52 1 parent af9e162
@dicej dicej authored
Showing with 21 additions and 0 deletions.
  1. +21 −0 src/classpath-openjdk.cpp
View
21 src/classpath-openjdk.cpp
@@ -2700,6 +2700,16 @@ Avian_sun_misc_Unsafe_getShort__Ljava_lang_Object_2J
}
extern "C" JNIEXPORT int64_t JNICALL
+Avian_sun_misc_Unsafe_getChar__Ljava_lang_Object_2J
+(Thread*, object, uintptr_t* arguments)
+{
+ object o = reinterpret_cast<object>(arguments[1]);
+ int64_t offset; memcpy(&offset, arguments + 2, 8);
+
+ return fieldAtOffset<uint16_t>(o, offset);
+}
+
+extern "C" JNIEXPORT int64_t JNICALL
Avian_sun_misc_Unsafe_getInt__Ljava_lang_Object_2J
(Thread*, object, uintptr_t* arguments)
{
@@ -2806,6 +2816,17 @@ Avian_sun_misc_Unsafe_putShort__Ljava_lang_Object_2JS
}
extern "C" JNIEXPORT void JNICALL
+Avian_sun_misc_Unsafe_putChar__Ljava_lang_Object_2JC
+(Thread*, object, uintptr_t* arguments)
+{
+ object o = reinterpret_cast<object>(arguments[1]);
+ int64_t offset; memcpy(&offset, arguments + 2, 8);
+ uint16_t value = arguments[4];
+
+ fieldAtOffset<uint16_t>(o, offset) = value;
+}
+
+extern "C" JNIEXPORT void JNICALL
Avian_sun_misc_Unsafe_putInt__Ljava_lang_Object_2JI
(Thread*, object, uintptr_t* arguments)
{
Please sign in to comment.
Something went wrong with that request. Please try again.