Add inlining for old optimizer.

This commit is contained in:
Daniel Kirchner
2021-02-09 19:08:58 +01:00
parent e777cad78a
commit cb74a45fd6
43 changed files with 1463 additions and 74 deletions
+11
View File
@@ -125,6 +125,12 @@ public:
static GasConsumption infinite() { return GasConsumption(0, true); }
GasConsumption& operator+=(GasConsumption const& _other);
GasConsumption operator+(GasConsumption const& _other) const
{
GasConsumption result = *this;
result += _other;
return result;
}
bool operator<(GasConsumption const& _other) const
{
return std::make_pair(isInfinite, value) < std::make_pair(_other.isInfinite, _other.value);
@@ -154,6 +160,11 @@ public:
/// otherwise code will be stored and have to pay "createDataGas" cost.
static u256 dataGas(bytes const& _data, bool _inCreation, langutil::EVMVersion _evmVersion);
/// @returns the gas cost of non-zero data of the supplied length, depending whether it is in creation code, or not.
/// In case of @a _inCreation, the data is only sent as a transaction and is not stored, whereas
/// otherwise code will be stored and have to pay "createDataGas" cost.
static u256 dataGas(uint64_t _length, bool _inCreation, langutil::EVMVersion _evmVersion);
private:
/// @returns _multiplier * (_value + 31) / 32, if _value is a known constant and infinite otherwise.
GasConsumption wordGas(u256 const& _multiplier, ExpressionClasses::Id _value);