pascalscript: added proc modifier vectorcall, patch #33134

git-svn-id: trunk@57289 -
This commit is contained in:
mattias 2018-02-12 14:55:38 +00:00
parent 43543a0cbb
commit 488478cd6e
5 changed files with 14 additions and 1 deletions

View File

@ -30,6 +30,7 @@ type
, clPascal
, ClCdecl
, ClStdCall
, clVectorCall
);
var
@ -125,6 +126,7 @@ begin
if FuncCC = 'CDECL' then cc := ClCdecl else
if FuncCC = 'REGISTER' then cc := clRegister else
if FuncCC = 'PASCAL' then cc := clPascal else
if FuncCC = 'VECTORCALL' then cc := clVectorCall else
begin
Sender.MakeError('', ecCustomError, tbtstring(RPS_InvalidCallingConvention));
Result := nil;

View File

@ -16,6 +16,8 @@ const
CdStdCall = uPSRuntime.CdStdCall;
cdVectorCall = uPSRuntime.cdVectorCall;
type
TPSScript = class;

View File

@ -23,6 +23,8 @@ const
{alias to @link(ifps3.cdStdcall)}
CdStdCall = uPSRuntime.CdStdCall;
cdVectorCall = uPSRuntime.cdVectorCall;
type
{Alias to @link(ifps3.TPSCallingConvention)}
TDelphiCallingConvention = uPSRuntime.TPSCallingConvention;

View File

@ -1080,6 +1080,8 @@ const
cdStdCall = uPSUtils.cdStdCall;
cdVectorCall = uPSUtils.cdVectorCall;
InvalidVal = Cardinal(-1);
function PSDynArrayGetLength(arr: Pointer; aType: TPSTypeRec): Longint;
@ -11996,6 +11998,10 @@ function DelphiFunctionProc_Safecall(Caller: TPSExec; p: TPSExternalProcRec; Glo
begin
Result := DelphiFunctionProc(Caller, p, Global, Stack, cdSafeCall);
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;
const Name: tbtString; CC: TPSCallingConvention);
@ -12012,6 +12018,7 @@ begin
cdStdCall: RegisterFunctionName(FastUppercase(Name), DelphiFunctionProc_Stdcall, ProcPtr, Slf);
cdSafeCall: RegisterFunctionName(FastUppercase(Name), DelphiFunctionProc_Safecall, ProcPtr, Slf);
cdCdecl: RegisterFunctionName(FastUppercase(Name), DelphiFunctionProc_CDECL, ProcPtr, Slf);
cdVectorCall: RegisterFunctionName(FastUppercase(Name), DelphiFunctionProc_Vectorcall, ProcPtr, Slf);
end;
end;

View File

@ -323,7 +323,7 @@ type
{$ELSE}
{$IFDEF CPU64} IPointer = LongWord;{$ELSE} IPointer = Cardinal;{$ENDIF}{$ENDIF}
{$ENDIF}
TPSCallingConvention = (cdRegister, cdPascal, cdCdecl, cdStdCall, cdSafeCall);
TPSCallingConvention = (cdRegister, cdPascal, cdCdecl, cdStdCall, cdSafeCall, cdVectorCall);
const