script optimization for record operations sourced (in part) from other records

This commit is contained in:
Vern Paxson 2024-05-10 20:22:04 -07:00 committed by Arne Welzel
parent eb5ea66012
commit 4b719ef45a
21 changed files with 953 additions and 50 deletions

View file

@ -484,20 +484,34 @@ public:
// store here.
bool can_change_non_locals = false;
// The following is used for constructing records, to map elements in
// slots/constants/types to record field offsets.
// The following is used for constructing records or in record chain
// operations, to map elements in slots/constants/types to record field
// offsets.
std::vector<int> map;
// The following is used when we need two maps, a LHS one (done with
// the above) and a RHS one.
std::vector<int> rhs_map;
// ... and the following when we need *three* (for constructing certain
// types of records). We could hack it in by adding onto "map" but
// this is cleaner, and we're not really concerned with the size of
// ZAM auxiliary information as it's not that commonly used, and doesn't
// grow during execution.
std::vector<int> lhs_map;
// For operations that need to track types corresponding to other vectors.
std::vector<TypePtr> types;
// For operations that mix managed and unmanaged assignments.
std::vector<bool> is_managed;
///// The following four apply to looping over the elements of tables.
// Frame slots of iteration variables, such as "[v1, v2, v3] in aggr".
// A negative value means "skip assignment".
std::vector<int> loop_vars;
// Their types and whether they're managed.
std::vector<TypePtr> loop_var_types;
std::vector<bool> lvt_is_managed;
// Type associated with the "value" entry, for "k, value in aggr"
// iteration.
TypePtr value_var_type;