Browse Source

Changed the new option "Disable LLL Compiler Optimization" to a more sane "Optimize LLL Compiler" (enabled by default)

cl-refactor
Giacomo Tazzari 11 years ago
parent
commit
0a7f3a625f
  1. 6
      alethzero/Main.ui
  2. 10
      alethzero/MainWin.cpp
  3. 4
      alethzero/MainWin.h

6
alethzero/Main.ui

@ -185,7 +185,7 @@
<addaction name="killBlockchain"/> <addaction name="killBlockchain"/>
<addaction name="inject"/> <addaction name="inject"/>
<addaction name="forceMining"/> <addaction name="forceMining"/>
<addaction name="disableCompilerOptimization"/> <addaction name="optimizeCompiler"/>
</widget> </widget>
<addaction name="menu_File"/> <addaction name="menu_File"/>
<addaction name="menu_Network"/> <addaction name="menu_Network"/>
@ -1668,12 +1668,12 @@ font-size: 14pt</string>
<string>&amp;Refresh</string> <string>&amp;Refresh</string>
</property> </property>
</action> </action>
<action name="disableCompilerOptimization"> <action name="optimizeCompiler">
<property name="checkable"> <property name="checkable">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="text"> <property name="text">
<string>&amp;Disable LLL Compiler Optimization</string> <string>&amp;Optimize LLL Compiler</string>
</property> </property>
</action> </action>
</widget> </widget>

10
alethzero/MainWin.cpp

@ -332,9 +332,9 @@ void Main::on_forceMining_triggered()
m_client->setForceMining(ui->forceMining->isChecked()); m_client->setForceMining(ui->forceMining->isChecked());
} }
void Main::on_disableCompilerOptimization_triggered() void Main::on_optimizeCompiler_triggered()
{ {
m_disableCompilerOptimization = ui->disableCompilerOptimization->isChecked(); m_optimizeCompiler = ui->optimizeCompiler->isChecked();
on_data_textChanged(); on_data_textChanged();
} }
@ -576,6 +576,7 @@ void Main::readSettings(bool _skipGeometry)
ui->paranoia->setChecked(s.value("paranoia", false).toBool()); ui->paranoia->setChecked(s.value("paranoia", false).toBool());
ui->showAll->setChecked(s.value("showAll", false).toBool()); ui->showAll->setChecked(s.value("showAll", false).toBool());
ui->showAllAccounts->setChecked(s.value("showAllAccounts", false).toBool()); ui->showAllAccounts->setChecked(s.value("showAllAccounts", false).toBool());
ui->optimizeCompiler->setChecked(m_optimizeCompiler);
ui->clientName->setText(s.value("clientName", "").toString()); ui->clientName->setText(s.value("clientName", "").toString());
ui->idealPeers->setValue(s.value("idealPeers", ui->idealPeers->value()).toInt()); ui->idealPeers->setValue(s.value("idealPeers", ui->idealPeers->value()).toInt());
ui->port->setValue(s.value("port", ui->port->value()).toInt()); ui->port->setValue(s.value("port", ui->port->value()).toInt());
@ -1308,7 +1309,7 @@ void Main::on_data_textChanged()
} }
else else
{ {
m_data = eth::compileLLL(src, !m_disableCompilerOptimization, &errors); m_data = eth::compileLLL(src, m_optimizeCompiler, &errors);
if (errors.size()) if (errors.size())
{ {
try try
@ -1326,7 +1327,8 @@ void Main::on_data_textChanged()
{ {
auto asmcode = eth::compileLLLToAsm(src, false); auto asmcode = eth::compileLLLToAsm(src, false);
lll = "<h4>Pre</h4><pre>" + QString::fromStdString(asmcode).toHtmlEscaped() + "</pre>"; lll = "<h4>Pre</h4><pre>" + QString::fromStdString(asmcode).toHtmlEscaped() + "</pre>";
if (!m_disableCompilerOptimization) { if (m_optimizeCompiler)
{
asmcode = eth::compileLLLToAsm(src, true); asmcode = eth::compileLLLToAsm(src, true);
lll = "<h4>Opt</h4><pre>" + QString::fromStdString(asmcode).toHtmlEscaped() + "</pre>" + lll; lll = "<h4>Opt</h4><pre>" + QString::fromStdString(asmcode).toHtmlEscaped() + "</pre>" + lll;
} }

4
alethzero/MainWin.h

@ -138,7 +138,7 @@ private slots:
void on_debugDumpState_triggered(int _add = 1); void on_debugDumpState_triggered(int _add = 1);
void on_debugDumpStatePre_triggered(); void on_debugDumpStatePre_triggered();
void on_refresh_triggered(); void on_refresh_triggered();
void on_disableCompilerOptimization_triggered(); void on_optimizeCompiler_triggered();
signals: signals:
void poll(); void poll();
@ -222,7 +222,7 @@ private:
QMap<unsigned, unsigned> m_pcWarp; QMap<unsigned, unsigned> m_pcWarp;
QList<WorldState> m_history; QList<WorldState> m_history;
std::map<eth::u256, eth::bytes> m_codes; // and pcWarps std::map<eth::u256, eth::bytes> m_codes; // and pcWarps
bool m_disableCompilerOptimization = false; bool m_optimizeCompiler = true;
QNetworkAccessManager m_webCtrl; QNetworkAccessManager m_webCtrl;

Loading…
Cancel
Save