< prev index next >

src/hotspot/share/jvmci/jvmciJavaClasses.hpp

Print this page
rev 49250 : [mq]: JDK-8199739.patch

*** 351,384 **** #define STATIC_OOPISH_FIELD(klassName, name, type, signature) \ static int _##name##_offset; \ static type name() { \ assert(klassName::klass() != NULL && klassName::klass()->is_linked(), "Class not yet linked: " #klassName); \ InstanceKlass* ik = klassName::klass(); \ ! address addr = ik->static_field_addr(_##name##_offset); \ ! oop result = HeapAccess<>::oop_load((HeapWord*)addr); \ return type(result); \ } \ static void set_##name(type x) { \ assert(klassName::klass() != NULL && klassName::klass()->is_linked(), "Class not yet linked: " #klassName); \ assert(klassName::klass() != NULL, "Class not yet loaded: " #klassName); \ InstanceKlass* ik = klassName::klass(); \ ! address addr = ik->static_field_addr(_##name##_offset); \ ! HeapAccess<>::oop_store((HeapWord*)addr, x); \ } #define STATIC_PRIMITIVE_FIELD(klassName, name, jtypename) \ static int _##name##_offset; \ static jtypename name() { \ assert(klassName::klass() != NULL && klassName::klass()->is_linked(), "Class not yet linked: " #klassName); \ InstanceKlass* ik = klassName::klass(); \ ! address addr = ik->static_field_addr(_##name##_offset); \ ! return HeapAccess<>::load((jtypename*)addr); \ } \ static void set_##name(jtypename x) { \ assert(klassName::klass() != NULL && klassName::klass()->is_linked(), "Class not yet linked: " #klassName); \ InstanceKlass* ik = klassName::klass(); \ ! address addr = ik->static_field_addr(_##name##_offset); \ ! HeapAccess<>::store((jtypename*)addr, x); \ } #define STATIC_INT_FIELD(klassName, name) STATIC_PRIMITIVE_FIELD(klassName, name, jint) #define STATIC_BOOLEAN_FIELD(klassName, name) STATIC_PRIMITIVE_FIELD(klassName, name, jboolean) --- 351,384 ---- #define STATIC_OOPISH_FIELD(klassName, name, type, signature) \ static int _##name##_offset; \ static type name() { \ assert(klassName::klass() != NULL && klassName::klass()->is_linked(), "Class not yet linked: " #klassName); \ InstanceKlass* ik = klassName::klass(); \ ! oop base = ik->static_field_base(); \ ! oop result = HeapAccess<>::oop_load_at(base, _##name##_offset); \ return type(result); \ } \ static void set_##name(type x) { \ assert(klassName::klass() != NULL && klassName::klass()->is_linked(), "Class not yet linked: " #klassName); \ assert(klassName::klass() != NULL, "Class not yet loaded: " #klassName); \ InstanceKlass* ik = klassName::klass(); \ ! oop base = ik->static_field_base(); \ ! HeapAccess<>::oop_store_at(base, _##name##_offset, x); \ } #define STATIC_PRIMITIVE_FIELD(klassName, name, jtypename) \ static int _##name##_offset; \ static jtypename name() { \ assert(klassName::klass() != NULL && klassName::klass()->is_linked(), "Class not yet linked: " #klassName); \ InstanceKlass* ik = klassName::klass(); \ ! oop base = ik->static_field_base(); \ ! return HeapAccess<>::load_at(base, _##name##_offset); \ } \ static void set_##name(jtypename x) { \ assert(klassName::klass() != NULL && klassName::klass()->is_linked(), "Class not yet linked: " #klassName); \ InstanceKlass* ik = klassName::klass(); \ ! oop base = ik->static_field_base(); \ ! HeapAccess<>::store_at(base, _##name##_offset, x); \ } #define STATIC_INT_FIELD(klassName, name) STATIC_PRIMITIVE_FIELD(klassName, name, jint) #define STATIC_BOOLEAN_FIELD(klassName, name) STATIC_PRIMITIVE_FIELD(klassName, name, jboolean)
< prev index next >