mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 18:29:18 +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
|
begin
|
||||||
SectionBegin(SECT_TYPE, sc);
|
SectionBegin(SECT_TYPE, sc);
|
||||||
|
|
||||||
WriteRelocU32(m.TypesCount);
|
WriteU32(dst, m.TypesCount);
|
||||||
for i:=0 to m.TypesCount-1 do begin
|
for i:=0 to m.TypesCount-1 do begin
|
||||||
tp:=m.GetType(i);
|
tp:=m.GetType(i);
|
||||||
dst.WriteByte(func_type);
|
dst.WriteByte(func_type);
|
||||||
|
|
||||||
WriteRelocU32(tp.ParamCount);
|
WriteU32(dst, tp.ParamCount);
|
||||||
for j:=0 to tp.ParamCount-1 do
|
for j:=0 to tp.ParamCount-1 do
|
||||||
dst.WriteByte(tp.GetParam(i).tp);
|
dst.WriteByte(tp.GetParam(i).tp);
|
||||||
|
|
||||||
WriteRelocU32(tp.ResultCount);
|
WriteU32(dst, tp.ResultCount);
|
||||||
for j:=0 to tp.ResultCount-1 do
|
for j:=0 to tp.ResultCount-1 do
|
||||||
dst.WriteByte(tp.GetResult(i).tp);
|
dst.WriteByte(tp.GetResult(i).tp);
|
||||||
end;
|
end;
|
||||||
@ -221,7 +221,7 @@ var
|
|||||||
begin
|
begin
|
||||||
SectionBegin(SECT_FUNCTION, sc);
|
SectionBegin(SECT_FUNCTION, sc);
|
||||||
|
|
||||||
WriteRelocU32(m.FuncCount);
|
WriteU32(dst, m.FuncCount);
|
||||||
for i:=0 to m.FuncCount-1 do
|
for i:=0 to m.FuncCount-1 do
|
||||||
WriteRelocU32(m.GetFunc(i).functype.typeNum);
|
WriteRelocU32(m.GetFunc(i).functype.typeNum);
|
||||||
|
|
||||||
@ -235,11 +235,11 @@ var
|
|||||||
x : TWasmExport;
|
x : TWasmExport;
|
||||||
begin
|
begin
|
||||||
SectionBegin(SECT_EXPORT, sc);
|
SectionBegin(SECT_EXPORT, sc);
|
||||||
WriteRelocU32(m.ExportCount);
|
|
||||||
|
|
||||||
|
WriteU32(dst, m.ExportCount);
|
||||||
for i:=0 to m.ExportCount-1 do begin
|
for i:=0 to m.ExportCount-1 do begin
|
||||||
x:=m.GetExport(i);
|
x:=m.GetExport(i);
|
||||||
WriteRelocU32(length(x.name));
|
WriteU32(dst, length(x.name));
|
||||||
if length(x.name)>0 then
|
if length(x.name)>0 then
|
||||||
dst.Write(x.name[1], length(x.name));
|
dst.Write(x.name[1], length(x.name));
|
||||||
dst.WriteByte(x.exportType);
|
dst.WriteByte(x.exportType);
|
||||||
@ -302,7 +302,10 @@ begin
|
|||||||
dst.WriteByte(ci.code);
|
dst.WriteByte(ci.code);
|
||||||
case INST_FLAGS[ci.code].Param of
|
case INST_FLAGS[ci.code].Param of
|
||||||
ipLeb:
|
ipLeb:
|
||||||
WriteRelocU32(ci.operandNum);
|
if INST_RELOC_FLAGS[ci.code].doReloc then
|
||||||
|
WriteRelocU32(ci.operandNum)
|
||||||
|
else
|
||||||
|
WriteU32(dst, ci.operandNum);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user