diff options
| author | Graydon Hoare <graydon@mozilla.com> | 2012-05-03 12:56:55 -0700 |
|---|---|---|
| committer | Graydon Hoare <graydon@mozilla.com> | 2012-05-03 13:09:02 -0700 |
| commit | 11a5d10bf2958c642ae6a7c4afff8e181aa2167d (patch) | |
| tree | 94e14a4863f8ff951f82556485146960d5584b8a /src/rt/rust_shape.cpp | |
| parent | e1fc7d5f0126e4c213cac589bf301814e0327b9e (diff) | |
| download | rust-11a5d10bf2958c642ae6a7c4afff8e181aa2167d.tar.gz rust-11a5d10bf2958c642ae6a7c4afff8e181aa2167d.zip | |
Implement better shape code for evec, estr.
Diffstat (limited to 'src/rt/rust_shape.cpp')
| -rw-r--r-- | src/rt/rust_shape.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/rt/rust_shape.cpp b/src/rt/rust_shape.cpp index 0413b7f9493..9f3fbbed89e 100644 --- a/src/rt/rust_shape.cpp +++ b/src/rt/rust_shape.cpp @@ -254,6 +254,9 @@ class cmp : public data<cmp,ptr_pair> { friend class data<cmp,ptr_pair>; private: + void walk_slice2(bool is_pod, + const std::pair<ptr_pair,ptr_pair> &data_range); + void walk_vec2(bool is_pod, const std::pair<ptr_pair,ptr_pair> &data_range); @@ -274,6 +277,12 @@ private: result = sub.result; } + inline void walk_rptr_contents2(cmp &sub) { + sub.align = true; + sub.walk(); + result = sub.result; + } + inline void cmp_two_pointers() { ALIGN_TO(rust_alignof<void *>()); data_pair<uint8_t *> fst = bump_dp<uint8_t *>(dp); @@ -341,6 +350,16 @@ public: walk_vec2(is_pod, get_vec_data_range(dp)); } + void walk_slice2(bool is_pod, bool is_str) { + // Slices compare just like vecs. + walk_vec2(is_pod, get_slice_data_range(is_str, dp)); + } + + void walk_fixedvec2(uint16_t sz, bool is_pod) { + // Fixedvecs compare just like vecs. + walk_vec2(is_pod, get_fixedvec_data_range(sz, dp)); + } + void walk_box2() { data<cmp,ptr_pair>::walk_box_contents1(); } @@ -349,6 +368,10 @@ public: data<cmp,ptr_pair>::walk_uniq_contents1(); } + void walk_rptr2() { + data<cmp,ptr_pair>::walk_rptr_contents1(); + } + void walk_iface2() { data<cmp,ptr_pair>::walk_box_contents1(); } |
