* fpc_ansistring_decr improved

git-svn-id: trunk@2629 -
This commit is contained in:
florian 2006-02-19 14:38:06 +00:00
parent e2e51d6757
commit 0d61229d63

View File

@ -1151,44 +1151,38 @@ function fpc_freemem_x(p:pointer):ptrint; [external name 'FPC_FREEMEM_X'];
Procedure fpc_AnsiStr_Decr_Ref (Var S : Pointer); [Public,Alias:'FPC_ANSISTR_DECR_REF']; compilerproc; nostackframe; assembler; Procedure fpc_AnsiStr_Decr_Ref (Var S : Pointer); [Public,Alias:'FPC_ANSISTR_DECR_REF']; compilerproc; nostackframe; assembler;
asm asm
cmpl $0,(%eax) cmpl $0,(%eax)
jne .Ldecr_ref_continue jne .Ldecr_ref_continue
ret ret
.Ldecr_ref_continue: .Ldecr_ref_continue:
// Temps allocated between ebp-24 and ebp+0 // Temps allocated between ebp-24 and ebp+0
subl $4,%esp subl $4,%esp
// Var S located in register // Var S located in register
// Var l located in register // Var l located in register
movl %eax,(%esp) movl %eax,(%esp)
.Lj3599:
// [101] l:=@PAnsiRec(S-FirstOff)^.Ref; // [101] l:=@PAnsiRec(S-FirstOff)^.Ref;
movl (%esp),%edx movl (%eax),%edx
movl (%edx),%edx
subl $8,%edx subl $8,%edx
// [102] If l^<0 then exit; // [102] If l^<0 then exit;
movl (%edx),%eax cmpl $0,(%edx)
testl %eax,%eax
jl .Lj3596 jl .Lj3596
.Lj3603: .Lj3603:
// [104] If declocked(l^) then // [104] If declocked(l^) then
movb ismultithread,%al cmpb $0,ismultithread
testb %al,%al jne .Lj3610
jne .Lj3610
decl (%edx) decl (%edx)
je .Lj3620 je .Lj3620
addl $4,%esp addl $4,%esp
ret ret
.Lj3610: .Lj3610:
movl %edx,%eax movl %edx,%eax
call cpudeclocked call cpudeclocked
movb %al,%cl movb %al,%al
.Lj3613: je .Lj3605
testb %cl,%cl
je .Lj3605
.Lj3620: .Lj3620:
movl (%esp),%eax movl (%esp),%eax
movl (%eax),%eax movl (%eax),%eax
subl $8,%eax subl $8,%eax
call FPC_FREEMEM_X call FPC_FREEMEM_X
movl (%esp),%eax movl (%esp),%eax
movl $0,(%eax) movl $0,(%eax)
@ -1196,7 +1190,7 @@ asm
.Lj3605: .Lj3605:
.Lj3596: .Lj3596:
// [107] end; // [107] end;
addl $4,%esp addl $4,%esp
end; end;
function fpc_truely_ansistr_unique(Var S : Pointer): Pointer; forward; function fpc_truely_ansistr_unique(Var S : Pointer): Pointer; forward;