Mercurial > hg > graal-jvmci-8
changeset 22514:8e4949926ae5
jvmciJavaAccess fields can't be used until their type is linked
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Thu, 03 Sep 2015 13:34:52 -0700 |
parents | 82818d115a98 |
children | feb4131657bb |
files | src/share/vm/jvmci/jvmciJavaAccess.hpp |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/share/vm/jvmci/jvmciJavaAccess.hpp Thu Sep 03 13:30:54 2015 -0700 +++ b/src/share/vm/jvmci/jvmciJavaAccess.hpp Thu Sep 03 13:34:52 2015 -0700 @@ -313,7 +313,7 @@ #define STATIC_OOPISH_FIELD(klassName, name, type, signature) \ static int _##name##_offset; \ static type name() { \ - assert(klassName::klass() != NULL, "Class not yet loaded: " #klassName); \ + 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 - InstanceMirrorKlass::offset_of_static_fields()); \ if (UseCompressedOops) { \ @@ -323,6 +323,7 @@ } \ } \ 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 - InstanceMirrorKlass::offset_of_static_fields()); \ @@ -335,11 +336,13 @@ #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 - InstanceMirrorKlass::offset_of_static_fields()); \ return *((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 - InstanceMirrorKlass::offset_of_static_fields()); \ *((jtypename *)addr) = x; \