7022998: JSR 292 recursive method handle calls inline themselves infinitely

Reviewed-by: never, kvn
This commit is contained in:
Christian Thalinger 2011-03-28 03:58:07 -07:00
parent 36303f61b6
commit f51036e9bc
13 changed files with 203 additions and 173 deletions

View file

@ -2479,20 +2479,10 @@ bool AdapterHandlerEntry::compare_code(unsigned char* buffer, int length, int to
// java compiled calling convention to the native convention, handlizes
// arguments, and transitions to native. On return from the native we transition
// back to java blocking if a safepoint is in progress.
nmethod *AdapterHandlerLibrary::create_native_wrapper(methodHandle method) {
nmethod *AdapterHandlerLibrary::create_native_wrapper(methodHandle method, int compile_id) {
ResourceMark rm;
nmethod* nm = NULL;
if (PrintCompilation) {
ttyLocker ttyl;
tty->print("--- n%s ", (method->is_synchronized() ? "s" : " "));
method->print_short_name(tty);
if (method->is_static()) {
tty->print(" (static)");
}
tty->cr();
}
assert(method->has_native_function(), "must have something valid to call!");
{
@ -2537,6 +2527,7 @@ nmethod *AdapterHandlerLibrary::create_native_wrapper(methodHandle method) {
// Generate the compiled-to-native wrapper code
nm = SharedRuntime::generate_native_wrapper(&_masm,
method,
compile_id,
total_args_passed,
comp_args_on_stack,
sig_bt,regs,
@ -2548,6 +2539,10 @@ nmethod *AdapterHandlerLibrary::create_native_wrapper(methodHandle method) {
// Install the generated code.
if (nm != NULL) {
if (PrintCompilation) {
ttyLocker ttyl;
CompileTask::print_compilation(tty, nm, method->is_static() ? "(static)" : "");
}
method->set_code(method, nm);
nm->post_compiled_method_load_event();
} else {