aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/interface/CompilerStack.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-07-28 21:31:39 +0800
committerGitHub <noreply@github.com>2017-07-28 21:31:39 +0800
commit7e40def689db37658a03a53a6e02f3392823ed62 (patch)
tree18c9b51a029e9a79fda705a78c6a4753ccd82bfe /libsolidity/interface/CompilerStack.cpp
parent53f747b7ded3610802582448257b25e87442bebb (diff)
parent7d37eba4ba5e11a59bd201fde91bef7510510b0f (diff)
downloaddexon-solidity-7e40def689db37658a03a53a6e02f3392823ed62.tar
dexon-solidity-7e40def689db37658a03a53a6e02f3392823ed62.tar.gz
dexon-solidity-7e40def689db37658a03a53a6e02f3392823ed62.tar.bz2
dexon-solidity-7e40def689db37658a03a53a6e02f3392823ed62.tar.lz
dexon-solidity-7e40def689db37658a03a53a6e02f3392823ed62.tar.xz
dexon-solidity-7e40def689db37658a03a53a6e02f3392823ed62.tar.zst
dexon-solidity-7e40def689db37658a03a53a6e02f3392823ed62.zip
Merge pull request #2478 from ethereum/fallback-dispatcher
Optimise the fallback dispatcher by removing a useless jump
Diffstat (limited to 'libsolidity/interface/CompilerStack.cpp')
-rw-r--r--libsolidity/interface/CompilerStack.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp
index 02983a82..9689b700 100644
--- a/libsolidity/interface/CompilerStack.cpp
+++ b/libsolidity/interface/CompilerStack.cpp
@@ -935,7 +935,7 @@ Json::Value CompilerStack::gasEstimates(string const& _contractName) const
for (auto const& it: contract.definedFunctions())
{
/// Exclude externally visible functions, constructor and the fallback function
- if (it->isPartOfExternalInterface() || it->isConstructor() || it->name().empty())
+ if (it->isPartOfExternalInterface() || it->isConstructor() || it->isFallback())
continue;
size_t entry = functionEntryPoint(_contractName, *it);
@@ -943,12 +943,14 @@ Json::Value CompilerStack::gasEstimates(string const& _contractName) const
if (entry > 0)
gas = GasEstimator::functionalEstimation(*items, entry, *it);
+ /// TODO: This could move into a method shared with externalSignature()
FunctionType type(*it);
string sig = it->name() + "(";
auto paramTypes = type.parameterTypes();
for (auto it = paramTypes.begin(); it != paramTypes.end(); ++it)
sig += (*it)->toString() + (it + 1 == paramTypes.end() ? "" : ",");
sig += ")";
+
internalFunctions[sig] = gasToJson(gas);
}