< prev index next >

src/hotspot/share/runtime/javaCalls.cpp

Print this page
rev 55090 : secret-sfac


 287 void JavaCalls::call_static(JavaValue* result, Klass* klass, Symbol* name, Symbol* signature, Handle arg1, Handle arg2, TRAPS) {
 288   JavaCallArguments args;
 289   args.push_oop(arg1);
 290   args.push_oop(arg2);
 291   call_static(result, klass, name, signature, &args, CHECK);
 292 }
 293 
 294 
 295 void JavaCalls::call_static(JavaValue* result, Klass* klass, Symbol* name, Symbol* signature, Handle arg1, Handle arg2, Handle arg3, TRAPS) {
 296   JavaCallArguments args;
 297   args.push_oop(arg1);
 298   args.push_oop(arg2);
 299   args.push_oop(arg3);
 300   call_static(result, klass, name, signature, &args, CHECK);
 301 }
 302 
 303 // ============ allocate and initialize new object instance ============
 304 
 305 Handle JavaCalls::construct_new_instance(InstanceKlass* klass, Symbol* constructor_signature, JavaCallArguments* args, TRAPS) {
 306   klass->initialize(CHECK_NH); // Quick no-op if already initialized.













 307   Handle obj = klass->allocate_instance_handle(CHECK_NH);
 308   JavaValue void_result(T_VOID);
 309   args->set_receiver(obj); // inserts <obj> as the first argument.
 310   JavaCalls::call_special(&void_result, klass,
 311                           vmSymbols::object_initializer_name(),
 312                           constructor_signature, args, CHECK_NH);
 313   // Already returned a Null Handle if any exception is pending.
 314   return obj;
 315 }
 316 
 317 Handle JavaCalls::construct_new_instance(InstanceKlass* klass, Symbol* constructor_signature, TRAPS) {
 318   JavaCallArguments args;
 319   return JavaCalls::construct_new_instance(klass, constructor_signature, &args, THREAD);
 320 }
 321 
 322 Handle JavaCalls::construct_new_instance(InstanceKlass* klass, Symbol* constructor_signature, Handle arg1, TRAPS) {
 323   JavaCallArguments args;
 324   args.push_oop(arg1);
 325   return JavaCalls::construct_new_instance(klass, constructor_signature, &args, THREAD);
 326 }




 287 void JavaCalls::call_static(JavaValue* result, Klass* klass, Symbol* name, Symbol* signature, Handle arg1, Handle arg2, TRAPS) {
 288   JavaCallArguments args;
 289   args.push_oop(arg1);
 290   args.push_oop(arg2);
 291   call_static(result, klass, name, signature, &args, CHECK);
 292 }
 293 
 294 
 295 void JavaCalls::call_static(JavaValue* result, Klass* klass, Symbol* name, Symbol* signature, Handle arg1, Handle arg2, Handle arg3, TRAPS) {
 296   JavaCallArguments args;
 297   args.push_oop(arg1);
 298   args.push_oop(arg2);
 299   args.push_oop(arg3);
 300   call_static(result, klass, name, signature, &args, CHECK);
 301 }
 302 
 303 // ============ allocate and initialize new object instance ============
 304 
 305 Handle JavaCalls::construct_new_instance(InstanceKlass* klass, Symbol* constructor_signature, JavaCallArguments* args, TRAPS) {
 306   klass->initialize(CHECK_NH); // Quick no-op if already initialized.
 307 
 308   // Special case for factory methods
 309   if (!constructor_signature->is_void_method_signature()) {
 310     assert(klass->is_value(), "inline classes must use factory methods");
 311     JavaValue factory_result(T_OBJECT);
 312     JavaCalls::call_static(&factory_result, klass,
 313                            vmSymbols::object_initializer_name(),
 314                            constructor_signature, args, CHECK_NH);
 315     return Handle(THREAD, (oop)factory_result.get_jobject());
 316   }
 317 
 318   // main branch of code creates a non-inline object:
 319   assert(!klass->is_value(), "classic constructors are only for non-inline classes");
 320   Handle obj = klass->allocate_instance_handle(CHECK_NH);
 321   JavaValue void_result(T_VOID);
 322   args->set_receiver(obj); // inserts <obj> as the first argument.
 323   JavaCalls::call_special(&void_result, klass,
 324                           vmSymbols::object_initializer_name(),
 325                           constructor_signature, args, CHECK_NH);
 326   // Already returned a Null Handle if any exception is pending.
 327   return obj;
 328 }
 329 
 330 Handle JavaCalls::construct_new_instance(InstanceKlass* klass, Symbol* constructor_signature, TRAPS) {
 331   JavaCallArguments args;
 332   return JavaCalls::construct_new_instance(klass, constructor_signature, &args, THREAD);
 333 }
 334 
 335 Handle JavaCalls::construct_new_instance(InstanceKlass* klass, Symbol* constructor_signature, Handle arg1, TRAPS) {
 336   JavaCallArguments args;
 337   args.push_oop(arg1);
 338   return JavaCalls::construct_new_instance(klass, constructor_signature, &args, THREAD);
 339 }


< prev index next >