320
321 // Verify the arguments
322
323 if (CheckJNICalls) {
324 args->verify(method, result->get_type(), thread);
325 }
326 else debug_only(args->verify(method, result->get_type(), thread));
327
328 // Ignore call if method is empty
329 if (method->is_empty_method()) {
330 assert(result->get_type() == T_VOID, "an empty method must return a void value");
331 return;
332 }
333
334
335 #ifdef ASSERT
336 { InstanceKlass* holder = method->method_holder();
337 // A klass might not be initialized since JavaCall's might be used during the executing of
338 // the <clinit>. For example, a Thread.start might start executing on an object that is
339 // not fully initialized! (bad Java programming style)
340 assert(holder->is_linked(), "rewritting must have taken place");
341 }
342 #endif
343
344
345 assert(!thread->is_Compiler_thread(), "cannot compile from the compiler");
346 if (CompilationPolicy::must_be_compiled(method)) {
347 CompileBroker::compile_method(method, InvocationEntryBci,
348 CompilationPolicy::policy()->initial_compile_level(),
349 methodHandle(), 0, "must_be_compiled", CHECK);
350 }
351
352 // Since the call stub sets up like the interpreter we call the from_interpreted_entry
353 // so we can go compiled via a i2c. Otherwise initial entry method will always
354 // run interpreted.
355 address entry_point = method->from_interpreted_entry();
356 if (JvmtiExport::can_post_interpreter_events() && thread->is_interp_only_mode()) {
357 entry_point = method->interpreter_entry();
358 }
359
360 // Figure out if the result value is an oop or not (Note: This is a different value
|
320
321 // Verify the arguments
322
323 if (CheckJNICalls) {
324 args->verify(method, result->get_type(), thread);
325 }
326 else debug_only(args->verify(method, result->get_type(), thread));
327
328 // Ignore call if method is empty
329 if (method->is_empty_method()) {
330 assert(result->get_type() == T_VOID, "an empty method must return a void value");
331 return;
332 }
333
334
335 #ifdef ASSERT
336 { InstanceKlass* holder = method->method_holder();
337 // A klass might not be initialized since JavaCall's might be used during the executing of
338 // the <clinit>. For example, a Thread.start might start executing on an object that is
339 // not fully initialized! (bad Java programming style)
340 assert(holder->is_linked(), "rewriting must have taken place");
341 }
342 #endif
343
344
345 assert(!thread->is_Compiler_thread(), "cannot compile from the compiler");
346 if (CompilationPolicy::must_be_compiled(method)) {
347 CompileBroker::compile_method(method, InvocationEntryBci,
348 CompilationPolicy::policy()->initial_compile_level(),
349 methodHandle(), 0, "must_be_compiled", CHECK);
350 }
351
352 // Since the call stub sets up like the interpreter we call the from_interpreted_entry
353 // so we can go compiled via a i2c. Otherwise initial entry method will always
354 // run interpreted.
355 address entry_point = method->from_interpreted_entry();
356 if (JvmtiExport::can_post_interpreter_events() && thread->is_interp_only_mode()) {
357 entry_point = method->interpreter_entry();
358 }
359
360 // Figure out if the result value is an oop or not (Note: This is a different value
|