diff options
author | chriseth <chris@ethereum.org> | 2017-04-29 00:15:18 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2017-05-20 01:20:28 +0800 |
commit | e2b21e1c9611fd94f8e7b91b0ecbb0ec39145758 (patch) | |
tree | 9cc66e31297b7fff84166225d008b23351ba6e06 /libsolidity/codegen/CompilerContext.cpp | |
parent | 41ee2cefbbe0009fd7576f3e965b63e076d1ad24 (diff) | |
download | dexon-solidity-e2b21e1c9611fd94f8e7b91b0ecbb0ec39145758.tar dexon-solidity-e2b21e1c9611fd94f8e7b91b0ecbb0ec39145758.tar.gz dexon-solidity-e2b21e1c9611fd94f8e7b91b0ecbb0ec39145758.tar.bz2 dexon-solidity-e2b21e1c9611fd94f8e7b91b0ecbb0ec39145758.tar.lz dexon-solidity-e2b21e1c9611fd94f8e7b91b0ecbb0ec39145758.tar.xz dexon-solidity-e2b21e1c9611fd94f8e7b91b0ecbb0ec39145758.tar.zst dexon-solidity-e2b21e1c9611fd94f8e7b91b0ecbb0ec39145758.zip |
Refactor to abstract assembly to JULIA.
Diffstat (limited to 'libsolidity/codegen/CompilerContext.cpp')
-rw-r--r-- | libsolidity/codegen/CompilerContext.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libsolidity/codegen/CompilerContext.cpp b/libsolidity/codegen/CompilerContext.cpp index 51dd9fd2..5c4f88c4 100644 --- a/libsolidity/codegen/CompilerContext.cpp +++ b/libsolidity/codegen/CompilerContext.cpp @@ -264,7 +264,7 @@ void CompilerContext::appendInlineAssembly( assembly = &replacedAssembly; } - unsigned startStackHeight = stackHeight(); + int startStackHeight = stackHeight(); assembly::ExternalIdentifierAccess identifierAccess; identifierAccess.resolve = [&]( @@ -278,26 +278,26 @@ void CompilerContext::appendInlineAssembly( identifierAccess.generateCode = [&]( assembly::Identifier const& _identifier, assembly::IdentifierContext _context, - eth::Assembly& _assembly + julia::AbstractAssembly& _assembly ) { auto it = std::find(_localVariables.begin(), _localVariables.end(), _identifier.name); solAssert(it != _localVariables.end(), ""); - unsigned stackDepth = _localVariables.end() - it; - int stackDiff = _assembly.deposit() - startStackHeight + stackDepth; + int stackDepth = _localVariables.end() - it; + int stackDiff = _assembly.stackHeight() - startStackHeight + stackDepth; if (_context == assembly::IdentifierContext::LValue) stackDiff -= 1; if (stackDiff < 1 || stackDiff > 16) BOOST_THROW_EXCEPTION( CompilerError() << - errinfo_comment("Stack too deep, try removing local variables.") + errinfo_comment("Stack too deep (" + to_string(stackDiff) + "), try removing local variables.") ); if (_context == assembly::IdentifierContext::RValue) - _assembly.append(dupInstruction(stackDiff)); + _assembly.appendInstruction(dupInstruction(stackDiff)); else { - _assembly.append(swapInstruction(stackDiff)); - _assembly.append(Instruction::POP); + _assembly.appendInstruction(swapInstruction(stackDiff)); + _assembly.appendInstruction(Instruction::POP); } }; |