mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Adjust documentation.
This commit is contained in:
parent
0a9d752b8b
commit
b57e856426
13
docs/yul.rst
13
docs/yul.rst
@ -1124,6 +1124,11 @@ regular strings in native encoding. For code,
|
|||||||
|
|
||||||
Above, ``Block`` refers to ``Block`` in the Yul code grammar explained in the previous chapter.
|
Above, ``Block`` refers to ``Block`` in the Yul code grammar explained in the previous chapter.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
An object with a name that ends in ``_deployed`` is treated as deployed code by the Yul optimizer.
|
||||||
|
The only consequence of this is a different gas cost heuristic in the optimizer.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
Data objects or sub-objects whose names contain a ``.`` can be defined
|
Data objects or sub-objects whose names contain a ``.`` can be defined
|
||||||
@ -1172,17 +1177,17 @@ An example Yul Object is shown below:
|
|||||||
|
|
||||||
// now return the runtime object (the currently
|
// now return the runtime object (the currently
|
||||||
// executing code is the constructor code)
|
// executing code is the constructor code)
|
||||||
size := datasize("runtime")
|
size := datasize("Contract1_deployed")
|
||||||
offset := allocate(size)
|
offset := allocate(size)
|
||||||
// This will turn into a memory->memory copy for Ewasm and
|
// This will turn into a memory->memory copy for Ewasm and
|
||||||
// a codecopy for EVM
|
// a codecopy for EVM
|
||||||
datacopy(offset, dataoffset("runtime"), size)
|
datacopy(offset, dataoffset("Contract1_deployed"), size)
|
||||||
return(offset, size)
|
return(offset, size)
|
||||||
}
|
}
|
||||||
|
|
||||||
data "Table2" hex"4123"
|
data "Table2" hex"4123"
|
||||||
|
|
||||||
object "runtime" {
|
object "Contract1_deployed" {
|
||||||
code {
|
code {
|
||||||
function allocate(size) -> ptr {
|
function allocate(size) -> ptr {
|
||||||
ptr := mload(0x40)
|
ptr := mload(0x40)
|
||||||
@ -1204,7 +1209,7 @@ An example Yul Object is shown below:
|
|||||||
// code here ...
|
// code here ...
|
||||||
}
|
}
|
||||||
|
|
||||||
object "runtime" {
|
object "Contract2_deployed" {
|
||||||
code {
|
code {
|
||||||
// code here ...
|
// code here ...
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user