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
|
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, CompileTask::Reason_MustBeCompiled, 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
|