comparison src/share/vm/runtime/thread.hpp @ 609:ea20d7ce26b0

6800721: 3/4 JavaThread::jvmti_thread_state() and JvmtiThreadState::state_for() robustness Summary: Check for NULL return values from jvmti_thread_state() and state_for() and return a JVM TI error code as appropriate. Reviewed-by: coleenp, swamyv
author dcubed
date Mon, 02 Mar 2009 14:00:23 -0700
parents ad8c8ca4ab0f
children b9fba36710f2
comparison
equal deleted inserted replaced
608:0386097d43d8 609:ea20d7ce26b0
1343 void register_array_for_gc(GrowableArray<oop>* array) { _array_for_gc = array; } 1343 void register_array_for_gc(GrowableArray<oop>* array) { _array_for_gc = array; }
1344 1344
1345 public: 1345 public:
1346 // Thread local information maintained by JVMTI. 1346 // Thread local information maintained by JVMTI.
1347 void set_jvmti_thread_state(JvmtiThreadState *value) { _jvmti_thread_state = value; } 1347 void set_jvmti_thread_state(JvmtiThreadState *value) { _jvmti_thread_state = value; }
1348 // A JvmtiThreadState is lazily allocated. This jvmti_thread_state()
1349 // getter is used to get this JavaThread's JvmtiThreadState if it has
1350 // one which means NULL can be returned. JvmtiThreadState::state_for()
1351 // is used to get the specified JavaThread's JvmtiThreadState if it has
1352 // one or it allocates a new JvmtiThreadState for the JavaThread and
1353 // returns it. JvmtiThreadState::state_for() will return NULL only if
1354 // the specified JavaThread is exiting.
1348 JvmtiThreadState *jvmti_thread_state() const { return _jvmti_thread_state; } 1355 JvmtiThreadState *jvmti_thread_state() const { return _jvmti_thread_state; }
1349 static ByteSize jvmti_thread_state_offset() { return byte_offset_of(JavaThread, _jvmti_thread_state); } 1356 static ByteSize jvmti_thread_state_offset() { return byte_offset_of(JavaThread, _jvmti_thread_state); }
1350 void set_jvmti_get_loaded_classes_closure(JvmtiGetLoadedClassesClosure* value) { _jvmti_get_loaded_classes_closure = value; } 1357 void set_jvmti_get_loaded_classes_closure(JvmtiGetLoadedClassesClosure* value) { _jvmti_get_loaded_classes_closure = value; }
1351 JvmtiGetLoadedClassesClosure* get_jvmti_get_loaded_classes_closure() const { return _jvmti_get_loaded_classes_closure; } 1358 JvmtiGetLoadedClassesClosure* get_jvmti_get_loaded_classes_closure() const { return _jvmti_get_loaded_classes_closure; }
1352 1359