Mercurial > hg > graal-jvmci-8
comparison src/share/vm/interpreter/interpreterRuntime.cpp @ 2376:c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
Reviewed-by: kvn, coleenp, twisti, stefank
author | never |
---|---|
date | Fri, 18 Mar 2011 16:00:34 -0700 |
parents | 8033953d67ff |
children | ed69575596ac |
comparison
equal
deleted
inserted
replaced
2375:d673ef06fe96 | 2376:c7f3d0b4570f |
---|---|
116 int index = wide ? get_index_u2(thread, Bytecodes::_ldc_w) : get_index_u1(thread, Bytecodes::_ldc); | 116 int index = wide ? get_index_u2(thread, Bytecodes::_ldc_w) : get_index_u1(thread, Bytecodes::_ldc); |
117 constantTag tag = pool->tag_at(index); | 117 constantTag tag = pool->tag_at(index); |
118 | 118 |
119 if (tag.is_unresolved_klass() || tag.is_klass()) { | 119 if (tag.is_unresolved_klass() || tag.is_klass()) { |
120 klassOop klass = pool->klass_at(index, CHECK); | 120 klassOop klass = pool->klass_at(index, CHECK); |
121 oop java_class = klass->klass_part()->java_mirror(); | 121 oop java_class = klass->java_mirror(); |
122 thread->set_vm_result(java_class); | 122 thread->set_vm_result(java_class); |
123 } else { | 123 } else { |
124 #ifdef ASSERT | 124 #ifdef ASSERT |
125 // If we entered this runtime routine, we believed the tag contained | 125 // If we entered this runtime routine, we believed the tag contained |
126 // an unresolved string, an unresolved class or a resolved class. | 126 // an unresolved string, an unresolved class or a resolved class. |
981 | 981 |
982 IRT_ENTRY(void, InterpreterRuntime::post_field_access(JavaThread *thread, oopDesc* obj, | 982 IRT_ENTRY(void, InterpreterRuntime::post_field_access(JavaThread *thread, oopDesc* obj, |
983 ConstantPoolCacheEntry *cp_entry)) | 983 ConstantPoolCacheEntry *cp_entry)) |
984 | 984 |
985 // check the access_flags for the field in the klass | 985 // check the access_flags for the field in the klass |
986 instanceKlass* ik = instanceKlass::cast((klassOop)cp_entry->f1()); | 986 |
987 instanceKlass* ik = instanceKlass::cast(java_lang_Class::as_klassOop(cp_entry->f1())); | |
987 typeArrayOop fields = ik->fields(); | 988 typeArrayOop fields = ik->fields(); |
988 int index = cp_entry->field_index(); | 989 int index = cp_entry->field_index(); |
989 assert(index < fields->length(), "holders field index is out of range"); | 990 assert(index < fields->length(), "holders field index is out of range"); |
990 // bail out if field accesses are not watched | 991 // bail out if field accesses are not watched |
991 if ((fields->ushort_at(index) & JVM_ACC_FIELD_ACCESS_WATCHED) == 0) return; | 992 if ((fields->ushort_at(index) & JVM_ACC_FIELD_ACCESS_WATCHED) == 0) return; |
1007 Handle h_obj; | 1008 Handle h_obj; |
1008 if (!is_static) { | 1009 if (!is_static) { |
1009 // non-static field accessors have an object, but we need a handle | 1010 // non-static field accessors have an object, but we need a handle |
1010 h_obj = Handle(thread, obj); | 1011 h_obj = Handle(thread, obj); |
1011 } | 1012 } |
1012 instanceKlassHandle h_cp_entry_f1(thread, (klassOop)cp_entry->f1()); | 1013 instanceKlassHandle h_cp_entry_f1(thread, java_lang_Class::as_klassOop(cp_entry->f1())); |
1013 jfieldID fid = jfieldIDWorkaround::to_jfieldID(h_cp_entry_f1, cp_entry->f2(), is_static); | 1014 jfieldID fid = jfieldIDWorkaround::to_jfieldID(h_cp_entry_f1, cp_entry->f2(), is_static); |
1014 JvmtiExport::post_field_access(thread, method(thread), bcp(thread), h_cp_entry_f1, h_obj, fid); | 1015 JvmtiExport::post_field_access(thread, method(thread), bcp(thread), h_cp_entry_f1, h_obj, fid); |
1015 IRT_END | 1016 IRT_END |
1016 | 1017 |
1017 IRT_ENTRY(void, InterpreterRuntime::post_field_modification(JavaThread *thread, | 1018 IRT_ENTRY(void, InterpreterRuntime::post_field_modification(JavaThread *thread, |
1018 oopDesc* obj, ConstantPoolCacheEntry *cp_entry, jvalue *value)) | 1019 oopDesc* obj, ConstantPoolCacheEntry *cp_entry, jvalue *value)) |
1019 | 1020 |
1020 klassOop k = (klassOop)cp_entry->f1(); | 1021 klassOop k = java_lang_Class::as_klassOop(cp_entry->f1()); |
1021 | 1022 |
1022 // check the access_flags for the field in the klass | 1023 // check the access_flags for the field in the klass |
1023 instanceKlass* ik = instanceKlass::cast(k); | 1024 instanceKlass* ik = instanceKlass::cast(k); |
1024 typeArrayOop fields = ik->fields(); | 1025 typeArrayOop fields = ik->fields(); |
1025 int index = cp_entry->field_index(); | 1026 int index = cp_entry->field_index(); |