|
@@ -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;
|