mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 07:29:21 +02:00
pascalscript: added proc modifier vectorcall, patch #33134
git-svn-id: trunk@57289 -
This commit is contained in:
parent
43543a0cbb
commit
488478cd6e
@ -30,6 +30,7 @@ type
|
|||||||
, clPascal
|
, clPascal
|
||||||
, ClCdecl
|
, ClCdecl
|
||||||
, ClStdCall
|
, ClStdCall
|
||||||
|
, clVectorCall
|
||||||
);
|
);
|
||||||
|
|
||||||
var
|
var
|
||||||
@ -125,6 +126,7 @@ begin
|
|||||||
if FuncCC = 'CDECL' then cc := ClCdecl else
|
if FuncCC = 'CDECL' then cc := ClCdecl else
|
||||||
if FuncCC = 'REGISTER' then cc := clRegister else
|
if FuncCC = 'REGISTER' then cc := clRegister else
|
||||||
if FuncCC = 'PASCAL' then cc := clPascal else
|
if FuncCC = 'PASCAL' then cc := clPascal else
|
||||||
|
if FuncCC = 'VECTORCALL' then cc := clVectorCall else
|
||||||
begin
|
begin
|
||||||
Sender.MakeError('', ecCustomError, tbtstring(RPS_InvalidCallingConvention));
|
Sender.MakeError('', ecCustomError, tbtstring(RPS_InvalidCallingConvention));
|
||||||
Result := nil;
|
Result := nil;
|
||||||
|
@ -16,6 +16,8 @@ const
|
|||||||
|
|
||||||
CdStdCall = uPSRuntime.CdStdCall;
|
CdStdCall = uPSRuntime.CdStdCall;
|
||||||
|
|
||||||
|
cdVectorCall = uPSRuntime.cdVectorCall;
|
||||||
|
|
||||||
type
|
type
|
||||||
TPSScript = class;
|
TPSScript = class;
|
||||||
|
|
||||||
|
@ -23,6 +23,8 @@ const
|
|||||||
{alias to @link(ifps3.cdStdcall)}
|
{alias to @link(ifps3.cdStdcall)}
|
||||||
CdStdCall = uPSRuntime.CdStdCall;
|
CdStdCall = uPSRuntime.CdStdCall;
|
||||||
|
|
||||||
|
cdVectorCall = uPSRuntime.cdVectorCall;
|
||||||
|
|
||||||
type
|
type
|
||||||
{Alias to @link(ifps3.TPSCallingConvention)}
|
{Alias to @link(ifps3.TPSCallingConvention)}
|
||||||
TDelphiCallingConvention = uPSRuntime.TPSCallingConvention;
|
TDelphiCallingConvention = uPSRuntime.TPSCallingConvention;
|
||||||
|
@ -1080,6 +1080,8 @@ const
|
|||||||
|
|
||||||
cdStdCall = uPSUtils.cdStdCall;
|
cdStdCall = uPSUtils.cdStdCall;
|
||||||
|
|
||||||
|
cdVectorCall = uPSUtils.cdVectorCall;
|
||||||
|
|
||||||
InvalidVal = Cardinal(-1);
|
InvalidVal = Cardinal(-1);
|
||||||
|
|
||||||
function PSDynArrayGetLength(arr: Pointer; aType: TPSTypeRec): Longint;
|
function PSDynArrayGetLength(arr: Pointer; aType: TPSTypeRec): Longint;
|
||||||
@ -11996,6 +11998,10 @@ function DelphiFunctionProc_Safecall(Caller: TPSExec; p: TPSExternalProcRec; Glo
|
|||||||
begin
|
begin
|
||||||
Result := DelphiFunctionProc(Caller, p, Global, Stack, cdSafeCall);
|
Result := DelphiFunctionProc(Caller, p, Global, Stack, cdSafeCall);
|
||||||
end;
|
end;
|
||||||
|
function DelphiFunctionProc_Vectorcall(Caller: TPSExec; p: TPSExternalProcRec; Global, Stack: TPSStack): Boolean;
|
||||||
|
begin
|
||||||
|
Result := DelphiFunctionProc(Caller, p, Global, Stack, cdVectorCall);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TPSExec.RegisterDelphiFunction(ProcPtr: Pointer;
|
procedure TPSExec.RegisterDelphiFunction(ProcPtr: Pointer;
|
||||||
const Name: tbtString; CC: TPSCallingConvention);
|
const Name: tbtString; CC: TPSCallingConvention);
|
||||||
@ -12012,6 +12018,7 @@ begin
|
|||||||
cdStdCall: RegisterFunctionName(FastUppercase(Name), DelphiFunctionProc_Stdcall, ProcPtr, Slf);
|
cdStdCall: RegisterFunctionName(FastUppercase(Name), DelphiFunctionProc_Stdcall, ProcPtr, Slf);
|
||||||
cdSafeCall: RegisterFunctionName(FastUppercase(Name), DelphiFunctionProc_Safecall, ProcPtr, Slf);
|
cdSafeCall: RegisterFunctionName(FastUppercase(Name), DelphiFunctionProc_Safecall, ProcPtr, Slf);
|
||||||
cdCdecl: RegisterFunctionName(FastUppercase(Name), DelphiFunctionProc_CDECL, ProcPtr, Slf);
|
cdCdecl: RegisterFunctionName(FastUppercase(Name), DelphiFunctionProc_CDECL, ProcPtr, Slf);
|
||||||
|
cdVectorCall: RegisterFunctionName(FastUppercase(Name), DelphiFunctionProc_Vectorcall, ProcPtr, Slf);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -323,7 +323,7 @@ type
|
|||||||
{$ELSE}
|
{$ELSE}
|
||||||
{$IFDEF CPU64} IPointer = LongWord;{$ELSE} IPointer = Cardinal;{$ENDIF}{$ENDIF}
|
{$IFDEF CPU64} IPointer = LongWord;{$ELSE} IPointer = Cardinal;{$ENDIF}{$ENDIF}
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
TPSCallingConvention = (cdRegister, cdPascal, cdCdecl, cdStdCall, cdSafeCall);
|
TPSCallingConvention = (cdRegister, cdPascal, cdCdecl, cdStdCall, cdSafeCall, cdVectorCall);
|
||||||
|
|
||||||
|
|
||||||
const
|
const
|
||||||
|
Loading…
Reference in New Issue
Block a user