| 1516 | } |
| 1517 | |
| 1518 | void CompilerUtils::copyContractCodeToMemory(ContractDefinition const& contract, bool _creation) |
| 1519 | { |
| 1520 | std::string which = _creation ? "Creation" : "Runtime"; |
| 1521 | m_context.callLowLevelFunction( |
| 1522 | "$copyContract" + which + "CodeToMemory_" + contract.type()->identifier(), |
| 1523 | 1, |
| 1524 | 1, |
| 1525 | [&contract, _creation](CompilerContext& _context) |
| 1526 | { |
| 1527 | // copy the contract's code into memory |
| 1528 | std::shared_ptr<evmasm::Assembly> assembly = |
| 1529 | _creation ? |
| 1530 | _context.compiledContract(contract) : |
| 1531 | _context.compiledContractRuntime(contract); |
| 1532 | // pushes size |
| 1533 | auto subroutine = _context.addSubroutine(assembly); |
| 1534 | _context << Instruction::DUP1 << subroutine; |
| 1535 | _context << Instruction::DUP4 << Instruction::CODECOPY; |
| 1536 | _context << Instruction::ADD; |
| 1537 | } |
| 1538 | ); |
| 1539 | } |
| 1540 | |
| 1541 | void CompilerUtils::storeStringData(bytesConstRef _data) |
| 1542 | { |
no test coverage detected