rt: Implement comparison of functions, objects, ports, channels, and tasks
This commit is contained in:
parent
ade998d743
commit
1f8e0fa083
1 changed files with 21 additions and 1 deletions
|
|
@ -1031,11 +1031,25 @@ private:
|
|||
void walk_vec(bool align, bool is_pod,
|
||||
const std::pair<ptr_pair,ptr_pair> &data_range);
|
||||
|
||||
void walk_subcontext(bool align, cmp &sub) {
|
||||
inline void walk_subcontext(bool align, cmp &sub) {
|
||||
sub.walk(align);
|
||||
result = sub.result;
|
||||
}
|
||||
|
||||
inline void cmp_two_pointers(bool align) {
|
||||
if (align) dp = align_to(dp, ALIGNOF(uint8_t *) * 2);
|
||||
data_pair<uint8_t *> fst = bump_dp<uint8_t *>(dp);
|
||||
data_pair<uint8_t *> snd = bump_dp<uint8_t *>(dp);
|
||||
cmp_number(fst);
|
||||
if (!result)
|
||||
cmp_number(snd);
|
||||
}
|
||||
|
||||
inline void cmp_pointer(bool align) {
|
||||
if (align) dp = align_to(dp, ALIGNOF(uint8_t *));
|
||||
cmp_number(bump_dp<uint8_t *>(dp));
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void cmp_number(const data_pair<T> &nums) {
|
||||
result = (nums.fst < nums.snd) ? -1 : (nums.fst == nums.snd) ? 0 : 1;
|
||||
|
|
@ -1078,6 +1092,12 @@ public:
|
|||
return walk_vec(align, is_pod, get_ivec_data_range(dp));
|
||||
}
|
||||
|
||||
void walk_fn(bool align) { return cmp_two_pointers(align); }
|
||||
void walk_obj(bool align) { return cmp_two_pointers(align); }
|
||||
void walk_port(bool align) { return cmp_pointer(align); }
|
||||
void walk_chan(bool align) { return cmp_pointer(align); }
|
||||
void walk_task(bool align) { return cmp_pointer(align); }
|
||||
|
||||
void walk_tag(bool align, tag_info &tinfo,
|
||||
const data_pair<uint32_t> &tag_variants);
|
||||
void walk_box(bool align);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue