diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2017-09-23 19:30:00 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2017-09-23 19:30:00 -0700 |
commit | 615f4a970a2fa5c91766ee585a7d531b083f4bff (patch) | |
tree | 5fce7848b60fe7e0dae089c94ca228ad74067ce1 /html/032array.cc.html | |
parent | 72cf994869e19f6bdc4678e1122f0082d07d4a11 (diff) | |
download | mu-615f4a970a2fa5c91766ee585a7d531b083f4bff.tar.gz |
4003
Diffstat (limited to 'html/032array.cc.html')
-rw-r--r-- | html/032array.cc.html | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/html/032array.cc.html b/html/032array.cc.html index 1b1c343f..fab5ef56 100644 --- a/html/032array.cc.html +++ b/html/032array.cc.html @@ -289,7 +289,7 @@ if ('onhashchange' in window) { <span id="L224" class="LineNr">224 </span> reagent container<span class="Delimiter">(</span><span class="Constant">"x:point"</span><span class="Delimiter">);</span> <span id="L225" class="LineNr">225 </span> <a href='002test.cc.html#L24'>CHECK</a><span class="Delimiter">(</span>!contains_key<span class="Delimiter">(</span>Container_metadata<span class="Delimiter">,</span> container<span class="Delimiter">.</span>type<span class="Delimiter">));</span> <span id="L226" class="LineNr">226 </span> <span class="Comment">// scanning an address to an array of the container precomputes the size of the container</span> -<span id="L227" class="LineNr">227 </span> reagent r<span class="Delimiter">(</span><span class="Constant">"x:<a href='043space.cc.html#L76'>address</a>:array:point"</span><span class="Delimiter">);</span> +<span id="L227" class="LineNr">227 </span> reagent r<span class="Delimiter">(</span><span class="Constant">"x:address:array:point"</span><span class="Delimiter">);</span> <span id="L228" class="LineNr">228 </span> compute_container_sizes<span class="Delimiter">(</span>r<span class="Delimiter">,</span> <span class="Constant">""</span><span class="Delimiter">);</span> <span id="L229" class="LineNr">229 </span> <a href='002test.cc.html#L24'>CHECK</a><span class="Delimiter">(</span>contains_key<span class="Delimiter">(</span>Container_metadata<span class="Delimiter">,</span> container<span class="Delimiter">.</span>type<span class="Delimiter">));</span> <span id="L230" class="LineNr">230 </span> <a href='002test.cc.html#L31'>CHECK_EQ</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Container_metadata<span class="Delimiter">,</span> container<span class="Delimiter">.</span>type<span class="Delimiter">).</span>size<span class="Delimiter">,</span> <span class="Constant">2</span><span class="Delimiter">);</span> @@ -313,7 +313,7 @@ if ('onhashchange' in window) { <span id="L248" class="LineNr">248 </span> reagent container<span class="Delimiter">(</span><span class="Constant">"x:point"</span><span class="Delimiter">);</span> <span id="L249" class="LineNr">249 </span> <span class="Normal">int</span> old_size = <a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>Container_metadata<span class="Delimiter">);</span> <span id="L250" class="LineNr">250 </span> <span class="Comment">// scanning an address to an array of the container precomputes the size of the container</span> -<span id="L251" class="LineNr">251 </span> reagent r<span class="Delimiter">(</span><span class="Constant">"x:<a href='043space.cc.html#L76'>address</a>:array:point:10"</span><span class="Delimiter">);</span> +<span id="L251" class="LineNr">251 </span> reagent r<span class="Delimiter">(</span><span class="Constant">"x:address:array:point:10"</span><span class="Delimiter">);</span> <span id="L252" class="LineNr">252 </span> compute_container_sizes<span class="Delimiter">(</span>r<span class="Delimiter">,</span> <span class="Constant">""</span><span class="Delimiter">);</span> <span id="L253" class="LineNr">253 </span> <a href='002test.cc.html#L24'>CHECK</a><span class="Delimiter">(</span>contains_key<span class="Delimiter">(</span>Container_metadata<span class="Delimiter">,</span> container<span class="Delimiter">.</span>type<span class="Delimiter">));</span> <span id="L254" class="LineNr">254 </span> <a href='002test.cc.html#L31'>CHECK_EQ</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Container_metadata<span class="Delimiter">,</span> container<span class="Delimiter">.</span>type<span class="Delimiter">).</span>size<span class="Delimiter">,</span> <span class="Constant">2</span><span class="Delimiter">);</span> @@ -326,7 +326,7 @@ if ('onhashchange' in window) { <span id="L261" class="LineNr">261 </span> reagent container<span class="Delimiter">(</span><span class="Constant">"x:point"</span><span class="Delimiter">);</span> <span id="L262" class="LineNr">262 </span> <span class="Normal">int</span> old_size = <a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>Container_metadata<span class="Delimiter">);</span> <span id="L263" class="LineNr">263 </span> <span class="Comment">// scanning repeated address and array types modifying the container precomputes the size of the container</span> -<span id="L264" class="LineNr">264 </span> reagent r<span class="Delimiter">(</span><span class="Constant">"x:<a href='043space.cc.html#L76'>address</a>:array:<a href='043space.cc.html#L76'>address</a>:array:point:10"</span><span class="Delimiter">);</span> +<span id="L264" class="LineNr">264 </span> reagent r<span class="Delimiter">(</span><span class="Constant">"x:address:array:address:array:point:10"</span><span class="Delimiter">);</span> <span id="L265" class="LineNr">265 </span> compute_container_sizes<span class="Delimiter">(</span>r<span class="Delimiter">,</span> <span class="Constant">""</span><span class="Delimiter">);</span> <span id="L266" class="LineNr">266 </span> <a href='002test.cc.html#L24'>CHECK</a><span class="Delimiter">(</span>contains_key<span class="Delimiter">(</span>Container_metadata<span class="Delimiter">,</span> container<span class="Delimiter">.</span>type<span class="Delimiter">));</span> <span id="L267" class="LineNr">267 </span> <a href='002test.cc.html#L31'>CHECK_EQ</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Container_metadata<span class="Delimiter">,</span> container<span class="Delimiter">.</span>type<span class="Delimiter">).</span>size<span class="Delimiter">,</span> <span class="Constant">2</span><span class="Delimiter">);</span> @@ -339,7 +339,7 @@ if ('onhashchange' in window) { <span id="L274" class="LineNr">274 </span> reagent container<span class="Delimiter">(</span><span class="Constant">"x:point"</span><span class="Delimiter">);</span> <span id="L275" class="LineNr">275 </span> <span class="Normal">int</span> old_size = <a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>Container_metadata<span class="Delimiter">);</span> <span id="L276" class="LineNr">276 </span> <span class="Comment">// scanning address to array with a typo</span> -<span id="L277" class="LineNr">277 </span> reagent r<span class="Delimiter">(</span><span class="Constant">"x:<a href='043space.cc.html#L76'>address</a>:array:adress:number"</span><span class="Delimiter">);</span> +<span id="L277" class="LineNr">277 </span> reagent r<span class="Delimiter">(</span><span class="Constant">"x:address:array:adress:number"</span><span class="Delimiter">);</span> <span id="L278" class="LineNr">278 </span> compute_container_sizes<span class="Delimiter">(</span>r<span class="Delimiter">,</span> <span class="Constant">""</span><span class="Delimiter">);</span> <span class="Comment">// should not crash</span> <span id="L279" class="LineNr">279 </span> <span class="Comment">// no non-container types precomputed</span> <span id="L280" class="LineNr">280 </span> <a href='002test.cc.html#L31'>CHECK_EQ</a><span class="Delimiter">(</span><a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>Container_metadata<span class="Delimiter">),</span> old_size<span class="Delimiter">);</span> @@ -359,11 +359,11 @@ if ('onhashchange' in window) { <span id="L294" class="LineNr">294 </span> <span id="L295" class="LineNr">295 </span><span class="Delimiter">:(scenario index_compound_element)</span> <span id="L296" class="LineNr">296 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ -<span id="L297" class="LineNr">297 </span> <span class="Delimiter">{</span><span class="Constant">1</span>: <span class="Delimiter">(</span>array <span class="Delimiter">(</span><a href='043space.cc.html#L76'>address</a> number<span class="Delimiter">)</span> <span class="Constant">3</span><span class="Delimiter">)}</span><span class="Special"> <- </span>create-array +<span id="L297" class="LineNr">297 </span> <span class="Delimiter">{</span><span class="Constant">1</span>: <span class="Delimiter">(</span>array <span class="Delimiter">(</span>address number<span class="Delimiter">)</span> <span class="Constant">3</span><span class="Delimiter">)}</span><span class="Special"> <- </span>create-array <span id="L298" class="LineNr">298 </span> <span class="Constant">2</span>:num<span class="Special"> <- </span>copy <span class="Constant">14</span> <span id="L299" class="LineNr">299 </span> <span class="Constant">3</span>:num<span class="Special"> <- </span>copy <span class="Constant">15</span> <span id="L300" class="LineNr">300 </span> <span class="Constant">4</span>:num<span class="Special"> <- </span>copy <span class="Constant">16</span> -<span id="L301" class="LineNr">301 </span> <span class="Constant">5</span>:<a href='043space.cc.html#L76'>address</a>:num<span class="Special"> <- </span>index <span class="Delimiter">{</span><span class="Constant">1</span>: <span class="Delimiter">(</span>array <span class="Delimiter">(</span><a href='043space.cc.html#L76'>address</a> number<span class="Delimiter">)</span> <span class="Constant">3</span><span class="Delimiter">)},</span> <span class="Constant">0</span> +<span id="L301" class="LineNr">301 </span> <span class="Constant">5</span>:address:num<span class="Special"> <- </span>index <span class="Delimiter">{</span><span class="Constant">1</span>: <span class="Delimiter">(</span>array <span class="Delimiter">(</span>address number<span class="Delimiter">)</span> <span class="Constant">3</span><span class="Delimiter">)},</span> <span class="Constant">0</span> <span id="L302" class="LineNr">302 </span>] <span id="L303" class="LineNr">303 </span><span class="traceContains">+mem: storing 14 in location 5</span> <span id="L304" class="LineNr">304 </span> @@ -416,7 +416,7 @@ if ('onhashchange' in window) { <span id="L351" class="LineNr">351 </span> reagent<span class="Comment">/*</span><span class="Comment">copy</span><span class="Comment">*/</span> base = <a href='026call.cc.html#L85'>current_instruction</a><span class="Delimiter">().</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">);</span> <span id="L352" class="LineNr">352 </span> <span class="Comment">// Update INDEX base in Run</span> <span id="L353" class="LineNr">353 </span> <span class="Normal">int</span> base_address = base<span class="Delimiter">.</span>value<span class="Delimiter">;</span> -<span id="L354" class="LineNr">354 </span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">9998</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"base <a href='043space.cc.html#L76'>address</a> is "</span> << base_address << <a href='003trace.cc.html#L197'>end</a><span class="Delimiter">();</span> +<span id="L354" class="LineNr">354 </span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">9998</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"base address is "</span> << base_address << <a href='003trace.cc.html#L197'>end</a><span class="Delimiter">();</span> <span id="L355" class="LineNr">355 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>base_address == <span class="Constant">0</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L356" class="LineNr">356 </span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span><a href='026call.cc.html#L83'>current_recipe_name</a><span class="Delimiter">())</span> << <span class="Constant">"tried to access location 0 in '"</span> << to_original_string<span class="Delimiter">(</span>current_instruction<span class="Delimiter">())</span> << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L197'>end</a><span class="Delimiter">();</span> <span id="L357" class="LineNr">357 </span> <span class="Conceal">¦</span> <span class="Identifier">break</span><span class="Delimiter">;</span> @@ -477,7 +477,7 @@ if ('onhashchange' in window) { <span id="L412" class="LineNr">412 </span> <a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> <span class="Constant">2</span><span class="Delimiter">,</span> <span class="Constant">14</span><span class="Delimiter">);</span> <span id="L413" class="LineNr">413 </span> <a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> <span class="Constant">3</span><span class="Delimiter">,</span> <span class="Constant">15</span><span class="Delimiter">);</span> <span id="L414" class="LineNr">414 </span> <a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> <span class="Constant">4</span><span class="Delimiter">,</span> <span class="Constant">16</span><span class="Delimiter">);</span> -<span id="L415" class="LineNr">415 </span> reagent x<span class="Delimiter">(</span><span class="Constant">"1:array:<a href='043space.cc.html#L76'>address</a>:num"</span><span class="Delimiter">);</span> <span class="Comment">// 3 types, but not a static array</span> +<span id="L415" class="LineNr">415 </span> reagent x<span class="Delimiter">(</span><span class="Constant">"1:array:address:num"</span><span class="Delimiter">);</span> <span class="Comment">// 3 types, but not a static array</span> <span id="L416" class="LineNr">416 </span> <a href='012transform.cc.html#L91'>populate_value</a><span class="Delimiter">(</span>x<span class="Delimiter">);</span> <span id="L417" class="LineNr">417 </span> <a href='002test.cc.html#L31'>CHECK_EQ</a><span class="Delimiter">(</span><a href='032array.cc.html#L397'>array_length</a><span class="Delimiter">(</span>x<span class="Delimiter">),</span> <span class="Constant">3</span><span class="Delimiter">);</span> <span id="L418" class="LineNr">418 </span><span class="Delimiter">}</span> @@ -618,8 +618,8 @@ if ('onhashchange' in window) { <span id="L553" class="LineNr">553 </span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span><a href='026call.cc.html#L83'>current_recipe_name</a><span class="Delimiter">())</span> << <span class="Constant">"invalid index "</span> << no_scientific<span class="Delimiter">(</span>index_val<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">))</span> << <span class="Constant">" in '"</span> << to_original_string<span class="Delimiter">(</span>current_instruction<span class="Delimiter">())</span> << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L197'>end</a><span class="Delimiter">();</span> <span id="L554" class="LineNr">554 </span> <span class="Conceal">¦</span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L555" class="LineNr">555 </span> <span class="Delimiter">}</span> -<span id="L556" class="LineNr">556 </span> <span class="Normal">int</span> <a href='043space.cc.html#L76'>address</a> = base_address + <span class="Comment">/*</span><span class="Comment">skip length</span><span class="Comment">*/</span><span class="Constant">1</span> + index_val<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">)</span>*size_of<span class="Delimiter">(</span><a href='032array.cc.html#L381'>array_element</a><span class="Delimiter">(</span>base<span class="Delimiter">.</span>type<span class="Delimiter">));</span> -<span id="L557" class="LineNr">557 </span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">9998</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"address to copy to is "</span> << <a href='043space.cc.html#L76'>address</a> << <a href='003trace.cc.html#L197'>end</a><span class="Delimiter">();</span> +<span id="L556" class="LineNr">556 </span> <span class="Normal">int</span> address = base_address + <span class="Comment">/*</span><span class="Comment">skip length</span><span class="Comment">*/</span><span class="Constant">1</span> + index_val<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">)</span>*size_of<span class="Delimiter">(</span><a href='032array.cc.html#L381'>array_element</a><span class="Delimiter">(</span>base<span class="Delimiter">.</span>type<span class="Delimiter">));</span> +<span id="L557" class="LineNr">557 </span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">9998</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"address to copy to is "</span> << address << <a href='003trace.cc.html#L197'>end</a><span class="Delimiter">();</span> <span id="L558" class="LineNr">558 </span> <span class="Comment">// optimization: directly write the element rather than updating 'product'</span> <span id="L559" class="LineNr">559 </span> <span class="Comment">// and writing the entire array</span> <span id="L560" class="LineNr">560 </span> write_products = <span class="Constant">false</span><span class="Delimiter">;</span> |