comparison src/share/vm/c1/c1_Runtime1.cpp @ 13188:6b2d8d20ecbd

deoptimization: add helper to minimize hsx diff #resolve GRAAL-531
author Bernhard Urban <bernhard.urban@jku.at>
date Thu, 28 Nov 2013 14:12:31 +0100
parents 096c224171c4
children b51e29501f30 52b4284cb496
comparison
equal deleted inserted replaced
13187:b199147f187e 13188:6b2d8d20ecbd
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(), Deoptimization::Reason_constraint); 172 Deoptimization::deoptimize_frame(thread, caller_frame.id());
173 assert(caller_is_deopted(), "Must be deoptimized"); 173 assert(caller_is_deopted(), "Must be deoptimized");
174 } 174 }
175 } 175 }
176 176
177 177
429 JRT_BLOCK 429 JRT_BLOCK
430 osr_nm = counter_overflow_helper(thread, bci, method); 430 osr_nm = counter_overflow_helper(thread, bci, method);
431 if (osr_nm != NULL) { 431 if (osr_nm != NULL) {
432 RegisterMap map(thread, false); 432 RegisterMap map(thread, false);
433 frame fr = thread->last_frame().sender(&map); 433 frame fr = thread->last_frame().sender(&map);
434 Deoptimization::deoptimize_frame(thread, fr.id(), Deoptimization::Reason_constraint); 434 Deoptimization::deoptimize_frame(thread, fr.id());
435 } 435 }
436 JRT_BLOCK_END 436 JRT_BLOCK_END
437 return NULL; 437 return NULL;
438 JRT_END 438 JRT_END
439 439
500 frame caller_frame = stub_frame.sender(&reg_map); 500 frame caller_frame = stub_frame.sender(&reg_map);
501 501
502 // We don't really want to deoptimize the nmethod itself since we 502 // We don't really want to deoptimize the nmethod itself since we
503 // can actually continue in the exception handler ourselves but I 503 // can actually continue in the exception handler ourselves but I
504 // don't see an easy way to have the desired effect. 504 // don't see an easy way to have the desired effect.
505 Deoptimization::deoptimize_frame(thread, caller_frame.id(), Deoptimization::Reason_constraint); 505 Deoptimization::deoptimize_frame(thread, caller_frame.id());
506 assert(caller_is_deopted(), "Must be deoptimized"); 506 assert(caller_is_deopted(), "Must be deoptimized");
507 507
508 return SharedRuntime::deopt_blob()->unpack_with_exception_in_tls(); 508 return SharedRuntime::deopt_blob()->unpack_with_exception_in_tls();
509 } 509 }
510 510
694 694
695 // We are coming from a compiled method; check this is true. 695 // We are coming from a compiled method; check this is true.
696 assert(CodeCache::find_nmethod(caller_frame.pc()) != NULL, "sanity"); 696 assert(CodeCache::find_nmethod(caller_frame.pc()) != NULL, "sanity");
697 697
698 // Deoptimize the caller frame. 698 // Deoptimize the caller frame.
699 Deoptimization::deoptimize_frame(thread, caller_frame.id(), Deoptimization::Reason_constraint); 699 Deoptimization::deoptimize_frame(thread, caller_frame.id());
700 700
701 // Return to the now deoptimized frame. 701 // Return to the now deoptimized frame.
702 JRT_END 702 JRT_END
703 703
704 704
930 nmethod* nm = CodeCache::find_nmethod(caller_frame.pc()); 930 nmethod* nm = CodeCache::find_nmethod(caller_frame.pc());
931 if (nm != NULL) { 931 if (nm != NULL) {
932 nm->make_not_entrant(); 932 nm->make_not_entrant();
933 } 933 }
934 934
935 Deoptimization::deoptimize_frame(thread, caller_frame.id(), Deoptimization::Reason_constraint); 935 Deoptimization::deoptimize_frame(thread, caller_frame.id());
936 936
937 // Return to the now deoptimized frame. 937 // Return to the now deoptimized frame.
938 } 938 }
939 939
940 // Now copy code back 940 // Now copy code back
1432 m->print_short_name(&ss2); 1432 m->print_short_name(&ss2);
1433 tty->print_cr("Predicate failed trap in method %s at bci %d inlined in %s at pc %x", ss1.as_string(), vfst.bci(), ss2.as_string(), caller_frame.pc()); 1433 tty->print_cr("Predicate failed trap in method %s at bci %d inlined in %s at pc %x", ss1.as_string(), vfst.bci(), ss2.as_string(), caller_frame.pc());
1434 } 1434 }
1435 1435
1436 1436
1437 Deoptimization::deoptimize_frame(thread, caller_frame.id(), Deoptimization::Reason_none); 1437 Deoptimization::deoptimize_frame(thread, caller_frame.id());
1438 1438
1439 JRT_END 1439 JRT_END
1440 1440
1441 #ifndef PRODUCT 1441 #ifndef PRODUCT
1442 void Runtime1::print_statistics() { 1442 void Runtime1::print_statistics() {