* hardcode offset of the ISA field in Objective-C (meta)classes to be

0, just like gcc/clang. This results in more efficient code on
    non-fragile ABI platforms and removes a dependency of the name
    of the isa field in header translations

git-svn-id: trunk@20623 -
This commit is contained in:
Jonas Maebe 2012-03-25 12:55:18 +00:00
parent 2e3605e999
commit 284210ad48

View File

@ -221,16 +221,13 @@ implementation
expectloc:=LOC_REGISTER;
if left.nodetype<>typen then
begin
{ make sure that the isa field is loaded correctly in case
of the non-fragile ABI }
if is_objcclass(left.resultdef) and
(left.nodetype<>typen) then
begin
vs:=search_struct_member(tobjectdef(left.resultdef),'ISA');
if not assigned(vs) or
(tsym(vs).typ<>fieldvarsym) then
internalerror(2009092502);
result:=csubscriptnode.create(tfieldvarsym(vs),left);
{ don't use the ISA field name, assume this field is at offset
0 (just like gcc/clang) }
result:=ctypeconvnode.create_internal(left,voidpointertype);
result:=cderefnode.create(result);
inserttypeconv_internal(result,resultdef);
{ reused }
left:=nil;