diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-11-11 15:54:19 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-11-11 15:54:19 -0800 |
commit | 6d007fda037331e7761d2a9ed3a2e435131daf7e (patch) | |
tree | 656aa7fe284b2b11c01f0389fe81f1b31025ce4e /html/036refcount.cc.html | |
parent | c9f920da6e6b3e7049f078fea35e08256cae7c5b (diff) | |
download | mu-6d007fda037331e7761d2a9ed3a2e435131daf7e.tar.gz |
3667
Diffstat (limited to 'html/036refcount.cc.html')
-rw-r--r-- | html/036refcount.cc.html | 111 |
1 files changed, 81 insertions, 30 deletions
diff --git a/html/036refcount.cc.html b/html/036refcount.cc.html index 54c790d3..fb44f1f0 100644 --- a/html/036refcount.cc.html +++ b/html/036refcount.cc.html @@ -90,7 +90,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Normal">if</span> <span class="Delimiter">(</span>is_mu_address<span class="Delimiter">(</span>canonized_x<span class="Delimiter">))</span> <span class="Delimiter">{</span> assert<span class="Delimiter">(</span>canonized_x<span class="Delimiter">.</span>value<span class="Delimiter">);</span> assert<span class="Delimiter">(</span>!canonized_x<span class="Delimiter">.</span>metadata<span class="Delimiter">.</span>size<span class="Delimiter">);</span> - decrement_refcount<span class="Delimiter">(</span>get_or_insert<span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> canonized_x<span class="Delimiter">.</span>value<span class="Delimiter">),</span> canonized_x<span class="Delimiter">.</span>type<span class="Delimiter">-></span>right<span class="Delimiter">,</span> payload_size<span class="Delimiter">(</span>canonized_x<span class="Delimiter">));</span> + decrement_refcount<span class="Delimiter">(</span>get_or_insert<span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> canonized_x<span class="Delimiter">.</span>value<span class="Delimiter">),</span> payload_type<span class="Delimiter">(</span>canonized_x<span class="Delimiter">.</span>type<span class="Delimiter">),</span> payload_size<span class="Delimiter">(</span>canonized_x<span class="Delimiter">));</span> <span class="Delimiter">}</span> <span class="Comment">// End Decrement Refcounts(canonized_x)</span> <span class="Delimiter">}</span> @@ -196,6 +196,9 @@ update_any_refcounts<span class="Delimiter">(</span>element<span class="Delimite <span class="traceContains">+mem: incrementing refcount of 1000: 1 -> 2</span> <span class="Delimiter">:(after "Write Memory in PUT_INDEX in Run")</span> +reagent<span class="Comment">/*</span><span class="Comment">local</span><span class="Comment">*/</span> element<span class="Delimiter">;</span> +element<span class="Delimiter">.</span>set_value<span class="Delimiter">(</span>address<span class="Delimiter">);</span> +element<span class="Delimiter">.</span>type = copy_array_element<span class="Delimiter">(</span>base<span class="Delimiter">.</span>type<span class="Delimiter">);</span> update_any_refcounts<span class="Delimiter">(</span>element<span class="Delimiter">,</span> value<span class="Delimiter">);</span> <span class="Delimiter">:(scenario refcounts_maybe_convert)</span> @@ -346,21 +349,20 @@ Transform<span class="Delimiter">.</span>push_back<span class="Delimiter">(</spa <span class="Normal">void</span> compute_container_address_offsets<span class="Delimiter">(</span><span class="Normal">const</span> type_tree* type<span class="Delimiter">,</span> <span class="Normal">const</span> string& location_for_error_messages<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span class="Normal">if</span> <span class="Delimiter">(</span>!type<span class="Delimiter">)</span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span class="Normal">if</span> <span class="Delimiter">(</span>!type<span class="Delimiter">-></span>atom<span class="Delimiter">)</span> <span class="Delimiter">{</span> - assert<span class="Delimiter">(</span>type<span class="Delimiter">-></span>left<span class="Delimiter">-></span>atom<span class="Delimiter">);</span> - <span class="Normal">if</span> <span class="Delimiter">(</span>type<span class="Delimiter">-></span>left<span class="Delimiter">-></span>name == <span class="Constant">"address"</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> - compute_container_address_offsets<span class="Delimiter">(</span>type<span class="Delimiter">-></span>right<span class="Delimiter">,</span> location_for_error_messages<span class="Delimiter">);</span> - <span class="Delimiter">}</span> - <span class="Normal">else</span> <span class="Normal">if</span> <span class="Delimiter">(</span>type<span class="Delimiter">-></span>left<span class="Delimiter">-></span>name == <span class="Constant">"array"</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> - <span class="Normal">const</span> type_tree* element_type = type<span class="Delimiter">-></span>right<span class="Delimiter">;</span> - <span class="Comment">// hack: support both array:num:3 and array:address:num</span> - <span class="Normal">if</span> <span class="Delimiter">(</span>!element_type<span class="Delimiter">-></span>atom && element_type<span class="Delimiter">-></span>right && element_type<span class="Delimiter">-></span>right<span class="Delimiter">-></span>atom && is_integer<span class="Delimiter">(</span>element_type<span class="Delimiter">-></span>right<span class="Delimiter">-></span>name<span class="Delimiter">))</span> - element_type = element_type<span class="Delimiter">-></span>left<span class="Delimiter">;</span> - compute_container_address_offsets<span class="Delimiter">(</span>element_type<span class="Delimiter">,</span> location_for_error_messages<span class="Delimiter">);</span> + <span class="Normal">if</span> <span class="Delimiter">(</span>!type<span class="Delimiter">-></span>left<span class="Delimiter">-></span>atom<span class="Delimiter">)</span> <span class="Delimiter">{</span> + raise << <span class="Constant">"invalid type "</span> << to_string<span class="Delimiter">(</span>type<span class="Delimiter">)</span> << location_for_error_messages << <span class="cSpecial">'\n'</span> << end<span class="Delimiter">();</span> + <span class="Identifier">return</span><span class="Delimiter">;</span> <span class="Delimiter">}</span> - <span class="Comment">// End compute_container_address_offsets Non-atom Cases</span> + <span class="Normal">if</span> <span class="Delimiter">(</span>type<span class="Delimiter">-></span>left<span class="Delimiter">-></span>name == <span class="Constant">"address"</span><span class="Delimiter">)</span> + compute_container_address_offsets<span class="Delimiter">(</span>payload_type<span class="Delimiter">(</span>type<span class="Delimiter">),</span> location_for_error_messages<span class="Delimiter">);</span> + <span class="Normal">else</span> <span class="Normal">if</span> <span class="Delimiter">(</span>type<span class="Delimiter">-></span>left<span class="Delimiter">-></span>name == <span class="Constant">"array"</span><span class="Delimiter">)</span> + compute_container_address_offsets<span class="Delimiter">(</span>array_element<span class="Delimiter">(</span>type<span class="Delimiter">),</span> location_for_error_messages<span class="Delimiter">);</span> + <span class="Comment">// End compute_container_address_offsets Non-atom Special-cases</span> <span class="Delimiter">}</span> - <span class="Normal">if</span> <span class="Delimiter">(</span>!contains_key<span class="Delimiter">(</span>Type<span class="Delimiter">,</span> root_type<span class="Delimiter">(</span>type<span class="Delimiter">)-></span>value<span class="Delimiter">))</span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span class="Comment">// error raised elsewhere</span> - type_info& info = get<span class="Delimiter">(</span>Type<span class="Delimiter">,</span> root_type<span class="Delimiter">(</span>type<span class="Delimiter">)-></span>value<span class="Delimiter">);</span> + <span class="Normal">const</span> type_tree* base_type = type<span class="Delimiter">;</span> + <span class="Comment">// Update base_type in compute_container_address_offsets</span> + <span class="Normal">if</span> <span class="Delimiter">(</span>!contains_key<span class="Delimiter">(</span>Type<span class="Delimiter">,</span> base_type<span class="Delimiter">-></span>value<span class="Delimiter">))</span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span class="Comment">// error raised elsewhere</span> + type_info& info = get<span class="Delimiter">(</span>Type<span class="Delimiter">,</span> base_type<span class="Delimiter">-></span>value<span class="Delimiter">);</span> <span class="Normal">if</span> <span class="Delimiter">(</span>info<span class="Delimiter">.</span>kind == CONTAINER<span class="Delimiter">)</span> <span class="Delimiter">{</span> compute_container_address_offsets<span class="Delimiter">(</span>info<span class="Delimiter">,</span> type<span class="Delimiter">,</span> location_for_error_messages<span class="Delimiter">);</span> <span class="Delimiter">}</span> @@ -388,28 +390,39 @@ Transform<span class="Delimiter">.</span>push_back<span class="Delimiter">(</spa <span class="Normal">void</span> append_addresses<span class="Delimiter">(</span><span class="Normal">int</span> base_offset<span class="Delimiter">,</span> <span class="Normal">const</span> type_tree* type<span class="Delimiter">,</span> map<set<tag_condition_info><span class="Delimiter">,</span> set<address_element_info> >& out<span class="Delimiter">,</span> <span class="Normal">const</span> set<tag_condition_info>& key<span class="Delimiter">,</span> <span class="Normal">const</span> string& location_for_error_messages<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span class="Normal">if</span> <span class="Delimiter">(</span>is_mu_address<span class="Delimiter">(</span>type<span class="Delimiter">))</span> <span class="Delimiter">{</span> - get_or_insert<span class="Delimiter">(</span>out<span class="Delimiter">,</span> key<span class="Delimiter">).</span>insert<span class="Delimiter">(</span>address_element_info<span class="Delimiter">(</span>base_offset<span class="Delimiter">,</span> <span class="Normal">new</span> type_tree<span class="Delimiter">(</span>*type<span class="Delimiter">-></span>right<span class="Delimiter">)));</span> + get_or_insert<span class="Delimiter">(</span>out<span class="Delimiter">,</span> key<span class="Delimiter">).</span>insert<span class="Delimiter">(</span>address_element_info<span class="Delimiter">(</span>base_offset<span class="Delimiter">,</span> <span class="Normal">new</span> type_tree<span class="Delimiter">(</span>*payload_type<span class="Delimiter">(</span>type<span class="Delimiter">))));</span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span class="Delimiter">}</span> - <span class="Normal">const</span> type_tree* root = root_type<span class="Delimiter">(</span>type<span class="Delimiter">);</span> - <span class="Normal">const</span> type_info& info = get<span class="Delimiter">(</span>Type<span class="Delimiter">,</span> root<span class="Delimiter">-></span>value<span class="Delimiter">);</span> + <span class="Normal">const</span> type_tree* base_type = type<span class="Delimiter">;</span> + <span class="Comment">// Update base_type in append_container_address_offsets</span> + <span class="Normal">const</span> type_info& info = get<span class="Delimiter">(</span>Type<span class="Delimiter">,</span> base_type<span class="Delimiter">-></span>value<span class="Delimiter">);</span> <span class="Normal">if</span> <span class="Delimiter">(</span>info<span class="Delimiter">.</span>kind == CONTAINER<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> curr_index = <span class="Constant">0</span><span class="Delimiter">,</span> curr_offset = base_offset<span class="Delimiter">;</span> curr_index < SIZE<span class="Delimiter">(</span>info<span class="Delimiter">.</span>elements<span class="Delimiter">);</span> ++curr_index<span class="Delimiter">)</span> <span class="Delimiter">{</span> - trace<span class="Delimiter">(</span><span class="Constant">9993</span><span class="Delimiter">,</span> <span class="Constant">"transform"</span><span class="Delimiter">)</span> << <span class="Constant">"checking container "</span> << root<span class="Delimiter">-></span>name << <span class="Constant">", element "</span> << curr_index << end<span class="Delimiter">();</span> - reagent<span class="Comment">/*</span><span class="Comment">copy</span><span class="Comment">*/</span> element = element_type<span class="Delimiter">(</span>type<span class="Delimiter">,</span> curr_index<span class="Delimiter">);</span> <span class="Comment">// not root</span> + trace<span class="Delimiter">(</span><span class="Constant">9993</span><span class="Delimiter">,</span> <span class="Constant">"transform"</span><span class="Delimiter">)</span> << <span class="Constant">"checking container "</span> << base_type<span class="Delimiter">-></span>name << <span class="Constant">", element "</span> << curr_index << end<span class="Delimiter">();</span> + reagent<span class="Comment">/*</span><span class="Comment">copy</span><span class="Comment">*/</span> element = element_type<span class="Delimiter">(</span>type<span class="Delimiter">,</span> curr_index<span class="Delimiter">);</span> <span class="Comment">// not base_type</span> <span class="Comment">// Compute Container Address Offset(element)</span> <span class="Normal">if</span> <span class="Delimiter">(</span>is_mu_address<span class="Delimiter">(</span>element<span class="Delimiter">))</span> <span class="Delimiter">{</span> trace<span class="Delimiter">(</span><span class="Constant">9993</span><span class="Delimiter">,</span> <span class="Constant">"transform"</span><span class="Delimiter">)</span> << <span class="Constant">"address at offset "</span> << curr_offset << end<span class="Delimiter">();</span> - get_or_insert<span class="Delimiter">(</span>out<span class="Delimiter">,</span> key<span class="Delimiter">).</span>insert<span class="Delimiter">(</span>address_element_info<span class="Delimiter">(</span>curr_offset<span class="Delimiter">,</span> <span class="Normal">new</span> type_tree<span class="Delimiter">(</span>*element<span class="Delimiter">.</span>type<span class="Delimiter">-></span>right<span class="Delimiter">)));</span> + get_or_insert<span class="Delimiter">(</span>out<span class="Delimiter">,</span> key<span class="Delimiter">).</span>insert<span class="Delimiter">(</span>address_element_info<span class="Delimiter">(</span>curr_offset<span class="Delimiter">,</span> <span class="Normal">new</span> type_tree<span class="Delimiter">(</span>*payload_type<span class="Delimiter">(</span>element<span class="Delimiter">.</span>type<span class="Delimiter">))));</span> ++curr_offset<span class="Delimiter">;</span> <span class="Delimiter">}</span> + <span class="Normal">else</span> <span class="Normal">if</span> <span class="Delimiter">(</span>is_mu_array<span class="Delimiter">(</span>element<span class="Delimiter">))</span> <span class="Delimiter">{</span> + curr_offset += <span class="Comment">/*</span><span class="Comment">array length</span><span class="Comment">*/</span><span class="Constant">1</span><span class="Delimiter">;</span> + <span class="Normal">const</span> type_tree* array_element_type = array_element<span class="Delimiter">(</span>element<span class="Delimiter">.</span>type<span class="Delimiter">);</span> + <span class="Normal">int</span> array_element_size = size_of<span class="Delimiter">(</span>array_element_type<span class="Delimiter">);</span> + <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> i = <span class="Constant">0</span><span class="Delimiter">;</span> i < static_array_length<span class="Delimiter">(</span>element<span class="Delimiter">.</span>type<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> + append_addresses<span class="Delimiter">(</span>curr_offset<span class="Delimiter">,</span> array_element_type<span class="Delimiter">,</span> out<span class="Delimiter">,</span> key<span class="Delimiter">,</span> location_for_error_messages<span class="Delimiter">);</span> + curr_offset += array_element_size<span class="Delimiter">;</span> + <span class="Delimiter">}</span> + <span class="Delimiter">}</span> <span class="Normal">else</span> <span class="Normal">if</span> <span class="Delimiter">(</span>is_mu_container<span class="Delimiter">(</span>element<span class="Delimiter">))</span> <span class="Delimiter">{</span> append_addresses<span class="Delimiter">(</span>curr_offset<span class="Delimiter">,</span> element<span class="Delimiter">.</span>type<span class="Delimiter">,</span> out<span class="Delimiter">,</span> key<span class="Delimiter">,</span> location_for_error_messages<span class="Delimiter">);</span> curr_offset += size_of<span class="Delimiter">(</span>element<span class="Delimiter">);</span> <span class="Delimiter">}</span> <span class="Normal">else</span> <span class="Normal">if</span> <span class="Delimiter">(</span>is_mu_exclusive_container<span class="Delimiter">(</span>element<span class="Delimiter">))</span> <span class="Delimiter">{</span> - <span class="Normal">const</span> type_tree* element_root_type = root_type<span class="Delimiter">(</span>element<span class="Delimiter">.</span>type<span class="Delimiter">);</span> - <span class="Normal">const</span> type_info& element_info = get<span class="Delimiter">(</span>Type<span class="Delimiter">,</span> element_root_type<span class="Delimiter">-></span>value<span class="Delimiter">);</span> + <span class="Normal">const</span> type_tree* element_base_type = element<span class="Delimiter">.</span>type<span class="Delimiter">;</span> + <span class="Comment">// Update element_base_type For Exclusive Container in append_addresses</span> + <span class="Normal">const</span> type_info& element_info = get<span class="Delimiter">(</span>Type<span class="Delimiter">,</span> element_base_type<span class="Delimiter">-></span>value<span class="Delimiter">);</span> <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> tag = <span class="Constant">0</span><span class="Delimiter">;</span> tag < SIZE<span class="Delimiter">(</span>element_info<span class="Delimiter">.</span>elements<span class="Delimiter">);</span> ++tag<span class="Delimiter">)</span> <span class="Delimiter">{</span> set<tag_condition_info> new_key = key<span class="Delimiter">;</span> new_key<span class="Delimiter">.</span>insert<span class="Delimiter">(</span>tag_condition_info<span class="Delimiter">(</span>curr_offset<span class="Delimiter">,</span> tag<span class="Delimiter">));</span> @@ -434,12 +447,6 @@ Transform<span class="Delimiter">.</span>push_back<span class="Delimiter">(</spa <span class="Delimiter">}</span> <span class="Delimiter">}</span> -<span class="Normal">int</span> payload_size<span class="Delimiter">(</span><span class="Normal">const</span> type_tree* type<span class="Delimiter">)</span> <span class="Delimiter">{</span> - assert<span class="Delimiter">(</span>type<span class="Delimiter">-></span>name == <span class="Constant">"address"</span><span class="Delimiter">);</span> - assert<span class="Delimiter">(</span>type<span class="Delimiter">-></span>right<span class="Delimiter">-></span>name != <span class="Constant">"array"</span><span class="Delimiter">);</span> - <span class="Identifier">return</span> size_of<span class="Delimiter">(</span>type<span class="Delimiter">-></span>right<span class="Delimiter">)</span> + <span class="Comment">/*</span><span class="Comment">refcount</span><span class="Comment">*/</span><span class="Constant">1</span><span class="Delimiter">;</span> -<span class="Delimiter">}</span> - <span class="Comment">//: for the following unit tests we'll do the work of the transform by hand</span> <span class="Delimiter">:(before "End Unit Tests")</span> @@ -739,8 +746,13 @@ Transform<span class="Delimiter">.</span>push_back<span class="Delimiter">(</spa <span class="Normal">const</span> container_metadata& metadata = get<span class="Delimiter">(</span>Container_metadata<span class="Delimiter">,</span> canonized_x<span class="Delimiter">.</span>type<span class="Delimiter">);</span> <span class="Normal">for</span> <span class="Delimiter">(</span>map<set<tag_condition_info><span class="Delimiter">,</span> set<address_element_info> >::const_iterator p = metadata<span class="Delimiter">.</span>address<span class="Delimiter">.</span>begin<span class="Delimiter">();</span> p != metadata<span class="Delimiter">.</span>address<span class="Delimiter">.</span>end<span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span class="Normal">if</span> <span class="Delimiter">(</span>!all_match<span class="Delimiter">(</span>data<span class="Delimiter">,</span> p<span class="Delimiter">-></span>first<span class="Delimiter">))</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> - <span class="Normal">for</span> <span class="Delimiter">(</span>set<address_element_info>::const_iterator info = p<span class="Delimiter">-></span>second<span class="Delimiter">.</span>begin<span class="Delimiter">();</span> info != p<span class="Delimiter">-></span>second<span class="Delimiter">.</span>end<span class="Delimiter">();</span> ++info<span class="Delimiter">)</span> - decrement_refcount<span class="Delimiter">(</span>get_or_insert<span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> canonized_x<span class="Delimiter">.</span>value + info<span class="Delimiter">-></span>offset<span class="Delimiter">),</span> info<span class="Delimiter">-></span>payload_type<span class="Delimiter">,</span> size_of<span class="Delimiter">(</span>info<span class="Delimiter">-></span>payload_type<span class="Delimiter">)</span>+<span class="Comment">/*</span><span class="Comment">refcount</span><span class="Comment">*/</span><span class="Constant">1</span><span class="Delimiter">);</span> + <span class="Normal">for</span> <span class="Delimiter">(</span>set<address_element_info>::const_iterator info = p<span class="Delimiter">-></span>second<span class="Delimiter">.</span>begin<span class="Delimiter">();</span> info != p<span class="Delimiter">-></span>second<span class="Delimiter">.</span>end<span class="Delimiter">();</span> ++info<span class="Delimiter">)</span> <span class="Delimiter">{</span> + <span class="Normal">int</span> element_address = get_or_insert<span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> canonized_x<span class="Delimiter">.</span>value + info<span class="Delimiter">-></span>offset<span class="Delimiter">);</span> + reagent<span class="Comment">/*</span><span class="Comment">local</span><span class="Comment">*/</span> element<span class="Delimiter">;</span> + element<span class="Delimiter">.</span>set_value<span class="Delimiter">(</span>element_address+<span class="Comment">/*</span><span class="Comment">skip refcount</span><span class="Comment">*/</span><span class="Constant">1</span><span class="Delimiter">);</span> + element<span class="Delimiter">.</span>type = <span class="Normal">new</span> type_tree<span class="Delimiter">(</span>*info<span class="Delimiter">-></span>payload_type<span class="Delimiter">);</span> + decrement_refcount<span class="Delimiter">(</span>element_address<span class="Delimiter">,</span> info<span class="Delimiter">-></span>payload_type<span class="Delimiter">,</span> size_of<span class="Delimiter">(</span>element<span class="Delimiter">)</span>+<span class="Comment">/*</span><span class="Comment">refcount</span><span class="Comment">*/</span><span class="Constant">1</span><span class="Delimiter">);</span> + <span class="Delimiter">}</span> <span class="Delimiter">}</span> <span class="Delimiter">}</span> @@ -948,6 +960,45 @@ Transform<span class="Delimiter">.</span>push_back<span class="Delimiter">(</spa <span class="traceContains">+run: {2: "foo"} <- merge {3: ("address" "array" "number")}</span> <span class="traceContains">+mem: decrementing refcount of 1000: 2 -> 1</span> +<span class="Delimiter">:(scenario refcounts_copy_address_within_static_array_within_container)</span> +<span class="muData">container</span> foo [ + <span class="Normal">a</span>:array:bar:<span class="Constant">3</span> + <span class="Normal">b</span>:address:num +] +<span class="muData">container</span> bar [ + <span class="Normal">y</span>:num + <span class="Normal">z</span>:address:num +] +<span class="muRecipe">def</span> main [ + <span class="Constant">1</span>:address:num<span class="Special"> <- </span><span class="Normal">new</span> <span class="Constant">number:type</span> + <span class="Constant">2</span>:bar<span class="Special"> <- </span>merge <span class="Constant">34</span><span class="Delimiter">,</span> <span class="Constant">1</span>:address:num + <span class="Constant">10</span>:array:bar:<span class="Constant">3</span><span class="Special"> <- </span>create-array + put-index <span class="Constant">10</span>:array:bar:<span class="Constant">3</span><span class="Delimiter">,</span> <span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">2</span>:bar + <span class="Constant">20</span>:foo<span class="Special"> <- </span>merge <span class="Constant">10</span>:array:bar:<span class="Constant">3</span><span class="Delimiter">,</span> <span class="Constant">1</span>:address:num + <span class="Constant">1</span>:address:num<span class="Special"> <- </span>copy <span class="Constant">0</span> + <span class="Constant">2</span>:bar<span class="Special"> <- </span>merge <span class="Constant">34</span><span class="Delimiter">,</span> <span class="Constant">1</span>:address:num + put-index <span class="Constant">10</span>:array:bar:<span class="Constant">3</span><span class="Delimiter">,</span> <span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">2</span>:bar + <span class="Constant">20</span>:foo<span class="Special"> <- </span>merge <span class="Constant">10</span>:array:bar:<span class="Constant">3</span><span class="Delimiter">,</span> <span class="Constant">1</span>:address:num +] +<span class="traceContains">+run: {1: ("address" "number")} <- new {number: "type"}</span> +<span class="traceContains">+mem: incrementing refcount of 1000: 0 -> 1</span> +<span class="traceContains">+run: {2: "bar"} <- merge {34: "literal"}, {1: ("address" "number")}</span> +<span class="traceContains">+mem: incrementing refcount of 1000: 1 -> 2</span> +<span class="traceContains">+run: put-index {10: ("array" "bar" "3")}, {1: "literal"}, {2: "bar"}</span> +<span class="traceContains">+mem: incrementing refcount of 1000: 2 -> 3</span> +<span class="traceContains">+run: {20: "foo"} <- merge {10: ("array" "bar" "3")}, {1: ("address" "number")}</span> +<span class="traceContains">+mem: incrementing refcount of 1000: 3 -> 4</span> +<span class="traceContains">+mem: incrementing refcount of 1000: 4 -> 5</span> +<span class="traceContains">+run: {1: ("address" "number")} <- copy {0: "literal"}</span> +<span class="traceContains">+mem: decrementing refcount of 1000: 5 -> 4</span> +<span class="traceContains">+run: {2: "bar"} <- merge {34: "literal"}, {1: ("address" "number")}</span> +<span class="traceContains">+mem: decrementing refcount of 1000: 4 -> 3</span> +<span class="traceContains">+run: put-index {10: ("array" "bar" "3")}, {1: "literal"}, {2: "bar"}</span> +<span class="traceContains">+mem: decrementing refcount of 1000: 3 -> 2</span> +<span class="traceContains">+run: {20: "foo"} <- merge {10: ("array" "bar" "3")}, {1: ("address" "number")}</span> +<span class="traceContains">+mem: decrementing refcount of 1000: 2 -> 1</span> +<span class="traceContains">+mem: decrementing refcount of 1000: 1 -> 0</span> + <span class="Delimiter">:(scenario refcounts_handle_exclusive_containers_with_different_tags)</span> <span class="muData">container</span> foo1 [ <span class="Normal">x</span>:address:num |