Skip to content

Commit 81d0c25

Browse files
PR updates
1 parent 9f98b32 commit 81d0c25

5 files changed

Lines changed: 25 additions & 9 deletions

File tree

src/wasm-delegations-fields.def

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -933,10 +933,10 @@ DELEGATE_FIELD_CASE_END(StructNotify)
933933

934934
DELEGATE_FIELD_CASE_START(WideIntAddSub)
935935
DELEGATE_FIELD_INT(WideIntAddSub, op)
936-
DELEGATE_FIELD_CHILD(WideIntAddSub, leftLow)
937-
DELEGATE_FIELD_CHILD(WideIntAddSub, leftHigh)
938-
DELEGATE_FIELD_CHILD(WideIntAddSub, rightLow)
939936
DELEGATE_FIELD_CHILD(WideIntAddSub, rightHigh)
937+
DELEGATE_FIELD_CHILD(WideIntAddSub, rightLow)
938+
DELEGATE_FIELD_CHILD(WideIntAddSub, leftHigh)
939+
DELEGATE_FIELD_CHILD(WideIntAddSub, leftLow)
940940
DELEGATE_FIELD_CASE_END(WideIntAddSub)
941941

942942
DELEGATE_FIELD_MAIN_END

src/wasm-type.h

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -581,14 +581,18 @@ class Type {
581581
};
582582

583583
Iterator begin() const { return Iterator{{this, 0}}; }
584-
Iterator end() const { return Iterator{{this, size()}}; }
584+
Iterator end() const {
585+
return Iterator{{this, size()}};
586+
}
585587
std::reverse_iterator<Iterator> rbegin() const {
586588
return std::make_reverse_iterator(end());
587589
}
588590
std::reverse_iterator<Iterator> rend() const {
589591
return std::make_reverse_iterator(begin());
590592
}
591-
const Type& operator[](size_t i) const { return *Iterator{{this, i}}; }
593+
const Type& operator[](size_t i) const {
594+
return *Iterator{{this, i}};
595+
}
592596
};
593597

594598
Type Type::asWrittenGivenFeatures(FeatureSet feats) const {
@@ -645,6 +649,8 @@ constexpr HeapType noexn = HeapType::noexn;
645649
HeapType getMutI8Array();
646650
HeapType getMutI16Array();
647651

652+
Type getI64Pair();
653+
648654
} // namespace HeapTypes
649655

650656
// A recursion group consisting of one or more HeapTypes. HeapTypes with single
@@ -669,8 +675,12 @@ class RecGroup {
669675
};
670676

671677
Iterator begin() const { return Iterator{{this, 0}}; }
672-
Iterator end() const { return Iterator{{this, size()}}; }
673-
HeapType operator[](size_t i) const { return *Iterator{{this, i}}; }
678+
Iterator end() const {
679+
return Iterator{{this, size()}};
680+
}
681+
HeapType operator[](size_t i) const {
682+
return *Iterator{{this, i}};
683+
}
674684
};
675685

676686
struct Signature {

src/wasm/wasm-type.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2848,6 +2848,11 @@ HeapType getMutI16Array() {
28482848
return i16Array;
28492849
}
28502850

2851+
Type getI64Pair() {
2852+
static Type i64Pair({Type::i64, Type::i64});
2853+
return i64Pair;
2854+
}
2855+
28512856
} // namespace wasm::HeapTypes
28522857

28532858
namespace std {

src/wasm/wasm-validator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2455,7 +2455,7 @@ void FunctionValidator::visitWideIntAddSub(WideIntAddSub* curr) {
24552455
for (auto* operand :
24562456
{curr->leftLow, curr->leftHigh, curr->rightLow, curr->rightHigh}) {
24572457
shouldBeEqualOrFirstIsUnreachable(operand->type,
2458-
Type(Type::BasicType::i64),
2458+
Type(Type::i64),
24592459
curr,
24602460
"wide binary child types must be i64");
24612461
}

src/wasm/wasm.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,8 @@ void WideIntAddSub::finalize() {
810810
rightHigh->type == Type::unreachable) {
811811
type = Type::unreachable;
812812
} else {
813-
type = Type({Type::i64, Type::i64});
813+
static Type i64Pair = HeapTypes::getI64Pair();
814+
type = i64Pair;
814815
}
815816
}
816817

0 commit comments

Comments
 (0)