< prev index next >

src/share/vm/runtime/javaCalls.cpp

Print this page




 326 #if INCLUDE_JVMCI
 327   }
 328 #else
 329 
 330   // Ignore call if method is empty
 331   if (method->is_empty_method()) {
 332     assert(result->get_type() == T_VOID, "an empty method must return a void value");
 333     return;
 334   }
 335 #endif
 336 
 337 #ifdef ASSERT
 338   { InstanceKlass* holder = method->method_holder();
 339     // A klass might not be initialized since JavaCall's might be used during the executing of
 340     // the <clinit>. For example, a Thread.start might start executing on an object that is
 341     // not fully initialized! (bad Java programming style)
 342     assert(holder->is_linked(), "rewriting must have taken place");
 343   }
 344 #endif
 345 
 346 
 347   assert(thread->can_call_java(), "cannot compile from the native compiler");
 348   if (CompilationPolicy::must_be_compiled(method)) {
 349     CompileBroker::compile_method(method, InvocationEntryBci,
 350                                   CompilationPolicy::policy()->initial_compile_level(),
 351                                   methodHandle(), 0, "must_be_compiled", CHECK);
 352   }
 353 
 354   // Since the call stub sets up like the interpreter we call the from_interpreted_entry
 355   // so we can go compiled via a i2c. Otherwise initial entry method will always
 356   // run interpreted.
 357   address entry_point = method->from_interpreted_entry();
 358   if (JvmtiExport::can_post_interpreter_events() && thread->is_interp_only_mode()) {
 359     entry_point = method->interpreter_entry();
 360   }
 361 
 362   // Figure out if the result value is an oop or not (Note: This is a different value
 363   // than result_type. result_type will be T_INT of oops. (it is about size)
 364   BasicType result_type = runtime_type_from(result);
 365   bool oop_result_flag = (result->get_type() == T_OBJECT || result->get_type() == T_ARRAY);
 366 
 367   // NOTE: if we move the computation of the result_val_address inside
 368   // the call to call_stub, the optimizer produces wrong code.
 369   intptr_t* result_val_address = (intptr_t*)(result->get_value_addr());
 370 
 371   // Find receiver
 372   Handle receiver = (!method->is_static()) ? args->receiver() : Handle();




 326 #if INCLUDE_JVMCI
 327   }
 328 #else
 329 
 330   // Ignore call if method is empty
 331   if (method->is_empty_method()) {
 332     assert(result->get_type() == T_VOID, "an empty method must return a void value");
 333     return;
 334   }
 335 #endif
 336 
 337 #ifdef ASSERT
 338   { InstanceKlass* holder = method->method_holder();
 339     // A klass might not be initialized since JavaCall's might be used during the executing of
 340     // the <clinit>. For example, a Thread.start might start executing on an object that is
 341     // not fully initialized! (bad Java programming style)
 342     assert(holder->is_linked(), "rewriting must have taken place");
 343   }
 344 #endif
 345 
 346   CompilationPolicy::compile_if_required(method, CHECK);






 347 
 348   // Since the call stub sets up like the interpreter we call the from_interpreted_entry
 349   // so we can go compiled via a i2c. Otherwise initial entry method will always
 350   // run interpreted.
 351   address entry_point = method->from_interpreted_entry();
 352   if (JvmtiExport::can_post_interpreter_events() && thread->is_interp_only_mode()) {
 353     entry_point = method->interpreter_entry();
 354   }
 355 
 356   // Figure out if the result value is an oop or not (Note: This is a different value
 357   // than result_type. result_type will be T_INT of oops. (it is about size)
 358   BasicType result_type = runtime_type_from(result);
 359   bool oop_result_flag = (result->get_type() == T_OBJECT || result->get_type() == T_ARRAY);
 360 
 361   // NOTE: if we move the computation of the result_val_address inside
 362   // the call to call_stub, the optimizer produces wrong code.
 363   intptr_t* result_val_address = (intptr_t*)(result->get_value_addr());
 364 
 365   // Find receiver
 366   Handle receiver = (!method->is_static()) ? args->receiver() : Handle();


< prev index next >