comparison src/share/vm/c1/c1_Runtime1.cpp @ 5110:0ebca2e35ca5

more preparations for disabling runtime feedback selectively based on deoptimization history
author Christian Haeubl <christian.haeubl@oracle.com>
date Thu, 15 Mar 2012 15:31:34 -0700
parents 532be189cf09
children f5cfb62f17b8
comparison
equal deleted inserted replaced
5109:6766253384bf 5110:0ebca2e35ca5
167 if ( !caller_is_deopted()) { 167 if ( !caller_is_deopted()) {
168 JavaThread* thread = JavaThread::current(); 168 JavaThread* thread = JavaThread::current();
169 RegisterMap reg_map(thread, false); 169 RegisterMap reg_map(thread, false);
170 frame runtime_frame = thread->last_frame(); 170 frame runtime_frame = thread->last_frame();
171 frame caller_frame = runtime_frame.sender(&reg_map); 171 frame caller_frame = runtime_frame.sender(&reg_map);
172 Deoptimization::deoptimize_frame(thread, caller_frame.id()); 172 Deoptimization::deoptimize_frame(thread, caller_frame.id(), Deoptimization::Reason_constraint);
173 assert(caller_is_deopted(), "Must be deoptimized"); 173 assert(caller_is_deopted(), "Must be deoptimized");
174 } 174 }
175 } 175 }
176 176
177 177
432 JRT_BLOCK 432 JRT_BLOCK
433 osr_nm = counter_overflow_helper(thread, bci, method); 433 osr_nm = counter_overflow_helper(thread, bci, method);
434 if (osr_nm != NULL) { 434 if (osr_nm != NULL) {
435 RegisterMap map(thread, false); 435 RegisterMap map(thread, false);
436 frame fr = thread->last_frame().sender(&map); 436 frame fr = thread->last_frame().sender(&map);
437 Deoptimization::deoptimize_frame(thread, fr.id()); 437 Deoptimization::deoptimize_frame(thread, fr.id(), Deoptimization::Reason_constraint);
438 } 438 }
439 JRT_BLOCK_END 439 JRT_BLOCK_END
440 return NULL; 440 return NULL;
441 JRT_END 441 JRT_END
442 442
503 frame caller_frame = stub_frame.sender(&reg_map); 503 frame caller_frame = stub_frame.sender(&reg_map);
504 504
505 // We don't really want to deoptimize the nmethod itself since we 505 // We don't really want to deoptimize the nmethod itself since we
506 // can actually continue in the exception handler ourselves but I 506 // can actually continue in the exception handler ourselves but I
507 // don't see an easy way to have the desired effect. 507 // don't see an easy way to have the desired effect.
508 Deoptimization::deoptimize_frame(thread, caller_frame.id()); 508 Deoptimization::deoptimize_frame(thread, caller_frame.id(), Deoptimization::Reason_constraint);
509 assert(caller_is_deopted(), "Must be deoptimized"); 509 assert(caller_is_deopted(), "Must be deoptimized");
510 510
511 return SharedRuntime::deopt_blob()->unpack_with_exception_in_tls(); 511 return SharedRuntime::deopt_blob()->unpack_with_exception_in_tls();
512 } 512 }
513 513
761 761
762 // We are coming from a compiled method; check this is true. 762 // We are coming from a compiled method; check this is true.
763 assert(CodeCache::find_nmethod(caller_frame.pc()) != NULL, "sanity"); 763 assert(CodeCache::find_nmethod(caller_frame.pc()) != NULL, "sanity");
764 764
765 // Deoptimize the caller frame. 765 // Deoptimize the caller frame.
766 Deoptimization::deoptimize_frame(thread, caller_frame.id()); 766 Deoptimization::deoptimize_frame(thread, caller_frame.id(), Deoptimization::Reason_constraint);
767 767
768 // Return to the now deoptimized frame. 768 // Return to the now deoptimized frame.
769 JRT_END 769 JRT_END
770 770
771 771
973 nmethod* nm = CodeCache::find_nmethod(caller_frame.pc()); 973 nmethod* nm = CodeCache::find_nmethod(caller_frame.pc());
974 if (nm != NULL) { 974 if (nm != NULL) {
975 nm->make_not_entrant(); 975 nm->make_not_entrant();
976 } 976 }
977 977
978 Deoptimization::deoptimize_frame(thread, caller_frame.id()); 978 Deoptimization::deoptimize_frame(thread, caller_frame.id(), Deoptimization::Reason_constraint);
979 979
980 // Return to the now deoptimized frame. 980 // Return to the now deoptimized frame.
981 } 981 }
982 982
983 // If we are patching in a non-perm oop, make sure the nmethod 983 // If we are patching in a non-perm oop, make sure the nmethod