mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Documentation.
This commit is contained in:
parent
3738cff6e6
commit
ea7e751750
33
docs/yul.rst
33
docs/yul.rst
@ -885,13 +885,6 @@ the ``dup`` and ``swap`` instructions as well as ``jump`` instructions, labels a
|
|||||||
| gaslimit() | | F | block gas limit of the current block |
|
| gaslimit() | | F | block gas limit of the current block |
|
||||||
+-------------------------+-----+---+-----------------------------------------------------------------+
|
+-------------------------+-----+---+-----------------------------------------------------------------+
|
||||||
|
|
||||||
There are three additional functions, ``datasize(x)``, ``dataoffset(x)`` and ``datacopy(t, f, l)``,
|
|
||||||
which are used to access other parts of a Yul object.
|
|
||||||
|
|
||||||
``datasize`` and ``dataoffset`` can only take string literals (the names of other objects)
|
|
||||||
as arguments and return the size and offset in the data area, respectively.
|
|
||||||
For the EVM, the ``datacopy`` function is equivalent to ``codecopy``.
|
|
||||||
|
|
||||||
.. _yul-call-return-area:
|
.. _yul-call-return-area:
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
@ -903,6 +896,32 @@ For the EVM, the ``datacopy`` function is equivalent to ``codecopy``.
|
|||||||
The remaining bytes will retain their values as of before the call. If the call fails (it returns ``0``),
|
The remaining bytes will retain their values as of before the call. If the call fails (it returns ``0``),
|
||||||
nothing is written to that area, but you can still retrieve the failure data using ``returndatacopy``.
|
nothing is written to that area, but you can still retrieve the failure data using ``returndatacopy``.
|
||||||
|
|
||||||
|
|
||||||
|
In some internal dialects, there are additional functions:
|
||||||
|
|
||||||
|
datasize, dataoffset, datacopy
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
The functions ``datasize(x)``, ``dataoffset(x)`` and ``datacopy(t, f, l)``,
|
||||||
|
are used to access other parts of a Yul object.
|
||||||
|
|
||||||
|
``datasize`` and ``dataoffset`` can only take string literals (the names of other objects)
|
||||||
|
as arguments and return the size and offset in the data area, respectively.
|
||||||
|
For the EVM, the ``datacopy`` function is equivalent to ``codecopy``.
|
||||||
|
|
||||||
|
|
||||||
|
setimmutable, loadimmutable
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
The functions ``setimmutable("name", value)`` and ``loadimmutable("name")`` are
|
||||||
|
used for the immutable mechanism in Solidity and do not nicely map to pur Yul.
|
||||||
|
The function ``setimmutable`` assumes that the runtime code of a contract
|
||||||
|
is currently copied to memory at offsot zero. The call to ``setimmutable("name", value)``
|
||||||
|
will store ``value`` at all points in memory that contain a call to
|
||||||
|
``loadimmutable("name")``.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.. _yul-object:
|
.. _yul-object:
|
||||||
|
|
||||||
Specification of Yul Object
|
Specification of Yul Object
|
||||||
|
Loading…
Reference in New Issue
Block a user