dotgnu-libjit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Libjit-developers] how to access struct members?


From: ktreichel
Subject: Re: [Libjit-developers] how to access struct members?
Date: Tue, 21 Aug 2007 17:12:33 +0200

Hi Paul,

getting the address of the struct and using jit_insn_store relative is the only 
way i'm aware of how to store a value in a struct.
Of course you can cache individual members in extra values as long as the 
struct is on the stack or you don't have multiple threads accessing the struct.
Libjit doesn't do such kind of optimization like deferred writing members back 
to the struct.
Depending on the arch you are working on (like x86) there are not that many 
registers to cache all the struct members so that they won't be in registers 
anyways. 
Maybe we can optimize the access of struct members on the stack that way so 
that it's no difference if they are struct members or not (do the access 
framepointer relative).

Cheers,
Klaus

> -----Ursprüngliche Nachricht-----
> Von: Paul Brannan <address@hidden>
> Gesendet: 21.08.07 14:08:11
> An: address@hidden
> Betreff: [Libjit-developers] how to access struct members?


> 
> I have created a struct with jit_type_create_struct and I want to store
> a value in one of the members of the struct.  I can get the address of
> the struct and use jit_insn_store_relative to write to the struct, but
> this seems to occur extra overhead that I don't want.
> 
> My workaround is store store all my struct members in values and then if
> I ever need to take the address of the struct, copy all the values into
> the struct one by one.  This seems somewhat like a hack to me, though.
> 
> Is there a better way to access struct members, one that automatically
> determines whether the struct members can be stored in registers,
> depending on whether the struct is addressable?
> 
> Thanks,
> 
> Paul
> 
> _______________________________________________
> Libjit-developers mailing list
> address@hidden
> http://dotgnu.org/mailman/listinfo/libjit-developers
> 


__________________________________________________________________________
Erweitern Sie FreeMail zu einem noch leistungsstärkeren E-Mail-Postfach!        
        
Mehr Infos unter http://produkte.web.de/club/?mc=021131



reply via email to

[Prev in Thread] Current Thread [Next in Thread]