[LLVMdev] Exception handling in JIT

Evan Cheng evan.cheng at apple.com
Wed Dec 12 16:48:45 PST 2007


On Dec 12, 2007, at 3:51 AM, Nicolas Geoffray wrote:

> Hi Evan,
>
> My apologies: I've been so excited on sharing the functionality that I
> forgot to review my patch!

No problem.

>
> Evan Cheng wrote:
>> On Dec 10, 2007, at 9:52 AM, Nicolas Geoffray wrote:
>>
>>
>>> Hi everyone,
>>>
>>> Here's a patch that enables exception handling when jitting. I've
>>> copy/pasted _many_code from lib/Codegen/DwarfWriter.cpp, so we may
>>> need
>>> to factorize it, but the functionality is there and I'm very happy
>>> with
>>> it :)
>>>
>>
>> Very nice! I don't know enough about EH, someone else please review.
>>
>> It does look like it's in need of some refactoring. How much work  
>> is it?
>>
>>
>
> Anton or Duncan may know how much work it should be. DwarfWriter  
> writes
> on a file and only knows about label names, not label addresses.  
> IMO the
> refactoring is non-trivial.
>
>>>
>> I am not sure if it makes sense for this to maintain it's own
>> buffers. Can it be modified to use MachineCodeEmitter?
>>
>>
>
> You mean DwarfEmitter inherits MachineCodeEmitter? There are
> MachineCodeEmitter functions that are really not related to
> MachineCodeEmitter (eg addRelocation, getConstantPoolEntryAddress,  
> etc).

How about just passing it a ptr to a MachineCodeEmitter object?

>
> Again, I've sent you the patch too fast. These functions are taken  
> from
> the g++ unwinder library (libgcc_s.so). Declaring them like I did is
> really bad. I'm thinking of something like:
>
> typedef void function_register_t(void*)
> ExecutionEngine::registerFrameRegisteringFunction(function_register_t)
>
> What do you think?

Ok.

Evan



More information about the llvm-dev mailing list