mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 18:29:09 +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;
|
property Items[AIndex: Integer]: TWasmBasicType read GetItems write SetItems; default;
|
||||||
end;
|
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;
|
twasmstruc_stack = class;
|
||||||
TAsmMapFuncResultType = (amfrtNoChange, amfrtNewAi, amfrtNewList, amfrtDeleteAi);
|
TAsmMapFuncResultType = (amfrtNoChange, amfrtNewAi, amfrtNewList, amfrtDeleteAi);
|
||||||
TAsmMapFuncResult = record
|
TAsmMapFuncResult = record
|
||||||
@ -346,6 +374,26 @@ uses
|
|||||||
SetLength(FValStack,Length(FValStack)-1);
|
SetLength(FValStack,Length(FValStack)-1);
|
||||||
end;
|
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 }
|
{ twasmstruc_stack }
|
||||||
|
|
||||||
function twasmstruc_stack.Get(Index: Integer): taicpu_wasm_structured_instruction;
|
function twasmstruc_stack.Get(Index: Integer): taicpu_wasm_structured_instruction;
|
||||||
|
Loading…
Reference in New Issue
Block a user