< prev index next >

src/share/vm/jfr/jni/jfrJavaSupport.cpp

Print this page
rev 9060 : 8216064: -XX:StartFlightRecording:settings= doesn't work properly
Reviewed-by: mgronlun


 149   assert(klass->is_initialized(), "invariant");
 150 
 151   Klass* const ak = klass->array_klass(THREAD);
 152   ObjArrayKlass::cast(ak)->initialize(THREAD);
 153   HandleMark hm(THREAD);
 154   objArrayOop arr = ObjArrayKlass::cast(ak)->allocate(array_length, CHECK);
 155   result->set_jobject((jobject)arr);
 156 }
 157 
 158 static void create_object(JfrJavaArguments* args, JavaValue* result, TRAPS) {
 159   assert(args != NULL, "invariant");
 160   assert(result != NULL, "invariant");
 161   assert(result->get_type() == T_OBJECT, "invariant");
 162   DEBUG_ONLY(JfrJavaSupport::check_java_thread_in_vm(THREAD));
 163 
 164   InstanceKlass* const klass = static_cast<InstanceKlass*>(args->klass());
 165   klass->initialize(CHECK);
 166 
 167   const int array_length = args->array_length();
 168 
 169   if (array_length > 0) {
 170     array_construction(args, result, klass, array_length, CHECK);
 171   } else {
 172     object_construction(args, result, klass, THREAD);
 173   }
 174 }
 175 
 176 static void handle_result(JavaValue* result, bool global_ref, Thread* t) {
 177   assert(result != NULL, "invariant");
 178   DEBUG_ONLY(JfrJavaSupport::check_java_thread_in_vm(t));
 179   const oop result_oop = (const oop)result->get_jobject();
 180   if (result_oop == NULL) {
 181     return;
 182   }
 183   result->set_jobject(global_ref ?
 184                       JfrJavaSupport::global_jni_handle(result_oop, t) :
 185                       JfrJavaSupport::local_jni_handle(result_oop, t));
 186 }
 187 
 188 void JfrJavaSupport::new_object(JfrJavaArguments* args, TRAPS) {
 189   assert(args != NULL, "invariant");




 149   assert(klass->is_initialized(), "invariant");
 150 
 151   Klass* const ak = klass->array_klass(THREAD);
 152   ObjArrayKlass::cast(ak)->initialize(THREAD);
 153   HandleMark hm(THREAD);
 154   objArrayOop arr = ObjArrayKlass::cast(ak)->allocate(array_length, CHECK);
 155   result->set_jobject((jobject)arr);
 156 }
 157 
 158 static void create_object(JfrJavaArguments* args, JavaValue* result, TRAPS) {
 159   assert(args != NULL, "invariant");
 160   assert(result != NULL, "invariant");
 161   assert(result->get_type() == T_OBJECT, "invariant");
 162   DEBUG_ONLY(JfrJavaSupport::check_java_thread_in_vm(THREAD));
 163 
 164   InstanceKlass* const klass = static_cast<InstanceKlass*>(args->klass());
 165   klass->initialize(CHECK);
 166 
 167   const int array_length = args->array_length();
 168 
 169   if (array_length >= 0) {
 170     array_construction(args, result, klass, array_length, CHECK);
 171   } else {
 172     object_construction(args, result, klass, THREAD);
 173   }
 174 }
 175 
 176 static void handle_result(JavaValue* result, bool global_ref, Thread* t) {
 177   assert(result != NULL, "invariant");
 178   DEBUG_ONLY(JfrJavaSupport::check_java_thread_in_vm(t));
 179   const oop result_oop = (const oop)result->get_jobject();
 180   if (result_oop == NULL) {
 181     return;
 182   }
 183   result->set_jobject(global_ref ?
 184                       JfrJavaSupport::global_jni_handle(result_oop, t) :
 185                       JfrJavaSupport::local_jni_handle(result_oop, t));
 186 }
 187 
 188 void JfrJavaSupport::new_object(JfrJavaArguments* args, TRAPS) {
 189   assert(args != NULL, "invariant");


< prev index next >