Pārlūkot izejas kodu

+ support externref and funcref WebAssembly globals in the internal object writer

Nikolay Nikolov 2 gadi atpakaļ
vecāks
revīzija
9b4366e4f6
1 mainītis faili ar 12 papildinājumiem un 0 dzēšanām
  1. 12 0
      compiler/ogwasm.pas

+ 12 - 0
compiler/ogwasm.pas

@@ -1669,6 +1669,18 @@ implementation
                           WriteByte(FWasmSections[wsiGlobal],$00);
                           WriteByte(FWasmSections[wsiGlobal],$0B);  { end }
                         end;
+                      wbt_externref:
+                        begin
+                          WriteByte(FWasmSections[wsiGlobal],$D0); { ref.null extern }
+                          WriteByte(FWasmSections[wsiGlobal],$6F);
+                          WriteByte(FWasmSections[wsiGlobal],$0B);  { end }
+                        end;
+                      wbt_funcref:
+                        begin
+                          WriteByte(FWasmSections[wsiGlobal],$D0); { ref.null func }
+                          WriteByte(FWasmSections[wsiGlobal],$70);
+                          WriteByte(FWasmSections[wsiGlobal],$0B);  { end }
+                        end;
                       else
                         internalerror(2022052801);
                     end;