Review suggested renaming.

This commit is contained in:
Daniel Kirchner 2022-06-15 12:13:38 +02:00
parent c3781f7a1c
commit 4c84b77a4b

View File

@ -1818,7 +1818,7 @@ string YulUtilFunctions::copyArrayToStorageFunction(ArrayType const& _fromType,
for { let i := 0 } lt(i, length) {i := add(i, 1)} { for { let i := 0 } lt(i, length) {i := add(i, 1)} {
<?fromCalldata> <?fromCalldata>
let <elementValues> := let <stackItems> :=
<?dynamicallyEncodedBase> <?dynamicallyEncodedBase>
<accessCalldataTail>(value, srcPtr) <accessCalldataTail>(value, srcPtr)
<!dynamicallyEncodedBase> <!dynamicallyEncodedBase>
@ -1827,14 +1827,14 @@ string YulUtilFunctions::copyArrayToStorageFunction(ArrayType const& _fromType,
</fromCalldata> </fromCalldata>
<?fromMemory> <?fromMemory>
let <elementValues> := <readFromCalldataOrMemory>(srcPtr) let <stackItems> := <readFromMemoryOrCalldata>(srcPtr)
</fromMemory> </fromMemory>
<?fromStorage> <?fromStorage>
let <elementValues> := srcPtr let <stackItems> := srcPtr
</fromStorage> </fromStorage>
<updateStorageValue>(elementSlot, <elementValues>) <updateStorageValue>(elementSlot, <stackItems>)
srcPtr := add(srcPtr, <srcStride>) srcPtr := add(srcPtr, <srcStride>)
@ -1862,9 +1862,9 @@ string YulUtilFunctions::copyArrayToStorageFunction(ArrayType const& _fromType,
templ("arrayLength",arrayLengthFunction(_fromType)); templ("arrayLength",arrayLengthFunction(_fromType));
templ("dstDataLocation", arrayDataAreaFunction(_toType)); templ("dstDataLocation", arrayDataAreaFunction(_toType));
if (fromMemory || (fromCalldata && _fromType.baseType()->isValueType())) if (fromMemory || (fromCalldata && _fromType.baseType()->isValueType()))
templ("readFromCalldataOrMemory", readFromMemoryOrCalldata(*_fromType.baseType(), fromCalldata)); templ("readFromMemoryOrCalldata", readFromMemoryOrCalldata(*_fromType.baseType(), fromCalldata));
templ("elementValues", suffixedVariableNameList( templ("stackItems", suffixedVariableNameList(
"elementValue_", "stackItem_",
0, 0,
_fromType.baseType()->stackItems().size() _fromType.baseType()->stackItems().size()
)); ));
@ -2004,13 +2004,13 @@ string YulUtilFunctions::copyValueArrayToStorageFunction(ArrayType const& _fromT
<?multipleItemsPerSlotDst>for { let j := 0 } lt(j, <itemsPerSlot>) { j := add(j, 1) } </multipleItemsPerSlotDst> <?multipleItemsPerSlotDst>for { let j := 0 } lt(j, <itemsPerSlot>) { j := add(j, 1) } </multipleItemsPerSlotDst>
{ {
<?isFromStorage> <?isFromStorage>
let <elementValues> := <convert>( let <stackItems> := <convert>(
<extractFromSlot>(srcSlotValue, mul(<srcStride>, srcItemIndexInSlot)) <extractFromSlot>(srcSlotValue, mul(<srcStride>, srcItemIndexInSlot))
) )
<!isFromStorage> <!isFromStorage>
let <elementValues> := <readFromCalldataOrMemory>(srcPtr) let <stackItems> := <readFromMemoryOrCalldata>(srcPtr)
</isFromStorage> </isFromStorage>
let itemValue := <prepareStore>(<elementValues>) let itemValue := <prepareStore>(<stackItems>)
dstSlotValue := dstSlotValue :=
<?multipleItemsPerSlotDst> <?multipleItemsPerSlotDst>
<updateByteSlice>(dstSlotValue, mul(<dstStride>, j), itemValue) <updateByteSlice>(dstSlotValue, mul(<dstStride>, j), itemValue)
@ -2035,13 +2035,13 @@ string YulUtilFunctions::copyValueArrayToStorageFunction(ArrayType const& _fromT
<!sameTypeFromStorage> <!sameTypeFromStorage>
for { let j := 0 } lt(j, spill) { j := add(j, 1) } { for { let j := 0 } lt(j, spill) { j := add(j, 1) } {
<?isFromStorage> <?isFromStorage>
let <elementValues> := <convert>( let <stackItems> := <convert>(
<extractFromSlot>(srcSlotValue, mul(<srcStride>, srcItemIndexInSlot)) <extractFromSlot>(srcSlotValue, mul(<srcStride>, srcItemIndexInSlot))
) )
<!isFromStorage> <!isFromStorage>
let <elementValues> := <readFromCalldataOrMemory>(srcPtr) let <stackItems> := <readFromMemoryOrCalldata>(srcPtr)
</isFromStorage> </isFromStorage>
let itemValue := <prepareStore>(<elementValues>) let itemValue := <prepareStore>(<stackItems>)
dstSlotValue := <updateByteSlice>(dstSlotValue, mul(<dstStride>, j), itemValue) dstSlotValue := <updateByteSlice>(dstSlotValue, mul(<dstStride>, j), itemValue)
<updateSrcPtr> <updateSrcPtr>
@ -2063,12 +2063,12 @@ string YulUtilFunctions::copyValueArrayToStorageFunction(ArrayType const& _fromT
templ("panic", panicFunction(PanicCode::ResourceError)); templ("panic", panicFunction(PanicCode::ResourceError));
templ("isFromDynamicCalldata", _fromType.isDynamicallySized() && fromCalldata); templ("isFromDynamicCalldata", _fromType.isDynamicallySized() && fromCalldata);
templ("isFromStorage", fromStorage); templ("isFromStorage", fromStorage);
templ("readFromCalldataOrMemory", readFromMemoryOrCalldata(*_fromType.baseType(), fromCalldata)); templ("readFromMemoryOrCalldata", readFromMemoryOrCalldata(*_fromType.baseType(), fromCalldata));
templ("srcDataLocation", arrayDataAreaFunction(_fromType)); templ("srcDataLocation", arrayDataAreaFunction(_fromType));
templ("dstDataLocation", arrayDataAreaFunction(_toType)); templ("dstDataLocation", arrayDataAreaFunction(_toType));
templ("srcStride", to_string(_fromType.storageStride())); templ("srcStride", to_string(_fromType.storageStride()));
templ("elementValues", suffixedVariableNameList( templ("stackItems", suffixedVariableNameList(
"elementValue_", "stackItem_",
0, 0,
_fromType.baseType()->stackItems().size() _fromType.baseType()->stackItems().size()
)); ));