Mercurial > hg > truffle
comparison src/share/vm/runtime/sharedRuntime.cpp @ 9568:f64a3fec4e42
exception PC stored in thread is cleared when retrieving continuation for a return address
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 06 May 2013 12:52:22 +0200 |
parents | f491f51e96b5 |
children | 836a62f43af9 |
comparison
equal
deleted
inserted
replaced
9567:a8b4f26d8485 | 9568:f64a3fec4e42 |
---|---|
482 assert(frame::verify_return_pc(return_address), err_msg("must be a return address: " INTPTR_FORMAT, return_address)); | 482 assert(frame::verify_return_pc(return_address), err_msg("must be a return address: " INTPTR_FORMAT, return_address)); |
483 | 483 |
484 // Reset method handle flag. | 484 // Reset method handle flag. |
485 thread->set_is_method_handle_return(false); | 485 thread->set_is_method_handle_return(false); |
486 | 486 |
487 #ifdef GRAAL | |
488 // Graal's ExceptionHandlerStub expects the thread local exception PC to be clear | |
489 // and other exception handler continuations do not read it | |
490 thread->set_exception_pc(NULL); | |
491 #endif | |
492 | |
487 // The fastest case first | 493 // The fastest case first |
488 CodeBlob* blob = CodeCache::find_blob(return_address); | 494 CodeBlob* blob = CodeCache::find_blob(return_address); |
489 nmethod* nm = (blob != NULL) ? blob->as_nmethod_or_null() : NULL; | 495 nmethod* nm = (blob != NULL) ? blob->as_nmethod_or_null() : NULL; |
490 if (nm != NULL) { | 496 if (nm != NULL) { |
491 // Set flag if return address is a method handle call site. | 497 // Set flag if return address is a method handle call site. |
492 thread->set_is_method_handle_return(nm->is_method_handle_return(return_address)); | 498 thread->set_is_method_handle_return(nm->is_method_handle_return(return_address)); |
493 // native nmethods don't have exception handlers | 499 // native nmethods don't have exception handlers |
494 assert(!nm->is_native_method(), "no exception handler"); | 500 assert(!nm->is_native_method(), "no exception handler"); |
495 assert(nm->header_begin() != nm->exception_begin(), "no exception handler"); | 501 assert(nm->header_begin() != nm->exception_begin(), "no exception handler"); |
496 #ifdef GRAAL | |
497 // Graal's ExceptionHandlerStub expects the exception PC stored in the thread to be 0 | |
498 thread->set_exception_pc(NULL); | |
499 #endif | |
500 if (nm->is_deopt_pc(return_address)) { | 502 if (nm->is_deopt_pc(return_address)) { |
501 return SharedRuntime::deopt_blob()->unpack_with_exception(); | 503 return SharedRuntime::deopt_blob()->unpack_with_exception(); |
502 } else { | 504 } else { |
503 return nm->exception_begin(); | 505 return nm->exception_begin(); |
504 } | 506 } |