Mercurial > hg > truffle
comparison src/share/vm/c1/c1_Runtime1.cpp @ 20453:be56d800c946
8054224: Recursive method that was compiled by C1 is unable to catch StackOverflowError
Summary: do not update exception cache if exception is replaced when thrown
Reviewed-by: kvn, iveresov
author | roland |
---|---|
date | Mon, 11 Aug 2014 15:09:04 +0200 |
parents | 2c6ef90f030a |
children | 7848fc12602b |
comparison
equal
deleted
inserted
replaced
20452:f8afcfbdbf1c | 20453:be56d800c946 |
---|---|
542 // exception handler can cause class loading, which might throw an | 542 // exception handler can cause class loading, which might throw an |
543 // exception and those fields are expected to be clear during | 543 // exception and those fields are expected to be clear during |
544 // normal bytecode execution. | 544 // normal bytecode execution. |
545 thread->clear_exception_oop_and_pc(); | 545 thread->clear_exception_oop_and_pc(); |
546 | 546 |
547 Handle original_exception(thread, exception()); | |
548 | |
547 continuation = SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, false, false); | 549 continuation = SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, false, false); |
548 // If an exception was thrown during exception dispatch, the exception oop may have changed | 550 // If an exception was thrown during exception dispatch, the exception oop may have changed |
549 thread->set_exception_oop(exception()); | 551 thread->set_exception_oop(exception()); |
550 thread->set_exception_pc(pc); | 552 thread->set_exception_pc(pc); |
551 | 553 |
552 // the exception cache is used only by non-implicit exceptions | 554 // the exception cache is used only by non-implicit exceptions |
553 if (continuation != NULL) { | 555 // Update the exception cache only when there didn't happen |
556 // another exception during the computation of the compiled | |
557 // exception handler. | |
558 if (continuation != NULL && original_exception() == exception()) { | |
554 nm->add_handler_for_exception_and_pc(exception, pc, continuation); | 559 nm->add_handler_for_exception_and_pc(exception, pc, continuation); |
555 } | 560 } |
556 } | 561 } |
557 | 562 |
558 thread->set_vm_result(exception()); | 563 thread->set_vm_result(exception()); |