Stored combined creation and runtime tags.

Includes a change to Assembly to allow tags from sub-assemblies to be
used.

Sorry, this get a bit bigger than I thought.
This commit is contained in:
chriseth
2016-11-16 14:37:18 +01:00
parent ee3efa67a8
commit e543bd34c0
20 changed files with 347 additions and 117 deletions
+23
View File
@@ -26,6 +26,29 @@ using namespace std;
using namespace dev;
using namespace dev::eth;
AssemblyItem AssemblyItem::toSubAssemblyTag(size_t _subId) const
{
assertThrow(m_data < (u256(1) << 64), Exception, "Tag already has subassembly set.");
assertThrow(m_type == PushTag || m_type == Tag, Exception, "");
AssemblyItem r = *this;
r.m_type = PushTag;
r.setPushTagSubIdAndTag(_subId, size_t(m_data));
return r;
}
pair<size_t, size_t> AssemblyItem::splitForeignPushTag() const
{
assertThrow(m_type == PushTag || m_type == Tag, Exception, "");
return make_pair(size_t(m_data / (u256(1) << 64)) - 1, size_t(m_data));
}
void AssemblyItem::setPushTagSubIdAndTag(size_t _subId, size_t _tag)
{
assertThrow(m_type == PushTag || m_type == Tag, Exception, "");
setData(_tag + ((u256(_subId) + 1) << 64));
}
unsigned AssemblyItem::bytesRequired(unsigned _addressLength) const
{
switch (m_type)