Description: webasm rtl.

This file as text.
(active) Revisions in this set:
33e25a3dfed57b58ba8576e846e63779e8d6c9a0,73bc8edef3ad66e208cfb30fd0df3e13f3b9fbdf,91f0f1a86c293dbf972ed684ff196244f5292af4
3836b0be04762387513cd7f6b95246cd5fc5e295,02745b0b83f9ea4e1fc98a44f753d513dfebfe62,77ca8ba16d0a5ab9aa1b261b4d1b44c94a1aa2b3
30b503abc4e628dc3c2299595ee76dba48d308fc,d9eb8d75b9f6005cc36f66da635c46f3d4aad250,387c80cc57b691c887303cc224ee01dd46684a0d
d134fc1ddfb6158945bc1751e0d2df1657f89a64,7533496505e52d2df2fa7bb3291c23adb91046c7,e078408dcf76a282a7336afeb5476c75779817cd
d45915b6ba0f99a70c51243377471bd834a5f541,bae50d80d246622a958d57c8dc70c3eff91b1b53,85ebd2c94c5fdad806ea96a1cdc3ff3400692dab
0d6b5338d0541b6a844d1d832b09b7709fe2948b,a62c7555d78f049c711cfd594455f73fa04b6620,64db584eefebcc5e5faeb287a9d10977adb4a886
25ac1380921c96b933673c8ec9f3e10da66f47d5,13c344a3a078430d212f2f523822c5810157a3d8,d7755a56f6fe705c8edfb955e0f071ac55ea5865
60d350f06788a6da9c2054f2dc2083066d9b10b7,a0e7882692432d6487acf60ae54218335f709233,27df4e98d2f1bf8e64b6037edd8d4643bd764809
aa4070ca8a2c27b818269b42c7470e5b7b03ddad,62846f54adbc08323ce660fbba6b33e1e0275d07,0bbc5a75280fa0ad0ee39e046dedd9d6d97ab90e
305393a9c11b8768a2aaa89ca8f1ff0e852ed94b,977b2f2a4bf7bda09554b034f2112d761d680517,09e61201d221bf098a42d5f994592f7df51a203f
14f361e13f82eceabe67317ba5e243d404419233,4c89eaa6cf12074ffed3b01cdcf30a6aa507aafd,05c6937fd9dd592eb643bc94d1e16c1f95dc6e82
c8d5bd77a31e088d4f5345a8294a27a75b3bf6c7,2a93340bcc22c2f6c45c22569b10a6d81ddadc56,8f95c14827ec62cfe7435e485825dff98b72a8f4
38075ac30c61c95b9371b07312eede596bf0bd22,94d8c22c6ac229faf084188fe25bc04966a47d7a,068f781c7a21335ae04ed8e63a5c18f1a841280e
00d5bb5bbc52baad3f2e268c2d51ceba4b266b04,4dc0c37678ca9102dc0de687cf27963124bf9bdf,aafb471bc880fc20a9b73cf0d60f109163793794
1e5ecccdc663ca646632cbd46a1fe5905cba99ab,809277d2b15b2c4e713cf7fc81d284429e935c2b,7f7c5785fc77b0e697c15c69be56ba7c84bf2fc9
00aa7b8ab3843aa3d5521ffc1f15cd01c4814685,4e605fb7643902e82de03ef4b43aaa166c30a42f,ca242e9ad0e3ba047fcca8cc95fb8e41599d2d0b
c4d7773c0ed87047041bbf32d8773b70b75709aa,a55980bfb85a47c711b31f6ca6ccf3ad74c66d94,099a92733113b683be425b3400f744394ae2897d
0934df505cdf94d24ff93dcd6c23eefac8799795,34587a647f791f29c0ac26fec13059e516507c40,21d843128d02fffcb8126811c16846420d570c32
b2a0df0d10aa701c4e21d215c42fb78cfdf96f62,de3ab7e46b6c7f50723da61aa992b04145cb2472,78c4585b535666f6c2f99af64dcae76c5bbc1f30
6cd88575c63e91afaf914f9ff9a1c67e60c4408a,0ead28c1e05b6eaaf53455be86d8cb3dfc97c669,090cc8fa8f7e60f2bb0fa6fa6d21d17509f39564
8e730d20db57219db3aa63bb97301a0a1591d1f1,8c39213d39eca0bfe89168734159f86bebbcbb4a,6921b968f1cdba59d2403a81c2950336ec2839af
03513720a3bab8b168cbb9707417c915d9654608

Clicking a revision will expand files
 


+ added except_native.inc include file (empty for now, but will provide RTL
support for the native wasm exceptions in the future)
Commit consists out of
  • A rtl/wasm32/except_native.inc
  • M rtl/wasm32/makefile.cpu
  • M rtl/wasm32/wasm32.inc


+ RTL support for raising exceptions in native wasm exceptions mode
Commit consists out of
  • M rtl/wasm32/except_native.inc


* don't include except.inc if wasm32 native exception is turned on, instead
replace it with except_native.inc
Commit consists out of
  • M rtl/inc/objpas.inc
  • M rtl/wasm32/except_native.inc
  • M rtl/wasm32/wasm32.inc


* longjmp in fpc_reraise changed to a throw instruction intrinsic in wasm native exceptions mode
Commit consists out of
  • M rtl/wasm32/except_native.inc


+ implemented GetDate, GetTime and WeekDay in the WASI dos unit. They return
UTC time (I don't know how to obtain the local time zone from within WASI).
Commit consists out of
  • M rtl/wasi/dos.pp


* always return error in SysUtils.FindFirst and .FindNext on the WASI platform,
in order to prevent infinite loops in tests
Commit consists out of
  • M rtl/wasi/sysutils.pp


* instead of using the 'throw' intrinsic, set a boolean flag, in the branchful
exceptions support code
Commit consists out of
  • M rtl/wasm32/except_branchful.inc


+ return a small, fake backtrace for WebAssembly, so that in case of a runtime
error, the message 'Runtime error XXX at $EEEEEEEE' appears.
Commit consists out of
  • M rtl/wasm32/wasm32.inc


+ default exception handling in WebAssembly native exceptions mode
Commit consists out of
  • M rtl/wasi/si_prc.pp
  • M rtl/wasm32/except_native.inc


+ implemented SysUtils.GetTickCount64 for WASI
Commit consists out of
  • M rtl/wasi/sysutils.pp


+ implemented SysUtils.Sleep for WASI
Commit consists out of
  • M rtl/wasi/sysutils.pp


+ implemented SysUtils.GetEnvironmentVariable, GetEnvironmentVariableCount and
GetEnvironmentString for WASI
Commit consists out of
  • M rtl/wasi/sysutils.pp


* preopened dirs structure in the system unit modified to be a pointer to an
array of records
Commit consists out of
  • M rtl/wasi/system.pp


* preopen fd names and current dir changed to use ansistring, as well as the
parameters and result of ConvertToFdRelativePath. This will allow easier
implementation of ChDir.
Commit consists out of
  • M rtl/wasi/dos.pp
  • M rtl/wasi/sysdir.inc
  • M rtl/wasi/sysfile.inc
  • M rtl/wasi/system.pp


* fixed handling of relative paths that are not directly relative to a preopened
dir in ConvertToFdRelativePath. This is a preparation for ChDir support.
Commit consists out of
  • M rtl/wasi/system.pp


+ implemented ChDir() for WASI
Commit consists out of
  • M rtl/wasi/sysdir.inc
  • M rtl/wasi/system.pp


- removed the DebugWriteXXX functions from the WASI system unit, since console
output is now quite stable and can be used for debugging
Commit consists out of
  • M rtl/wasi/system.pp
  • M rtl/wasm32/setjump.inc


* moved the preopened dir and current dir handling types and variables to the
implementation part of the system unit, so their implementation is not exposed
and can be changed in the future (e.g. for thread safety when WebAssembly
gets multithreading support, etc.)
Commit consists out of
  • M rtl/wasi/system.pp


* keep the drive string separate in the preopen and the current dir records on
the WASI platform
Commit consists out of
  • M rtl/wasi/sysdir.inc
  • M rtl/wasi/system.pp


* replaced ['/','\'] with AllowDirectorySeparators in the WASI directory
parsing code
Commit consists out of
  • M rtl/wasi/dos.pp
  • M rtl/wasi/sysdir.inc
  • M rtl/wasi/system.pp


* replaced '/' with DirectorySeparator in the WASI directory parsing code
Commit consists out of
  • M rtl/wasi/sysdir.inc
  • M rtl/wasi/system.pp


* another instance of ['/','\'] replaced with AllowDirectorySeparators
Commit consists out of
  • M rtl/wasi/sysdir.inc


* use AllowDirectorySeparators, instead of checking for '/' and '\'
Commit consists out of
  • M rtl/wasi/system.pp


* use rawbytestring instead of ansistring for the WASI file name handling
Commit consists out of
  • M rtl/wasi/dos.pp
  • M rtl/wasi/sysdir.inc
  • M rtl/wasi/sysfile.inc
  • M rtl/wasi/system.pp


+ implemented SysUtils.FileClose for WASI
Commit consists out of
  • M rtl/wasi/sysutils.pp


+ implemented SysUtils.FileOpen for WASI
Commit consists out of
  • M rtl/wasi/sysutils.pp


+ implemented SysUtils.FileCreate for WASI
Commit consists out of
  • M rtl/wasi/sysutils.pp


- removed the zero constants from the implementation of SysUtils.FileOpen for WASI
Commit consists out of
  • M rtl/wasi/sysutils.pp


+ implemented SysUtils.FileRead for WASI
Commit consists out of
  • M rtl/wasi/sysutils.pp


* fixed WASI bug in do_read, where the result of the __wasi_fd_read syscall function was ignored
Commit consists out of
  • M rtl/wasi/sysfile.inc


+ implemented SysUtils.FileWrite for WASI
Commit consists out of
  • M rtl/wasi/sysutils.pp


+ implemented SysUtils.FileSeek for WASI
Commit consists out of
  • M rtl/wasi/sysutils.pp


+ implemented SysUtils.RenameFile for WASI
Commit consists out of
  • M rtl/wasi/sysutils.pp


- don't call ToSingleByteFileSystemEncodedFileName in SysUtils.FileOpen and
.FileCreate, because ConvertToFdRelativePath already calls it
Commit consists out of
  • M rtl/wasi/sysutils.pp


+ implemented SysUtils.DeleteFile for WASI
Commit consists out of
  • M rtl/wasi/sysutils.pp


+ implemented SysUtils.FileGetDate for WASI
Commit consists out of
  • M rtl/objpas/sysutils/dati.inc
  • M rtl/wasi/sysutils.pp


+ implemented SysUtils.FileAge for WASI
Commit consists out of
  • M rtl/wasi/sysutils.pp


+ implemented SysUtils.FileSetDate for WASI
Commit consists out of
  • M rtl/wasi/sysutils.pp


+ also implemented FileSetDate(FileName) for WASI, via the __wasi_path_filestat_set_times API call
Commit consists out of
  • M rtl/wasi/sysutils.pp


* fixed off-by-one error when initializing current_drive in the WASI system unit
Commit consists out of
  • M rtl/wasi/system.pp


+ implemented SysUtils.FileExists for WASI
Commit consists out of
  • M rtl/wasi/sysutils.pp


* don't set InOutRes in ConvertToFdRelativePath, but return it instead. This
fixes issues in places where this function is used in a way that should not
set IOResult.
Commit consists out of
  • M rtl/wasi/dos.pp
  • M rtl/wasi/sysdir.inc
  • M rtl/wasi/sysfile.inc
  • M rtl/wasi/system.pp
  • M rtl/wasi/sysutils.pp


+ implemented SysUtils.DirectoryExists for WASI
Commit consists out of
  • M rtl/wasi/sysutils.pp


+ implemented SysUtils.FileGetSymLinkTarget for WASI
Commit consists out of
  • M rtl/wasi/sysutils.pp


* always return an error in SysUtils.FileSetAttr on WASI - this function is not supported by the WASI API
Commit consists out of
  • M rtl/wasi/sysutils.pp


+ implemented SysUtils.FileGetAttr for WASI
Commit consists out of
  • M rtl/wasi/sysutils.pp


+ dummy implementation of dos.SetFAttr for WASI, based on the Unix version
Commit consists out of
  • M rtl/wasi/dos.pp


+ implemented DOS.GetFAttr for WASI
Commit consists out of
  • M rtl/wasi/dos.pp


+ added platform-specific helper function dos.DTToWasiDate, similar to
DTToUnixDate on Unix
Commit consists out of
  • M rtl/wasi/dos.pp


+ implemented dos.SetFTime for WASI
Commit consists out of
  • M rtl/wasi/dos.pp


* fix for the WASI datetime to epoch conversion
Commit consists out of
  • M rtl/wasi/dos.pp
  • M rtl/wasi/sysutils.pp


+ implemented SysUtils.GetLocalTime for WASI
Commit consists out of
  • M rtl/wasi/sysutils.pp


+ init the ansistring upper and lower case tables in the WASI SysUtils unit initialization
Commit consists out of
  • M rtl/wasi/sysutils.pp


+ added a wrapper function around __wasi_path_readlink that calls it iteratively
with doubling buffer sizes, starting with 64 bytes, until it reaches 16384
bytes, and reads the link into a rawbytestring. Use that function in all
places in the WASI rtl that need to read a symlink.
Commit consists out of
  • M rtl/wasi/sysdir.inc
  • M rtl/wasi/system.pp
  • M rtl/wasi/sysutils.pp


* ConvertToFdRelativePath removed from the interface part of the WASI system
unit (to avoid cluttering the WASI system unit interface with platform
dependent routines) and added to a new unit, called wasiutil
Commit consists out of
  • M rtl/wasi/Makefile
  • M rtl/wasi/Makefile.fpc
  • M rtl/wasi/dos.pp
  • M rtl/wasi/system.pp
  • M rtl/wasi/sysutils.pp
  • A rtl/wasi/wasiutil.pp


* added the fpc_wasi_path_readlink_ansistring helper function to unit wasiutil
Commit consists out of
  • M rtl/wasi/Makefile
  • M rtl/wasi/Makefile.fpc
  • M rtl/wasi/sysutils.pp
  • M rtl/wasi/wasiutil.pp


* the FNMatch private helper function moved from unit DOS to unit WasiUtil, and
changed to have rawbytestring parameters, so it can be used from SysUtils as
well.
Commit consists out of
  • M rtl/wasi/dos.pp
  • M rtl/wasi/wasiutil.pp


- removed unused, commented out fields from the RtlInfoType record
Commit consists out of
  • M rtl/wasi/dos.pp


- removed the RtlInfoType record, because it is only used only once in a local
variable. Use an anonymous record instead.
Commit consists out of
  • M rtl/wasi/dos.pp


* moved the FindFirst/FindNext/FindClose code from unit DOS to WasiUtil, using
RawByteString. This will allow to reuse the same implementation in SysUtils.
Commit consists out of
  • M rtl/wasi/dos.pp
  • M rtl/wasi/wasiutil.pp


+ implemented FindFirst, FindNext and FindClose in SysUtils for the WASI platform
Commit consists out of
  • M rtl/objpas/sysutils/filutilh.inc
  • M rtl/wasi/sysutils.pp


+ implemented DOS.FSearch for WASI
Commit consists out of
  • M rtl/wasi/dos.pp


- removed TWasiSearchRec.Mode, because it was unused
Commit consists out of
  • M rtl/wasi/dos.pp
  • M rtl/wasi/wasiutil.pp


* fixed range check error in the DOS unit
Commit consists out of
  • M rtl/wasi/dos.pp