Browse Source

Merge remote-tracking branch 'upstream/develop' into pr/evmjit

cl-refactor
Paweł Bylica 10 years ago
parent
commit
8934f956af
  1. 2
      extdep/CMakeLists.txt
  2. 3
      libevm/VM.h
  3. 6
      libevmcore/Assembly.cpp
  4. 2
      libsolidity/Compiler.h
  5. 2
      libsolidity/CompilerStack.h
  6. 6
      libsolidity/ExpressionCompiler.h
  7. 2
      libsolidity/GlobalContext.h
  8. 2
      libsolidity/NameAndTypeResolver.h
  9. 9
      libsolidity/Types.h
  10. 1
      mix/AssemblyDebuggerModel.cpp
  11. 2
      mix/qml/StateDialog.qml
  12. 6
      mix/qml/StateList.qml
  13. 2
      mix/qml/TransactionDialog.qml
  14. 4
      mix/qml/main.qml

2
extdep/CMakeLists.txt

@ -7,7 +7,7 @@ include(eth_download.cmake)
# all dependencies will be installed into this directory, separated by platform # all dependencies will be installed into this directory, separated by platform
string(TOLOWER ${CMAKE_SYSTEM_NAME} _system_name) string(TOLOWER ${CMAKE_SYSTEM_NAME} _system_name)
set(ETH_DEPENDENCY_INSTALL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/install/${_system_name}") set(ETH_DEPENDENCY_INSTALL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/install/${_system_name}")
set(ETH_DEPENDENCY_SERVER "http://poc-7.ethdev.com/precompiled/${_system_name}") set(ETH_DEPENDENCY_SERVER "http://build.ethdev.com/builds/${_system_name}-precompiled")
file(MAKE_DIRECTORY ${ETH_DEPENDENCY_INSTALL_DIR}/lib) file(MAKE_DIRECTORY ${ETH_DEPENDENCY_INSTALL_DIR}/lib)
file(MAKE_DIRECTORY ${ETH_DEPENDENCY_INSTALL_DIR}/include) file(MAKE_DIRECTORY ${ETH_DEPENDENCY_INSTALL_DIR}/include)
file(MAKE_DIRECTORY ${ETH_DEPENDENCY_INSTALL_DIR}/bin) file(MAKE_DIRECTORY ${ETH_DEPENDENCY_INSTALL_DIR}/bin)

3
libevm/VM.h

@ -86,7 +86,8 @@ inline bytesConstRef VM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _st
for (unsigned i = 0; i < _ext.code.size(); ++i) for (unsigned i = 0; i < _ext.code.size(); ++i)
if (_ext.code[i] == (byte)Instruction::JUMPDEST) if (_ext.code[i] == (byte)Instruction::JUMPDEST)
m_jumpDests.insert(i); m_jumpDests.insert(i);
else if (_ext.code[i] >= (byte)Instruction::PUSH1 && _ext.code[i] <= (byte)Instruction::PUSH32)
i += _ext.code[i] - (unsigned)Instruction::PUSH1 + 1;
u256 nextPC = m_curPC + 1; u256 nextPC = m_curPC + 1;
auto osteps = _steps; auto osteps = _steps;
for (bool stopped = false; !stopped && _steps--; m_curPC = nextPC, nextPC = m_curPC + 1) for (bool stopped = false; !stopped && _steps--; m_curPC = nextPC, nextPC = m_curPC + 1)

6
libevmcore/Assembly.cpp

@ -391,9 +391,9 @@ Assembly& Assembly::optimise(bool _enable)
if (matches(vr, &r.first)) if (matches(vr, &r.first))
{ {
auto rw = r.second(vr); auto rw = r.second(vr);
unsigned const vrSize = bytesRequiredBySlice(vr.begin(), vr.end()); unsigned const vrSizeInBytes = bytesRequiredBySlice(vr.begin(), vr.end());
unsigned const rwSize = bytesRequiredBySlice(rw.begin(), rw.end()); unsigned const rwSizeInBytes = bytesRequiredBySlice(rw.begin(), rw.end());
if (rwSize < vrSize || (rwSize == vrSize && popCountIncreased(vr, rw))) if (rwSizeInBytes < vrSizeInBytes || (rwSizeInBytes == vrSizeInBytes && popCountIncreased(vr, rw)))
{ {
copt << vr << "matches" << AssemblyItemsConstRef(&r.first) << "becomes..."; copt << vr << "matches" << AssemblyItemsConstRef(&r.first) << "becomes...";
copt << AssemblyItemsConstRef(&rw); copt << AssemblyItemsConstRef(&rw);

2
libsolidity/Compiler.h

@ -30,7 +30,7 @@ namespace solidity {
class Compiler: private ASTConstVisitor class Compiler: private ASTConstVisitor
{ {
public: public:
explicit Compiler(bool _optimize = false): m_optimize(_optimize), m_returnTag(m_context.newTag()) {} explicit Compiler(bool _optimize = false): m_optimize(_optimize), m_context(), m_returnTag(m_context.newTag()) {}
void compileContract(ContractDefinition const& _contract, std::vector<MagicVariableDeclaration const*> const& _magicGlobals, void compileContract(ContractDefinition const& _contract, std::vector<MagicVariableDeclaration const*> const& _magicGlobals,
std::map<ContractDefinition const*, bytes const*> const& _contracts); std::map<ContractDefinition const*, bytes const*> const& _contracts);

2
libsolidity/CompilerStack.h

@ -113,7 +113,7 @@ private:
struct Contract struct Contract
{ {
ContractDefinition const* contract; ContractDefinition const* contract = nullptr;
std::shared_ptr<Compiler> compiler; std::shared_ptr<Compiler> compiler;
bytes bytecode; bytes bytecode;
std::shared_ptr<InterfaceHandler> interfaceHandler; std::shared_ptr<InterfaceHandler> interfaceHandler;

6
libsolidity/ExpressionCompiler.h

@ -146,12 +146,12 @@ private:
private: private:
CompilerContext* m_context; CompilerContext* m_context;
LValueType m_type; LValueType m_type = NONE;
/// If m_type is STACK, this is base stack offset (@see /// If m_type is STACK, this is base stack offset (@see
/// CompilerContext::getBaseStackOffsetOfVariable) of a local variable. /// CompilerContext::getBaseStackOffsetOfVariable) of a local variable.
unsigned m_baseStackOffset; unsigned m_baseStackOffset = 0;
/// Size of the value of this lvalue on the stack. /// Size of the value of this lvalue on the stack.
unsigned m_stackSize; unsigned m_stackSize = 0;
}; };
bool m_optimize; bool m_optimize;

2
libsolidity/GlobalContext.h

@ -56,7 +56,7 @@ public:
private: private:
std::vector<std::shared_ptr<MagicVariableDeclaration const>> m_magicVariables; std::vector<std::shared_ptr<MagicVariableDeclaration const>> m_magicVariables;
ContractDefinition const* m_currentContract; ContractDefinition const* m_currentContract = nullptr;
std::map<ContractDefinition const*, std::shared_ptr<MagicVariableDeclaration const>> mutable m_thisPointer; std::map<ContractDefinition const*, std::shared_ptr<MagicVariableDeclaration const>> mutable m_thisPointer;
}; };

2
libsolidity/NameAndTypeResolver.h

@ -69,7 +69,7 @@ private:
/// not contain code. /// not contain code.
std::map<ASTNode const*, DeclarationContainer> m_scopes; std::map<ASTNode const*, DeclarationContainer> m_scopes;
DeclarationContainer* m_currentScope; DeclarationContainer* m_currentScope = nullptr;
}; };
/** /**

9
libsolidity/Types.h

@ -387,6 +387,9 @@ public:
protected: protected:
virtual TypePointer binaryOperatorResultImpl(Token::Value _operator, TypePointer const& _this, TypePointer const& _other) const override virtual TypePointer binaryOperatorResultImpl(Token::Value _operator, TypePointer const& _this, TypePointer const& _other) const override
{ {
(void)_operator;
(void)_this;
(void)_other;
return TypePointer(); return TypePointer();
} }
}; };
@ -412,6 +415,9 @@ public:
protected: protected:
virtual TypePointer binaryOperatorResultImpl(Token::Value _operator, TypePointer const& _this, TypePointer const& _other) const override virtual TypePointer binaryOperatorResultImpl(Token::Value _operator, TypePointer const& _this, TypePointer const& _other) const override
{ {
(void)_operator;
(void)_this;
(void)_other;
return TypePointer(); return TypePointer();
} }
@ -442,6 +448,9 @@ public:
protected: protected:
virtual TypePointer binaryOperatorResultImpl(Token::Value _operator, TypePointer const& _this, TypePointer const& _other) const override virtual TypePointer binaryOperatorResultImpl(Token::Value _operator, TypePointer const& _this, TypePointer const& _other) const override
{ {
(void)_operator;
(void)_this;
(void)_other;
return TypePointer(); return TypePointer();
} }

1
mix/AssemblyDebuggerModel.cpp

@ -74,7 +74,6 @@ DebuggingContent AssemblyDebuggerModel::executeTransaction(bytesConstRef const&
execution.go(onOp); execution.go(onOp);
execution.finalize(); execution.finalize();
m_executiveState.completeMine();
DebuggingContent d; DebuggingContent d;
d.returnValue = execution.out().toVector(); d.returnValue = execution.out().toVector();

2
mix/qml/StateDialog.qml

@ -1,5 +1,5 @@
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 1.2 import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Window 2.0 import QtQuick.Window 2.0

6
mix/qml/StateList.qml

@ -1,7 +1,7 @@
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls.Styles 1.2 import QtQuick.Controls.Styles 1.1
import QtQuick.Controls 1.2 import QtQuick.Controls 1.1
import QtQuick.Dialogs 1.2 import QtQuick.Dialogs 1.1
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
Rectangle { Rectangle {

2
mix/qml/TransactionDialog.qml

@ -1,5 +1,5 @@
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 1.2 import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Window 2.0 import QtQuick.Window 2.0

4
mix/qml/main.qml

@ -1,6 +1,6 @@
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 1.2 import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.2 import QtQuick.Controls.Styles 1.1
import QtQuick.Dialogs 1.1 import QtQuick.Dialogs 1.1
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Window 2.1 import QtQuick.Window 2.1

Loading…
Cancel
Save