Compiler update to 481e1f20 and added gas estimates.

pull/1/head
chriseth 10 years ago
parent 583a45ff15
commit 1f32c285af
  1. 17
      index.html

@ -56,7 +56,7 @@ body {
Source code on the left, compiled code and AST on the right (or error).<br/> Source code on the left, compiled code and AST on the right (or error).<br/>
<b>Note:</b> Chrome/Chromium currently reports &quot;Uncaught JavaScript Exception&quot;. <b>Note:</b> Chrome/Chromium currently reports &quot;Uncaught JavaScript Exception&quot;.
To work around this problem, enable the debug console (Ctrl+Shift+i) and reload.<br/> To work around this problem, enable the debug console (Ctrl+Shift+i) and reload.<br/>
Version: <a href="https://github.com/ethereum/cpp-ethereum/commit/dea8d55f904e8eaa0a1da237748810b2ead69cfd">dea8d55f...</a> 2015-05-18 Version: <a href="https://github.com/ethereum/cpp-ethereum/commit/481e1f20a35643fd4103b1190c641484b4e38199">481e1f...</a> 2015-06-01
<div id="optimizeBox"> <div id="optimizeBox">
<input id="optimize" type="checkbox"><label for="optimize">optimize</label> <input id="optimize" type="checkbox"><label for="optimize">optimize</label>
</div> </div>
@ -197,12 +197,27 @@ var getDetails = function(contract, source) {
funHashes += contract.functionHashes[fun] + ' ' + fun + '\n'; funHashes += contract.functionHashes[fun] + ' ' + fun + '\n';
details.append($('<span class="col1">Functions</span>')); details.append($('<span class="col1">Functions</span>'));
details.append($('<pre/>').text(funHashes)); details.append($('<pre/>').text(funHashes));
details.append($('<span class="col1">Gas Estimates</span>'));
details.append($('<pre/>').text(formatGasEstimates(contract.gasEstimates)));
details.append($('<span class="col1">Assembly</span>')); details.append($('<span class="col1">Assembly</span>'));
var assembly = $('<pre/>').text(formatAssemblyText(contract.assembly, '', source)); var assembly = $('<pre/>').text(formatAssemblyText(contract.assembly, '', source));
details.append(assembly); details.append(assembly);
button.click(function() { details.toggle(); }); button.click(function() { details.toggle(); });
return $('<div/>').append(button).append(details); return $('<div/>').append(button).append(details);
}; };
var formatGasEstimates = function(data) {
var gasToText = function(g) { return g === null ? 'unknown' : g; }
var text = '';
if ('creation' in data)
text += 'Creation: ' + gasToText(data.creation[0]) + ' + ' + gasToText(data.creation[1]) + '\n';
text += 'External:\n';
for (var fun in data.external)
text += ' ' + fun + ': ' + gasToText(data.external[fun]) + '\n';
text += 'Internal:\n';
for (var fun in data.internal)
text += ' ' + fun + ': ' + gasToText(data.external[fun]) + '\n';
return text;
};
var formatAssemblyText = function(asm, prefix, source) { var formatAssemblyText = function(asm, prefix, source) {
var text = ''; var text = '';
text += prefix + '.code\n'; text += prefix + '.code\n';

Loading…
Cancel
Save