implement Unsafe.{put|get}Char

This commit is contained in:
Joel Dice 2013-04-30 22:54:45 -06:00
parent af9e162827
commit b1840a297d

View File

@ -2699,6 +2699,16 @@ Avian_sun_misc_Unsafe_getShort__Ljava_lang_Object_2J
return fieldAtOffset<int16_t>(o, offset);
}
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)
@ -2805,6 +2815,17 @@ Avian_sun_misc_Unsafe_putShort__Ljava_lang_Object_2JS
fieldAtOffset<int16_t>(o, offset) = value;
}
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)