< prev index next >

src/share/vm/jvmci/jvmciEnv.cpp

Print this page




 477   char* failure_detail = NULL;
 478   JVMCIEnv::CodeInstallResult result;
 479   {
 480     // To prevent compile queue updates.
 481     MutexLocker locker(MethodCompileQueue_lock, THREAD);
 482 
 483     // Prevent SystemDictionary::add_to_hierarchy from running
 484     // and invalidating our dependencies until we install this method.
 485     MutexLocker ml(Compile_lock);
 486 
 487     // Encode the dependencies now, so we can check them right away.
 488     dependencies->encode_content_bytes();
 489 
 490     // Check for {class loads, evolution, breakpoints} during compilation
 491     result = check_for_system_dictionary_modification(dependencies, compiled_code, env, &failure_detail);
 492     if (result != JVMCIEnv::ok) {
 493       // While not a true deoptimization, it is a preemptive decompile.
 494       MethodData* mdp = method()->method_data();
 495       if (mdp != NULL) {
 496         mdp->inc_decompile_count();

 497         if (mdp->decompile_count() > (uint)PerMethodRecompilationCutoff) {
 498           // TODO (chaeubl) enable this in the fastdebug build only once we are more stable
 499           ResourceMark m;
 500           tty->print_cr("WARN: endless recompilation of %s. Method was set to not compilable.", method()->name_and_sig_as_C_string());
 501           //ShouldNotReachHere();
 502         }

 503       }
 504 
 505       // All buffers in the CodeBuffer are allocated in the CodeCache.
 506       // If the code buffer is created on each compile attempt
 507       // as in C2, then it must be freed.
 508       //code_buffer->free_blob();
 509     } else {
 510       ImplicitExceptionTable implicit_tbl;
 511       nm =  nmethod::new_nmethod(method,
 512                                  compile_id,
 513                                  entry_bci,
 514                                  offsets,
 515                                  orig_pc_offset,
 516                                  debug_info, dependencies, code_buffer,
 517                                  frame_words, oop_map_set,
 518                                  handler_table, &implicit_tbl,
 519                                  compiler, comp_level, installed_code, speculation_log);
 520 
 521       // Free codeBlobs
 522       //code_buffer->free_blob();




 477   char* failure_detail = NULL;
 478   JVMCIEnv::CodeInstallResult result;
 479   {
 480     // To prevent compile queue updates.
 481     MutexLocker locker(MethodCompileQueue_lock, THREAD);
 482 
 483     // Prevent SystemDictionary::add_to_hierarchy from running
 484     // and invalidating our dependencies until we install this method.
 485     MutexLocker ml(Compile_lock);
 486 
 487     // Encode the dependencies now, so we can check them right away.
 488     dependencies->encode_content_bytes();
 489 
 490     // Check for {class loads, evolution, breakpoints} during compilation
 491     result = check_for_system_dictionary_modification(dependencies, compiled_code, env, &failure_detail);
 492     if (result != JVMCIEnv::ok) {
 493       // While not a true deoptimization, it is a preemptive decompile.
 494       MethodData* mdp = method()->method_data();
 495       if (mdp != NULL) {
 496         mdp->inc_decompile_count();
 497 #ifdef ASSERT
 498         if (mdp->decompile_count() > (uint)PerMethodRecompilationCutoff) {

 499           ResourceMark m;
 500           tty->print_cr("WARN: endless recompilation of %s. Method was set to not compilable.", method()->name_and_sig_as_C_string());

 501         }
 502 #endif
 503       }
 504 
 505       // All buffers in the CodeBuffer are allocated in the CodeCache.
 506       // If the code buffer is created on each compile attempt
 507       // as in C2, then it must be freed.
 508       //code_buffer->free_blob();
 509     } else {
 510       ImplicitExceptionTable implicit_tbl;
 511       nm =  nmethod::new_nmethod(method,
 512                                  compile_id,
 513                                  entry_bci,
 514                                  offsets,
 515                                  orig_pc_offset,
 516                                  debug_info, dependencies, code_buffer,
 517                                  frame_words, oop_map_set,
 518                                  handler_table, &implicit_tbl,
 519                                  compiler, comp_level, installed_code, speculation_log);
 520 
 521       // Free codeBlobs
 522       //code_buffer->free_blob();


< prev index next >