Transition from bytecode to more general linker objects.

This commit is contained in:
chriseth
2015-09-11 15:21:37 +02:00
parent 337fde9d11
commit a9edc7b1a6
16 changed files with 90 additions and 78 deletions
+4 -5
View File
@@ -454,12 +454,11 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
ContractDefinition const& contract =
dynamic_cast<ContractType const&>(*function.returnParameterTypes().front()).contractDefinition();
// copy the contract's code into memory
bytes const& bytecode = m_context.compiledContract(contract);
eth::Assembly const& assembly = m_context.compiledContract(contract);
utils().fetchFreeMemoryPointer();
m_context << u256(bytecode.size()) << eth::Instruction::DUP1;
//@todo could be done by actually appending the Assembly, but then we probably need to compile
// multiple times. Will revisit once external fuctions are inlined.
m_context.appendData(bytecode);
// pushes size
eth::AssemblyItem subroutine = m_context.addSubroutine(assembly);
m_context << eth::Instruction::DUP1 << subroutine;
m_context << eth::Instruction::DUP4 << eth::Instruction::CODECOPY;
m_context << eth::Instruction::ADD;