Print this page


Split Close
Expand all
Collapse all
          --- old/src/share/vm/runtime/sharedRuntime.cpp
          +++ new/src/share/vm/runtime/sharedRuntime.cpp
↓ open down ↓ 2471 lines elided ↑ open up ↑
2472 2472    }
2473 2473    return true;
2474 2474  }
2475 2475  #endif
2476 2476  
2477 2477  
2478 2478  // Create a native wrapper for this native method.  The wrapper converts the
2479 2479  // java compiled calling convention to the native convention, handlizes
2480 2480  // arguments, and transitions to native.  On return from the native we transition
2481 2481  // back to java blocking if a safepoint is in progress.
2482      -nmethod *AdapterHandlerLibrary::create_native_wrapper(methodHandle method) {
     2482 +nmethod *AdapterHandlerLibrary::create_native_wrapper(methodHandle method, int compile_id) {
2483 2483    ResourceMark rm;
2484 2484    nmethod* nm = NULL;
2485 2485  
2486      -  if (PrintCompilation) {
2487      -    ttyLocker ttyl;
2488      -    tty->print("---   n%s ", (method->is_synchronized() ? "s" : " "));
2489      -    method->print_short_name(tty);
2490      -    if (method->is_static()) {
2491      -      tty->print(" (static)");
2492      -    }
2493      -    tty->cr();
2494      -  }
2495      -
2496 2486    assert(method->has_native_function(), "must have something valid to call!");
2497 2487  
2498 2488    {
2499 2489      // perform the work while holding the lock, but perform any printing outside the lock
2500 2490      MutexLocker mu(AdapterHandlerLibrary_lock);
2501 2491      // See if somebody beat us to it
2502 2492      nm = method->code();
2503 2493      if (nm) {
2504 2494        return nm;
2505 2495      }
↓ open down ↓ 24 lines elided ↑ open up ↑
2530 2520        assert( i==total_args_passed, "" );
2531 2521        BasicType ret_type = ss.type();
2532 2522  
2533 2523        // Now get the compiled-Java layout as input arguments
2534 2524        int comp_args_on_stack;
2535 2525        comp_args_on_stack = SharedRuntime::java_calling_convention(sig_bt, regs, total_args_passed, false);
2536 2526  
2537 2527        // Generate the compiled-to-native wrapper code
2538 2528        nm = SharedRuntime::generate_native_wrapper(&_masm,
2539 2529                                                    method,
     2530 +                                                  compile_id,
2540 2531                                                    total_args_passed,
2541 2532                                                    comp_args_on_stack,
2542 2533                                                    sig_bt,regs,
2543 2534                                                    ret_type);
2544 2535      }
2545 2536    }
2546 2537  
2547 2538    // Must unlock before calling set_code
2548 2539  
2549 2540    // Install the generated code.
2550 2541    if (nm != NULL) {
     2542 +    if (PrintCompilation) {
     2543 +      ttyLocker ttyl;
     2544 +      CompileTask::print_compilation(tty, nm, method->is_static() ? "(static)" : "");
     2545 +    }
2551 2546      method->set_code(method, nm);
2552 2547      nm->post_compiled_method_load_event();
2553 2548    } else {
2554 2549      // CodeCache is full, disable compilation
2555 2550      CompileBroker::handle_full_code_cache();
2556 2551    }
2557 2552    return nm;
2558 2553  }
2559 2554  
2560 2555  #ifdef HAVE_DTRACE_H
↓ open down ↓ 260 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX