|
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)
|
@@ -951,7 +969,9 @@ class Load32 : public ByteCode {
|
951 | 969 | }
|
952 | 970 |
|
953 | 971 | ByteCodeStackOffset srcOffset() const { return m_srcOffset; }
|
| 972 | + void setSrcOffset(Walrus::ByteCodeStackOffset o) { m_srcOffset = o; } |
954 | 973 | ByteCodeStackOffset dstOffset() const { return m_dstOffset; }
|
| 974 | + void setDstOffset(Walrus::ByteCodeStackOffset o) { m_dstOffset = o; } |
955 | 975 |
|
956 | 976 | #if !defined(NDEBUG)
|
957 | 977 | void dump(size_t pos)
|
@@ -1003,7 +1023,9 @@ class Store32 : public ByteCode {
|
1003 | 1023 | }
|
1004 | 1024 |
|
1005 | 1025 | ByteCodeStackOffset src0Offset() const { return m_src0Offset; }
|
| 1026 | + void setSrc0Offset(Walrus::ByteCodeStackOffset o) { m_src0Offset = o; } |
1006 | 1027 | ByteCodeStackOffset src1Offset() const { return m_src1Offset; }
|
| 1028 | + void setSrc1Offset(Walrus::ByteCodeStackOffset o) { m_src1Offset = o; } |
1007 | 1029 |
|
1008 | 1030 | #if !defined(NDEBUG)
|
1009 | 1031 | void dump(size_t pos)
|
@@ -1388,7 +1410,9 @@ class MemoryLoad : public ByteCode {
|
1388 | 1410 |
|
1389 | 1411 | uint32_t offset() const { return m_offset; }
|
1390 | 1412 | ByteCodeStackOffset srcOffset() const { return m_srcOffset; }
|
| 1413 | + void setSrcOffset(Walrus::ByteCodeStackOffset o) { m_srcOffset = o; } |
1391 | 1414 | ByteCodeStackOffset dstOffset() const { return m_dstOffset; }
|
| 1415 | + void setDstOffset(Walrus::ByteCodeStackOffset o) { m_dstOffset = o; } |
1392 | 1416 |
|
1393 | 1417 | #if !defined(NDEBUG)
|
1394 | 1418 | void dump(size_t pos)
|
@@ -1486,7 +1510,9 @@ class MemoryStore : public ByteCode {
|
1486 | 1510 |
|
1487 | 1511 | uint32_t offset() const { return m_offset; }
|
1488 | 1512 | ByteCodeStackOffset src0Offset() const { return m_src0Offset; }
|
| 1513 | + void setSrc0Offset(Walrus::ByteCodeStackOffset o) { m_src0Offset = o; } |
1489 | 1514 | ByteCodeStackOffset src1Offset() const { return m_src1Offset; }
|
| 1515 | + void setSrc1Offset(Walrus::ByteCodeStackOffset o) { m_src1Offset = o; } |
1490 | 1516 |
|
1491 | 1517 | #if !defined(NDEBUG)
|
1492 | 1518 | void dump(size_t pos)
|
@@ -2037,6 +2063,7 @@ class GlobalGet32 : public ByteCode {
|
2037 | 2063 | }
|
2038 | 2064 |
|
2039 | 2065 | ByteCodeStackOffset dstOffset() const { return m_dstOffset; }
|
| 2066 | + void setDstOffset(ByteCodeStackOffset o) { m_dstOffset = o; } |
2040 | 2067 | uint32_t index() const { return m_index; }
|
2041 | 2068 |
|
2042 | 2069 | #if !defined(NDEBUG)
|
@@ -2255,7 +2282,7 @@ class End : public ByteCode {
|
2255 | 2282 | {
|
2256 | 2283 | }
|
2257 | 2284 |
|
2258 |
| - ByteCodeStackOffset* resultOffsets() const |
| 2285 | + ByteCodeStackOffset* resultOffsets() |
2259 | 2286 | {
|
2260 | 2287 | return reinterpret_cast<ByteCodeStackOffset*>(reinterpret_cast<size_t>(this) + sizeof(End));
|
2261 | 2288 | }
|
|
0 commit comments