Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions src/wasm.h
Original file line number Diff line number Diff line change
Expand Up @@ -953,21 +953,22 @@ class Call : public SpecificExpression<Expression::CallId> {
public:
Call(MixedArena& allocator) : operands(allocator) {}

bool isReturn = false;
ExpressionList operands;
Name target;
bool isReturn = false;

void finalize();
};

class CallIndirect : public SpecificExpression<Expression::CallIndirectId> {
public:
CallIndirect(MixedArena& allocator) : operands(allocator) {}

bool isReturn = false;
HeapType heapType;
ExpressionList operands;
Expression* target;
Name table;
bool isReturn = false;

void finalize();
};
Expand Down Expand Up @@ -1061,12 +1062,12 @@ class AtomicRMW : public SpecificExpression<Expression::AtomicRMWId> {
AtomicRMW(MixedArena& allocator) : AtomicRMW() {}

AtomicRMWOp op;
MemoryOrder order = MemoryOrder::SeqCst;
uint8_t bytes;
Address offset;
Expression* ptr;
Expression* value;
Name memory;
MemoryOrder order = MemoryOrder::SeqCst;

void finalize();
};
Expand All @@ -1077,12 +1078,12 @@ class AtomicCmpxchg : public SpecificExpression<Expression::AtomicCmpxchgId> {
AtomicCmpxchg(MixedArena& allocator) : AtomicCmpxchg() {}

uint8_t bytes;
MemoryOrder order = MemoryOrder::SeqCst;
Address offset;
Expression* ptr;
Expression* expected;
Expression* replacement;
Name memory;
MemoryOrder order = MemoryOrder::SeqCst;

void finalize();
};
Expand Down Expand Up @@ -1146,9 +1147,9 @@ class SIMDReplace : public SpecificExpression<Expression::SIMDReplaceId> {
SIMDReplace() = default;
SIMDReplace(MixedArena& allocator) : SIMDReplace() {}

uint8_t index;
SIMDReplaceOp op;
Expression* vec;
uint8_t index;
Expression* value;

void finalize();
Expand Down Expand Up @@ -1663,18 +1664,19 @@ class I31Get : public SpecificExpression<Expression::I31GetId> {
I31Get() = default;
I31Get(MixedArena& allocator) {}

Expression* i31;
bool signed_ = false;
Expression* i31;

void finalize();
};

class CallRef : public SpecificExpression<Expression::CallRefId> {
public:
CallRef(MixedArena& allocator) : operands(allocator) {}

bool isReturn = false;
ExpressionList operands;
Expression* target;
bool isReturn = false;

void finalize();
};
Expand Down Expand Up @@ -1794,10 +1796,10 @@ class StructRMW : public SpecificExpression<Expression::StructRMWId> {
StructRMW(MixedArena& allocator) {}

AtomicRMWOp op;
MemoryOrder order;
Index index;
Expression* ref;
Expression* value;
MemoryOrder order;

void finalize();
};
Expand All @@ -1807,11 +1809,11 @@ class StructCmpxchg : public SpecificExpression<Expression::StructCmpxchgId> {
StructCmpxchg() = default;
StructCmpxchg(MixedArena& allocator) {}

MemoryOrder order;
Index index;
Expression* ref;
Expression* expected;
Expression* replacement;
MemoryOrder order;

void finalize();
};
Expand Down Expand Up @@ -2040,11 +2042,11 @@ class ArrayRMW : public SpecificExpression<Expression::ArrayRMWId> {
ArrayRMW() = default;
ArrayRMW(MixedArena& allocator) {}

MemoryOrder order;
AtomicRMWOp op;
Expression* ref;
Expression* index;
Expression* value;
MemoryOrder order;

void finalize();
};
Expand All @@ -2054,11 +2056,11 @@ class ArrayCmpxchg : public SpecificExpression<Expression::ArrayCmpxchgId> {
ArrayCmpxchg() = default;
ArrayCmpxchg(MixedArena& allocator) {}

MemoryOrder order;
Expression* ref;
Expression* index;
Expression* expected;
Expression* replacement;
MemoryOrder order;

void finalize();
};
Expand Down
22 changes: 11 additions & 11 deletions test/gtest/sizes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ TEST(SizesTest, ExpressionSizes) {
EXPECT_EQ(sizeof(Loop), 32u);
EXPECT_EQ(sizeof(Break), 40u);
EXPECT_EQ(sizeof(Switch), 72u);
EXPECT_EQ(sizeof(Call), 64u);
EXPECT_EQ(sizeof(CallIndirect), 80u);
EXPECT_EQ(sizeof(Call), 56u);
EXPECT_EQ(sizeof(CallIndirect), 72u);
EXPECT_EQ(sizeof(LocalGet), 16u);
EXPECT_EQ(sizeof(LocalSet), 24u);
EXPECT_EQ(sizeof(GlobalGet), 24u);
Expand All @@ -34,14 +34,14 @@ TEST(SizesTest, ExpressionSizes) {
EXPECT_EQ(sizeof(MemoryGrow), 32u);
EXPECT_EQ(sizeof(Nop), 16u);
EXPECT_EQ(sizeof(Unreachable), 16u);
EXPECT_EQ(sizeof(AtomicRMW), 64u);
EXPECT_EQ(sizeof(AtomicCmpxchg), 64u);
EXPECT_EQ(sizeof(AtomicRMW), 56u);
EXPECT_EQ(sizeof(AtomicCmpxchg), 56u);
EXPECT_EQ(sizeof(AtomicWait), 64u);
EXPECT_EQ(sizeof(AtomicNotify), 48u);
EXPECT_EQ(sizeof(AtomicFence), 16u);
EXPECT_EQ(sizeof(Pause), 16u);
EXPECT_EQ(sizeof(SIMDExtract), 24u);
EXPECT_EQ(sizeof(SIMDReplace), 40u);
EXPECT_EQ(sizeof(SIMDReplace), 32u);
EXPECT_EQ(sizeof(SIMDShuffle), 48u);
EXPECT_EQ(sizeof(SIMDTernary), 40u);
EXPECT_EQ(sizeof(SIMDShift), 32u);
Expand Down Expand Up @@ -72,17 +72,17 @@ TEST(SizesTest, ExpressionSizes) {
EXPECT_EQ(sizeof(TupleMake), 48u);
EXPECT_EQ(sizeof(TupleExtract), 24u);
EXPECT_EQ(sizeof(RefI31), 24u);
EXPECT_EQ(sizeof(I31Get), 32u);
EXPECT_EQ(sizeof(CallRef), 64u);
EXPECT_EQ(sizeof(I31Get), 24u);
EXPECT_EQ(sizeof(CallRef), 56u);
EXPECT_EQ(sizeof(RefTest), 32u);
EXPECT_EQ(sizeof(RefCast), 32u);
EXPECT_EQ(sizeof(RefGetDesc), 24u);
EXPECT_EQ(sizeof(BrOn), 48u);
EXPECT_EQ(sizeof(StructNew), 56u);
EXPECT_EQ(sizeof(StructGet), 24u);
EXPECT_EQ(sizeof(StructSet), 32u);
EXPECT_EQ(sizeof(StructRMW), 48u);
EXPECT_EQ(sizeof(StructCmpxchg), 48u);
EXPECT_EQ(sizeof(StructRMW), 40u);
EXPECT_EQ(sizeof(StructCmpxchg), 40u);
EXPECT_EQ(sizeof(ArrayNew), 32u);
EXPECT_EQ(sizeof(ArrayNewData), 40u);
EXPECT_EQ(sizeof(ArrayNewElem), 40u);
Expand All @@ -96,8 +96,8 @@ TEST(SizesTest, ExpressionSizes) {
EXPECT_EQ(sizeof(ArrayFill), 48u);
EXPECT_EQ(sizeof(ArrayInitData), 56u);
EXPECT_EQ(sizeof(ArrayInitElem), 56u);
EXPECT_EQ(sizeof(ArrayRMW), 48u);
EXPECT_EQ(sizeof(ArrayCmpxchg), 56u);
EXPECT_EQ(sizeof(ArrayRMW), 40u);
EXPECT_EQ(sizeof(ArrayCmpxchg), 48u);
EXPECT_EQ(sizeof(RefAs), 24u);
EXPECT_EQ(sizeof(StringNew), 40u);
EXPECT_EQ(sizeof(StringConst), 24u);
Expand Down
Loading