mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 21:51:42 +02:00
[PATCH 051/188] using less forced LEB128
From 9ae4184756f39beaddaf8907fff94749752b596e Mon Sep 17 00:00:00 2001 From: Dmitry Boyarintsev <skalogryz.lists@gmail.com> Date: Fri, 22 Nov 2019 16:32:12 -0500 git-svn-id: branches/wasm@46047 -
This commit is contained in:
parent
7aff2dd6ec
commit
58e99089c1
@ -198,16 +198,16 @@ var
|
||||
begin
|
||||
SectionBegin(SECT_TYPE, sc);
|
||||
|
||||
WriteRelocU32(m.TypesCount);
|
||||
WriteU32(dst, m.TypesCount);
|
||||
for i:=0 to m.TypesCount-1 do begin
|
||||
tp:=m.GetType(i);
|
||||
dst.WriteByte(func_type);
|
||||
|
||||
WriteRelocU32(tp.ParamCount);
|
||||
WriteU32(dst, tp.ParamCount);
|
||||
for j:=0 to tp.ParamCount-1 do
|
||||
dst.WriteByte(tp.GetParam(i).tp);
|
||||
|
||||
WriteRelocU32(tp.ResultCount);
|
||||
WriteU32(dst, tp.ResultCount);
|
||||
for j:=0 to tp.ResultCount-1 do
|
||||
dst.WriteByte(tp.GetResult(i).tp);
|
||||
end;
|
||||
@ -221,7 +221,7 @@ var
|
||||
begin
|
||||
SectionBegin(SECT_FUNCTION, sc);
|
||||
|
||||
WriteRelocU32(m.FuncCount);
|
||||
WriteU32(dst, m.FuncCount);
|
||||
for i:=0 to m.FuncCount-1 do
|
||||
WriteRelocU32(m.GetFunc(i).functype.typeNum);
|
||||
|
||||
@ -235,11 +235,11 @@ var
|
||||
x : TWasmExport;
|
||||
begin
|
||||
SectionBegin(SECT_EXPORT, sc);
|
||||
WriteRelocU32(m.ExportCount);
|
||||
|
||||
WriteU32(dst, m.ExportCount);
|
||||
for i:=0 to m.ExportCount-1 do begin
|
||||
x:=m.GetExport(i);
|
||||
WriteRelocU32(length(x.name));
|
||||
WriteU32(dst, length(x.name));
|
||||
if length(x.name)>0 then
|
||||
dst.Write(x.name[1], length(x.name));
|
||||
dst.WriteByte(x.exportType);
|
||||
@ -302,7 +302,10 @@ begin
|
||||
dst.WriteByte(ci.code);
|
||||
case INST_FLAGS[ci.code].Param of
|
||||
ipLeb:
|
||||
WriteRelocU32(ci.operandNum);
|
||||
if INST_RELOC_FLAGS[ci.code].doReloc then
|
||||
WriteRelocU32(ci.operandNum)
|
||||
else
|
||||
WriteU32(dst, ci.operandNum);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user