Skip to content

Commit

Permalink
[WIP] Implement live variable analysis
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Laszlo Kulcsar <kuladam@inf.u-szeged.hu>
  • Loading branch information
kulcsaradam committed Feb 26, 2024
1 parent b0c5ec7 commit 6660ba7
Show file tree
Hide file tree
Showing 5 changed files with 630 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/interpreter/ByteCode.h
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,7 @@ class BinaryOperation : public ByteCode {
const ByteCodeStackOffset* srcOffset() const { return m_srcOffset; }
ByteCodeStackOffset dstOffset() const { return m_dstOffset; }
void setDstOffset(ByteCodeStackOffset o) { m_dstOffset = o; }
void setSrcOffset(ByteCodeStackOffset o, size_t index) { m_srcOffset[index] = o; }
#if !defined(NDEBUG)
void dump(size_t pos)
{
Expand Down Expand Up @@ -705,6 +706,14 @@ class UnaryOperation : public ByteCode {
}
ByteCodeStackOffset srcOffset() const { return m_srcOffset; }
ByteCodeStackOffset dstOffset() const { return m_dstOffset; }
void setDstOffset(ByteCodeStackOffset newOffset)
{
m_dstOffset = newOffset;
}
void setSrcOffset(ByteCodeStackOffset newOffset)
{
m_srcOffset = newOffset;
}
#if !defined(NDEBUG)
void dump(size_t pos)
{
Expand Down Expand Up @@ -874,6 +883,14 @@ class Move32 : public ByteCode {

ByteCodeStackOffset srcOffset() const { return m_srcOffset; }
ByteCodeStackOffset dstOffset() const { return m_dstOffset; }
void setDstOffset(ByteCodeStackOffset newOffset)
{
m_dstOffset = newOffset;
}
void setSrcOffset(ByteCodeStackOffset newOffset)
{
m_srcOffset = newOffset;
}

#if !defined(NDEBUG)
void dump(size_t pos)
Expand Down Expand Up @@ -2255,7 +2272,7 @@ class End : public ByteCode {
{
}

ByteCodeStackOffset* resultOffsets() const
ByteCodeStackOffset* resultOffsets()
{
return reinterpret_cast<ByteCodeStackOffset*>(reinterpret_cast<size_t>(this) + sizeof(End));
}
Expand Down
Loading

0 comments on commit 6660ba7

Please sign in to comment.