From 11a5d10bf2958c642ae6a7c4afff8e181aa2167d Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Thu, 3 May 2012 12:56:55 -0700 Subject: Implement better shape code for evec, estr. --- src/rt/rust_shape.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/rt/rust_shape.cpp') 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 { friend class data; private: + void walk_slice2(bool is_pod, + const std::pair &data_range); + void walk_vec2(bool is_pod, const std::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()); data_pair fst = bump_dp(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::walk_box_contents1(); } @@ -349,6 +368,10 @@ public: data::walk_uniq_contents1(); } + void walk_rptr2() { + data::walk_rptr_contents1(); + } + void walk_iface2() { data::walk_box_contents1(); } -- cgit 1.4.1-3-g733a5