mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-19 23:39:31 +02:00
+ added TWasmControlStack and frame. Not used, yet. Will be used in the future
for WebAssembly stack tracking and validation.
This commit is contained in:
parent
e0a5d07e37
commit
fadf43a33b
@ -55,6 +55,34 @@ uses
|
||||
property Items[AIndex: Integer]: TWasmBasicType read GetItems write SetItems; default;
|
||||
end;
|
||||
|
||||
{ TWasmControlFrame }
|
||||
|
||||
TWasmControlFrame = class
|
||||
opcode: tasmop;
|
||||
start_types: array of TWasmBasicType;
|
||||
end_types: array of TWasmBasicType;
|
||||
height: Integer;
|
||||
unreachable: Boolean;
|
||||
end;
|
||||
|
||||
{ TWasmControlStack }
|
||||
|
||||
TWasmControlStack = class
|
||||
end;
|
||||
|
||||
{ TWasmValidationStacks }
|
||||
|
||||
TWasmValidationStacks = class
|
||||
private
|
||||
FValueStack: TWasmValueStack;
|
||||
FCtrlStack: TWasmControlStack;
|
||||
public
|
||||
constructor Create;
|
||||
destructor Destroy; override;
|
||||
|
||||
procedure PushVal(vt: TWasmBasicType);
|
||||
end;
|
||||
|
||||
twasmstruc_stack = class;
|
||||
TAsmMapFuncResultType = (amfrtNoChange, amfrtNewAi, amfrtNewList, amfrtDeleteAi);
|
||||
TAsmMapFuncResult = record
|
||||
@ -346,6 +374,26 @@ uses
|
||||
SetLength(FValStack,Length(FValStack)-1);
|
||||
end;
|
||||
|
||||
{ TWasmValidationStacks }
|
||||
|
||||
constructor TWasmValidationStacks.Create;
|
||||
begin
|
||||
FValueStack:=TWasmValueStack.Create;
|
||||
FCtrlStack:=TWasmControlStack.Create;
|
||||
end;
|
||||
|
||||
destructor TWasmValidationStacks.Destroy;
|
||||
begin
|
||||
FValueStack.Free;
|
||||
FCtrlStack.Free;
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
procedure TWasmValidationStacks.PushVal(vt: TWasmBasicType);
|
||||
begin
|
||||
FValueStack.Push(vt);
|
||||
end;
|
||||
|
||||
{ twasmstruc_stack }
|
||||
|
||||
function twasmstruc_stack.Get(Index: Integer): taicpu_wasm_structured_instruction;
|
||||
|
Loading…
Reference in New Issue
Block a user