This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: java exception


Thank you very much! But since gen_reg_rtx doesn't generate rtx for a specific register, how can the unwind functions know which register to store the reference to _Unwind_RaiseException?

cheers
yang

At 15:31 24/06/2005 -0400, you wrote:
Yang Chang wrote:

I am trying to understand the GCJ implementation of Java exception mechanism. Currently, I am aware of that the GCJ compiler uses the return value of a "gen_reg_rtx(ptr_mode);" (in function "get_exception_pointer") to represent something which holds a reference to an _Unwind_Exception struct and such a reference is passed to function _Unwind_RaiseException in libjava. However, I couldn't figure out how the two things map each other. I mean, how the _Unwind_RaiseException or some other lower level functions assign the aforementioned reference to what that rtx represents? and what that rtx really represents?


The code you are looking at is used when generating an exception _handler_. When the unwind mechanism gives control to the handler, the exception object that was thrown needs to be passed to it somehow. get_exception_pointer yields an RTL expression (in this case a REG, ie a register) where a pointer to the _Unwind_Exception will be found. The _Unwind_Exception will be put in that register by the unwinder before it jumps into the handler. You'll want to look in gcc/unwind* and libjava/exception.cc for the code for the unwinder itself.

Bryce


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]