Skip to content

Commit 6660ba7

Browse files
committed
[WIP] Implement live variable analysis
Signed-off-by: Adam Laszlo Kulcsar <[email protected]>
1 parent b0c5ec7 commit 6660ba7

File tree

5 files changed

+630
-1
lines changed

5 files changed

+630
-1
lines changed

src/interpreter/ByteCode.h

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,7 @@ class BinaryOperation : public ByteCode {
663663
const ByteCodeStackOffset* srcOffset() const { return m_srcOffset; }
664664
ByteCodeStackOffset dstOffset() const { return m_dstOffset; }
665665
void setDstOffset(ByteCodeStackOffset o) { m_dstOffset = o; }
666+
void setSrcOffset(ByteCodeStackOffset o, size_t index) { m_srcOffset[index] = o; }
666667
#if !defined(NDEBUG)
667668
void dump(size_t pos)
668669
{
@@ -705,6 +706,14 @@ class UnaryOperation : public ByteCode {
705706
}
706707
ByteCodeStackOffset srcOffset() const { return m_srcOffset; }
707708
ByteCodeStackOffset dstOffset() const { return m_dstOffset; }
709+
void setDstOffset(ByteCodeStackOffset newOffset)
710+
{
711+
m_dstOffset = newOffset;
712+
}
713+
void setSrcOffset(ByteCodeStackOffset newOffset)
714+
{
715+
m_srcOffset = newOffset;
716+
}
708717
#if !defined(NDEBUG)
709718
void dump(size_t pos)
710719
{
@@ -874,6 +883,14 @@ class Move32 : public ByteCode {
874883

875884
ByteCodeStackOffset srcOffset() const { return m_srcOffset; }
876885
ByteCodeStackOffset dstOffset() const { return m_dstOffset; }
886+
void setDstOffset(ByteCodeStackOffset newOffset)
887+
{
888+
m_dstOffset = newOffset;
889+
}
890+
void setSrcOffset(ByteCodeStackOffset newOffset)
891+
{
892+
m_srcOffset = newOffset;
893+
}
877894

878895
#if !defined(NDEBUG)
879896
void dump(size_t pos)
@@ -2255,7 +2272,7 @@ class End : public ByteCode {
22552272
{
22562273
}
22572274

2258-
ByteCodeStackOffset* resultOffsets() const
2275+
ByteCodeStackOffset* resultOffsets()
22592276
{
22602277
return reinterpret_cast<ByteCodeStackOffset*>(reinterpret_cast<size_t>(this) + sizeof(End));
22612278
}

0 commit comments

Comments
 (0)