Mercurial > hg > truffle
comparison src/share/vm/prims/jvmtiEnv.cpp @ 3938:e6b1331a51d2
7086585: make Java field injection more flexible
Reviewed-by: jrose, twisti, kvn, coleenp
author | never |
---|---|
date | Sat, 10 Sep 2011 17:29:02 -0700 |
parents | fcc932c8238c |
children | f08d439fab8c |
comparison
equal
deleted
inserted
replaced
3937:c565834fb592 | 3938:e6b1331a51d2 |
---|---|
2042 jvmtiError | 2042 jvmtiError |
2043 JvmtiEnv::SetFieldAccessWatch(fieldDescriptor* fdesc_ptr) { | 2043 JvmtiEnv::SetFieldAccessWatch(fieldDescriptor* fdesc_ptr) { |
2044 // make sure we haven't set this watch before | 2044 // make sure we haven't set this watch before |
2045 if (fdesc_ptr->is_field_access_watched()) return JVMTI_ERROR_DUPLICATE; | 2045 if (fdesc_ptr->is_field_access_watched()) return JVMTI_ERROR_DUPLICATE; |
2046 fdesc_ptr->set_is_field_access_watched(true); | 2046 fdesc_ptr->set_is_field_access_watched(true); |
2047 update_klass_field_access_flag(fdesc_ptr); | |
2048 | 2047 |
2049 JvmtiEventController::change_field_watch(JVMTI_EVENT_FIELD_ACCESS, true); | 2048 JvmtiEventController::change_field_watch(JVMTI_EVENT_FIELD_ACCESS, true); |
2050 | 2049 |
2051 return JVMTI_ERROR_NONE; | 2050 return JVMTI_ERROR_NONE; |
2052 } /* end SetFieldAccessWatch */ | 2051 } /* end SetFieldAccessWatch */ |
2055 jvmtiError | 2054 jvmtiError |
2056 JvmtiEnv::ClearFieldAccessWatch(fieldDescriptor* fdesc_ptr) { | 2055 JvmtiEnv::ClearFieldAccessWatch(fieldDescriptor* fdesc_ptr) { |
2057 // make sure we have a watch to clear | 2056 // make sure we have a watch to clear |
2058 if (!fdesc_ptr->is_field_access_watched()) return JVMTI_ERROR_NOT_FOUND; | 2057 if (!fdesc_ptr->is_field_access_watched()) return JVMTI_ERROR_NOT_FOUND; |
2059 fdesc_ptr->set_is_field_access_watched(false); | 2058 fdesc_ptr->set_is_field_access_watched(false); |
2060 update_klass_field_access_flag(fdesc_ptr); | |
2061 | 2059 |
2062 JvmtiEventController::change_field_watch(JVMTI_EVENT_FIELD_ACCESS, false); | 2060 JvmtiEventController::change_field_watch(JVMTI_EVENT_FIELD_ACCESS, false); |
2063 | 2061 |
2064 return JVMTI_ERROR_NONE; | 2062 return JVMTI_ERROR_NONE; |
2065 } /* end ClearFieldAccessWatch */ | 2063 } /* end ClearFieldAccessWatch */ |
2068 jvmtiError | 2066 jvmtiError |
2069 JvmtiEnv::SetFieldModificationWatch(fieldDescriptor* fdesc_ptr) { | 2067 JvmtiEnv::SetFieldModificationWatch(fieldDescriptor* fdesc_ptr) { |
2070 // make sure we haven't set this watch before | 2068 // make sure we haven't set this watch before |
2071 if (fdesc_ptr->is_field_modification_watched()) return JVMTI_ERROR_DUPLICATE; | 2069 if (fdesc_ptr->is_field_modification_watched()) return JVMTI_ERROR_DUPLICATE; |
2072 fdesc_ptr->set_is_field_modification_watched(true); | 2070 fdesc_ptr->set_is_field_modification_watched(true); |
2073 update_klass_field_access_flag(fdesc_ptr); | |
2074 | 2071 |
2075 JvmtiEventController::change_field_watch(JVMTI_EVENT_FIELD_MODIFICATION, true); | 2072 JvmtiEventController::change_field_watch(JVMTI_EVENT_FIELD_MODIFICATION, true); |
2076 | 2073 |
2077 return JVMTI_ERROR_NONE; | 2074 return JVMTI_ERROR_NONE; |
2078 } /* end SetFieldModificationWatch */ | 2075 } /* end SetFieldModificationWatch */ |
2081 jvmtiError | 2078 jvmtiError |
2082 JvmtiEnv::ClearFieldModificationWatch(fieldDescriptor* fdesc_ptr) { | 2079 JvmtiEnv::ClearFieldModificationWatch(fieldDescriptor* fdesc_ptr) { |
2083 // make sure we have a watch to clear | 2080 // make sure we have a watch to clear |
2084 if (!fdesc_ptr->is_field_modification_watched()) return JVMTI_ERROR_NOT_FOUND; | 2081 if (!fdesc_ptr->is_field_modification_watched()) return JVMTI_ERROR_NOT_FOUND; |
2085 fdesc_ptr->set_is_field_modification_watched(false); | 2082 fdesc_ptr->set_is_field_modification_watched(false); |
2086 update_klass_field_access_flag(fdesc_ptr); | |
2087 | 2083 |
2088 JvmtiEventController::change_field_watch(JVMTI_EVENT_FIELD_MODIFICATION, false); | 2084 JvmtiEventController::change_field_watch(JVMTI_EVENT_FIELD_MODIFICATION, false); |
2089 | 2085 |
2090 return JVMTI_ERROR_NONE; | 2086 return JVMTI_ERROR_NONE; |
2091 } /* end ClearFieldModificationWatch */ | 2087 } /* end ClearFieldModificationWatch */ |