|
17 | 17 | #ifndef __WalrusByteCode__
|
18 | 18 | #define __WalrusByteCode__
|
19 | 19 |
|
| 20 | +#include "Walrus.h" |
20 | 21 | #if !defined(NDEBUG)
|
21 | 22 | #include <cinttypes>
|
22 | 23 | #include "runtime/Module.h"
|
@@ -663,6 +664,7 @@ class BinaryOperation : public ByteCode {
|
663 | 664 | const ByteCodeStackOffset* srcOffset() const { return m_srcOffset; }
|
664 | 665 | ByteCodeStackOffset dstOffset() const { return m_dstOffset; }
|
665 | 666 | void setDstOffset(ByteCodeStackOffset o) { m_dstOffset = o; }
|
| 667 | + void setSrcOffset(ByteCodeStackOffset o, size_t index) { m_srcOffset[index] = o; } |
666 | 668 | #if !defined(NDEBUG)
|
667 | 669 | void dump(size_t pos)
|
668 | 670 | {
|
@@ -705,6 +707,14 @@ class UnaryOperation : public ByteCode {
|
705 | 707 | }
|
706 | 708 | ByteCodeStackOffset srcOffset() const { return m_srcOffset; }
|
707 | 709 | ByteCodeStackOffset dstOffset() const { return m_dstOffset; }
|
| 710 | + void setDstOffset(ByteCodeStackOffset newOffset) |
| 711 | + { |
| 712 | + m_dstOffset = newOffset; |
| 713 | + } |
| 714 | + void setSrcOffset(ByteCodeStackOffset newOffset) |
| 715 | + { |
| 716 | + m_srcOffset = newOffset; |
| 717 | + } |
708 | 718 | #if !defined(NDEBUG)
|
709 | 719 | void dump(size_t pos)
|
710 | 720 | {
|
@@ -874,6 +884,14 @@ class Move32 : public ByteCode {
|
874 | 884 |
|
875 | 885 | ByteCodeStackOffset srcOffset() const { return m_srcOffset; }
|
876 | 886 | ByteCodeStackOffset dstOffset() const { return m_dstOffset; }
|
| 887 | + void setDstOffset(ByteCodeStackOffset newOffset) |
| 888 | + { |
| 889 | + m_dstOffset = newOffset; |
| 890 | + } |
| 891 | + void setSrcOffset(ByteCodeStackOffset newOffset) |
| 892 | + { |
| 893 | + m_srcOffset = newOffset; |
| 894 | + } |
877 | 895 |
|
878 | 896 | #if !defined(NDEBUG)
|
879 | 897 | void dump(size_t pos)
|
@@ -2037,6 +2055,7 @@ class GlobalGet32 : public ByteCode {
|
2037 | 2055 | }
|
2038 | 2056 |
|
2039 | 2057 | ByteCodeStackOffset dstOffset() const { return m_dstOffset; }
|
| 2058 | + void setDstOffset(ByteCodeStackOffset o) { m_dstOffset = o; } |
2040 | 2059 | uint32_t index() const { return m_index; }
|
2041 | 2060 |
|
2042 | 2061 | #if !defined(NDEBUG)
|
@@ -2255,7 +2274,7 @@ class End : public ByteCode {
|
2255 | 2274 | {
|
2256 | 2275 | }
|
2257 | 2276 |
|
2258 |
| - ByteCodeStackOffset* resultOffsets() const |
| 2277 | + ByteCodeStackOffset* resultOffsets() |
2259 | 2278 | {
|
2260 | 2279 | return reinterpret_cast<ByteCodeStackOffset*>(reinterpret_cast<size_t>(this) + sizeof(End));
|
2261 | 2280 | }
|
|
0 commit comments