Skip to content

Commit 29ef8fa

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

File tree

5 files changed

+576
-0
lines changed

5 files changed

+576
-0
lines changed

src/interpreter/ByteCode.h

Lines changed: 17 additions & 0 deletions
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)

0 commit comments

Comments
 (0)