src/share/vm/interpreter/interpreterRuntime.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 7086585 Sdiff src/share/vm/interpreter

src/share/vm/interpreter/interpreterRuntime.cpp

Print this page




 967   // stack traversal automatically takes care of preserving arguments for invoke, so
 968   // this is no longer needed.
 969 
 970   // IRT_END does an implicit safepoint check, hence we are guaranteed to block
 971   // if this is called during a safepoint
 972 
 973   if (JvmtiExport::should_post_single_step()) {
 974     // We are called during regular safepoints and when the VM is
 975     // single stepping. If any thread is marked for single stepping,
 976     // then we may have JVMTI work to do.
 977     JvmtiExport::at_single_stepping_point(thread, method(thread), bcp(thread));
 978   }
 979 IRT_END
 980 
 981 IRT_ENTRY(void, InterpreterRuntime::post_field_access(JavaThread *thread, oopDesc* obj,
 982 ConstantPoolCacheEntry *cp_entry))
 983 
 984   // check the access_flags for the field in the klass
 985 
 986   instanceKlass* ik = instanceKlass::cast(java_lang_Class::as_klassOop(cp_entry->f1()));
 987   typeArrayOop fields = ik->fields();
 988   int index = cp_entry->field_index();
 989   assert(index < fields->length(), "holders field index is out of range");
 990   // bail out if field accesses are not watched
 991   if ((fields->ushort_at(index) & JVM_ACC_FIELD_ACCESS_WATCHED) == 0) return;
 992 
 993   switch(cp_entry->flag_state()) {
 994     case btos:    // fall through
 995     case ctos:    // fall through
 996     case stos:    // fall through
 997     case itos:    // fall through
 998     case ftos:    // fall through
 999     case ltos:    // fall through
1000     case dtos:    // fall through
1001     case atos: break;
1002     default: ShouldNotReachHere(); return;
1003   }
1004   bool is_static = (obj == NULL);
1005   HandleMark hm(thread);
1006 
1007   Handle h_obj;
1008   if (!is_static) {
1009     // non-static field accessors have an object, but we need a handle
1010     h_obj = Handle(thread, obj);
1011   }
1012   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   JvmtiExport::post_field_access(thread, method(thread), bcp(thread), h_cp_entry_f1, h_obj, fid);
1015 IRT_END
1016 
1017 IRT_ENTRY(void, InterpreterRuntime::post_field_modification(JavaThread *thread,
1018   oopDesc* obj, ConstantPoolCacheEntry *cp_entry, jvalue *value))
1019 
1020   klassOop k = java_lang_Class::as_klassOop(cp_entry->f1());
1021 
1022   // check the access_flags for the field in the klass
1023   instanceKlass* ik = instanceKlass::cast(k);
1024   typeArrayOop fields = ik->fields();
1025   int index = cp_entry->field_index();
1026   assert(index < fields->length(), "holders field index is out of range");
1027   // bail out if field modifications are not watched
1028   if ((fields->ushort_at(index) & JVM_ACC_FIELD_MODIFICATION_WATCHED) == 0) return;
1029 
1030   char sig_type = '\0';
1031 
1032   switch(cp_entry->flag_state()) {
1033     case btos: sig_type = 'Z'; break;
1034     case ctos: sig_type = 'C'; break;
1035     case stos: sig_type = 'S'; break;
1036     case itos: sig_type = 'I'; break;
1037     case ftos: sig_type = 'F'; break;
1038     case atos: sig_type = 'L'; break;
1039     case ltos: sig_type = 'J'; break;
1040     case dtos: sig_type = 'D'; break;
1041     default:  ShouldNotReachHere(); return;
1042   }
1043   bool is_static = (obj == NULL);
1044 
1045   HandleMark hm(thread);
1046   instanceKlassHandle h_klass(thread, k);
1047   jfieldID fid = jfieldIDWorkaround::to_jfieldID(h_klass, cp_entry->f2(), is_static);
1048   jvalue fvalue;




 967   // stack traversal automatically takes care of preserving arguments for invoke, so
 968   // this is no longer needed.
 969 
 970   // IRT_END does an implicit safepoint check, hence we are guaranteed to block
 971   // if this is called during a safepoint
 972 
 973   if (JvmtiExport::should_post_single_step()) {
 974     // We are called during regular safepoints and when the VM is
 975     // single stepping. If any thread is marked for single stepping,
 976     // then we may have JVMTI work to do.
 977     JvmtiExport::at_single_stepping_point(thread, method(thread), bcp(thread));
 978   }
 979 IRT_END
 980 
 981 IRT_ENTRY(void, InterpreterRuntime::post_field_access(JavaThread *thread, oopDesc* obj,
 982 ConstantPoolCacheEntry *cp_entry))
 983 
 984   // check the access_flags for the field in the klass
 985 
 986   instanceKlass* ik = instanceKlass::cast(java_lang_Class::as_klassOop(cp_entry->f1()));

 987   int index = cp_entry->field_index();
 988   if ((ik->field_access_flags(index) & JVM_ACC_FIELD_ACCESS_WATCHED) == 0) return;


 989 
 990   switch(cp_entry->flag_state()) {
 991     case btos:    // fall through
 992     case ctos:    // fall through
 993     case stos:    // fall through
 994     case itos:    // fall through
 995     case ftos:    // fall through
 996     case ltos:    // fall through
 997     case dtos:    // fall through
 998     case atos: break;
 999     default: ShouldNotReachHere(); return;
1000   }
1001   bool is_static = (obj == NULL);
1002   HandleMark hm(thread);
1003 
1004   Handle h_obj;
1005   if (!is_static) {
1006     // non-static field accessors have an object, but we need a handle
1007     h_obj = Handle(thread, obj);
1008   }
1009   instanceKlassHandle h_cp_entry_f1(thread, java_lang_Class::as_klassOop(cp_entry->f1()));
1010   jfieldID fid = jfieldIDWorkaround::to_jfieldID(h_cp_entry_f1, cp_entry->f2(), is_static);
1011   JvmtiExport::post_field_access(thread, method(thread), bcp(thread), h_cp_entry_f1, h_obj, fid);
1012 IRT_END
1013 
1014 IRT_ENTRY(void, InterpreterRuntime::post_field_modification(JavaThread *thread,
1015   oopDesc* obj, ConstantPoolCacheEntry *cp_entry, jvalue *value))
1016 
1017   klassOop k = java_lang_Class::as_klassOop(cp_entry->f1());
1018 
1019   // check the access_flags for the field in the klass
1020   instanceKlass* ik = instanceKlass::cast(k);

1021   int index = cp_entry->field_index();

1022   // bail out if field modifications are not watched
1023   if ((ik->field_access_flags(index) & JVM_ACC_FIELD_MODIFICATION_WATCHED) == 0) return;
1024 
1025   char sig_type = '\0';
1026 
1027   switch(cp_entry->flag_state()) {
1028     case btos: sig_type = 'Z'; break;
1029     case ctos: sig_type = 'C'; break;
1030     case stos: sig_type = 'S'; break;
1031     case itos: sig_type = 'I'; break;
1032     case ftos: sig_type = 'F'; break;
1033     case atos: sig_type = 'L'; break;
1034     case ltos: sig_type = 'J'; break;
1035     case dtos: sig_type = 'D'; break;
1036     default:  ShouldNotReachHere(); return;
1037   }
1038   bool is_static = (obj == NULL);
1039 
1040   HandleMark hm(thread);
1041   instanceKlassHandle h_klass(thread, k);
1042   jfieldID fid = jfieldIDWorkaround::to_jfieldID(h_klass, cp_entry->f2(), is_static);
1043   jvalue fvalue;


src/share/vm/interpreter/interpreterRuntime.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File