File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -1124,6 +1124,11 @@ regular strings in native encoding. For code,
1124
1124
1125
1125
Above, ``Block `` refers to ``Block `` in the Yul code grammar explained in the previous chapter.
1126
1126
1127
+ .. note ::
1128
+
1129
+ An object with a name that ends in ``_deployed `` is treated as deployed code by the Yul optimizer.
1130
+ The only consequence of this is a different gas cost heuristic in the optimizer.
1131
+
1127
1132
.. note ::
1128
1133
1129
1134
Data objects or sub-objects whose names contain a ``. `` can be defined
@@ -1172,17 +1177,17 @@ An example Yul Object is shown below:
1172
1177
1173
1178
// now return the runtime object (the currently
1174
1179
// executing code is the constructor code)
1175
- size := datasize("runtime ")
1180
+ size := datasize("Contract1_deployed ")
1176
1181
offset := allocate(size)
1177
1182
// This will turn into a memory->memory copy for Ewasm and
1178
1183
// a codecopy for EVM
1179
- datacopy(offset, dataoffset("runtime "), size)
1184
+ datacopy(offset, dataoffset("Contract1_deployed "), size)
1180
1185
return(offset, size)
1181
1186
}
1182
1187
1183
1188
data "Table2" hex"4123"
1184
1189
1185
- object "runtime " {
1190
+ object "Contract1_deployed " {
1186
1191
code {
1187
1192
function allocate(size) -> ptr {
1188
1193
ptr := mload(0x40)
@@ -1204,7 +1209,7 @@ An example Yul Object is shown below:
1204
1209
// code here ...
1205
1210
}
1206
1211
1207
- object "runtime " {
1212
+ object "Contract2_deployed " {
1208
1213
code {
1209
1214
// code here ...
1210
1215
}
You can’t perform that action at this time.
0 commit comments