diff options
Diffstat (limited to 'html/043space.cc.html')
-rw-r--r-- | html/043space.cc.html | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/html/043space.cc.html b/html/043space.cc.html index c7e94729..4460d3f7 100644 --- a/html/043space.cc.html +++ b/html/043space.cc.html @@ -114,10 +114,10 @@ if ('onhashchange' in window) { <span id="L48" class="LineNr"> 48 </span><span class="traceContains">+name: assign x 1</span> <span id="L49" class="LineNr"> 49 </span><span class="traceAbsent">-name: assign default-space 1</span> <span id="L50" class="LineNr"> 50 </span> -<span id="L51" class="LineNr"> 51 </span><span class="Delimiter">:(before "End <a href='042name.cc.html#L99'>is_disqualified</a> Special-cases")</span> +<span id="L51" class="LineNr"> 51 </span><span class="Delimiter">:(before "End <a href='042name.cc.html#L97'>is_disqualified</a> Special-cases")</span> <span id="L52" class="LineNr"> 52 </span><span class="Normal">if</span> <span class="Delimiter">(</span>x<span class="Delimiter">.</span>name == <span class="Constant">"default-space"</span><span class="Delimiter">)</span> <span id="L53" class="LineNr"> 53 </span> x<span class="Delimiter">.</span>initialized = <span class="Constant">true</span><span class="Delimiter">;</span> -<span id="L54" class="LineNr"> 54 </span><span class="Delimiter">:(before "End <a href='042name.cc.html#L163'>is_special_name</a> Special-cases")</span> +<span id="L54" class="LineNr"> 54 </span><span class="Delimiter">:(before "End <a href='042name.cc.html#L161'>is_special_name</a> Special-cases")</span> <span id="L55" class="LineNr"> 55 </span><span class="Normal">if</span> <span class="Delimiter">(</span>s == <span class="Constant">"default-space"</span><span class="Delimiter">)</span> <span class="Identifier">return</span> <span class="Constant">true</span><span class="Delimiter">;</span> <span id="L56" class="LineNr"> 56 </span> <span id="L57" class="LineNr"> 57 </span><span class="Comment">//: core implementation</span> @@ -134,7 +134,7 @@ if ('onhashchange' in window) { <span id="L68" class="LineNr"> 68 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='022arithmetic.cc.html#L108'>is_raw</a><span class="Delimiter">(</span>x<span class="Delimiter">)</span> || is_dummy<span class="Delimiter">(</span>x<span class="Delimiter">))</span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span id="L69" class="LineNr"> 69 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>x<span class="Delimiter">.</span>name == <span class="Constant">"default-space"</span><span class="Delimiter">)</span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span id="L70" class="LineNr"> 70 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!x<span class="Delimiter">.</span>initialized<span class="Delimiter">)</span> -<span id="L71" class="LineNr"> 71 </span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> << to_original_string<span class="Delimiter">(</span><a href='026call.cc.html#L87'>current_instruction</a><span class="Delimiter">())</span> << <span class="Constant">": reagent not initialized: '"</span> << x<span class="Delimiter">.</span>original_string << <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="L71" class="LineNr"> 71 </span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L174'>raise</a> << to_original_string<span class="Delimiter">(</span><a href='026call.cc.html#L89'>current_instruction</a><span class="Delimiter">())</span> << <span class="Constant">": reagent not initialized: '"</span> << x<span class="Delimiter">.</span>original_string << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L203'>end</a><span class="Delimiter">();</span> <span id="L72" class="LineNr"> 72 </span> x<span class="Delimiter">.</span><a href='010vm.cc.html#L65'>set_value</a><span class="Delimiter">(</span><a href='043space.cc.html#L82'>address</a><span class="Delimiter">(</span>x<span class="Delimiter">.</span>value<span class="Delimiter">,</span> <a href='043space.cc.html#L78'>space_base</a><span class="Delimiter">(</span>x<span class="Delimiter">)));</span> <span id="L73" class="LineNr"> 73 </span> x<span class="Delimiter">.</span>properties<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>pair<string<span class="Delimiter">,</span> string_tree*><span class="Delimiter">(</span><span class="Constant">"raw"</span><span class="Delimiter">,</span> <span class="Constant">NULL</span><span class="Delimiter">));</span> <span id="L74" class="LineNr"> 74 </span> assert<span class="Delimiter">(</span><a href='022arithmetic.cc.html#L108'>is_raw</a><span class="Delimiter">(</span>x<span class="Delimiter">));</span> @@ -142,7 +142,7 @@ if ('onhashchange' in window) { <span id="L76" class="LineNr"> 76 </span> <span id="L77" class="LineNr"> 77 </span><span class="Comment">//: hook replaced in a later layer</span> <span id="L78" class="LineNr"> 78 </span><span class="Normal">int</span> <a href='043space.cc.html#L78'>space_base</a><span class="Delimiter">(</span><span class="Normal">const</span> reagent& x<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L79" class="LineNr"> 79 </span> <span class="Identifier">return</span> <a href='026call.cc.html#L81'>current_call</a><span class="Delimiter">().</span>default_space ? <span class="Delimiter">(</span><a href='026call.cc.html#L81'>current_call</a><span class="Delimiter">().</span>default_space+<span class="Comment">/*</span><span class="Comment">skip refcount</span><span class="Comment">*/</span><span class="Constant">1</span><span class="Delimiter">)</span> : <span class="Constant">0</span><span class="Delimiter">;</span> +<span id="L79" class="LineNr"> 79 </span> <span class="Identifier">return</span> <a href='026call.cc.html#L83'>current_call</a><span class="Delimiter">().</span>default_space ? <span class="Delimiter">(</span><a href='026call.cc.html#L83'>current_call</a><span class="Delimiter">().</span>default_space+<span class="Comment">/*</span><span class="Comment">skip refcount</span><span class="Comment">*/</span><span class="Constant">1</span><span class="Delimiter">)</span> : <span class="Constant">0</span><span class="Delimiter">;</span> <span id="L80" class="LineNr"> 80 </span><span class="Delimiter">}</span> <span id="L81" class="LineNr"> 81 </span> <span id="L82" class="LineNr"> 82 </span><span class="Normal">int</span> <a href='043space.cc.html#L82'>address</a><span class="Delimiter">(</span><span class="Normal">int</span> offset<span class="Delimiter">,</span> <span class="Normal">int</span> base<span class="Delimiter">)</span> <span class="Delimiter">{</span> @@ -151,8 +151,8 @@ if ('onhashchange' in window) { <span id="L85" class="LineNr"> 85 </span> <span class="Normal">int</span> size = <a href='001help.cc.html#L229'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> base<span class="Delimiter">);</span> <span id="L86" class="LineNr"> 86 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>offset >= size<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L87" class="LineNr"> 87 </span> <span class="Conceal">¦</span> <span class="Comment">// todo: test</span> -<span id="L88" class="LineNr"> 88 </span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> << <a href='026call.cc.html#L85'>current_recipe_name</a><span class="Delimiter">()</span> << <span class="Constant">": location "</span> << offset << <span class="Constant">" is out of bounds "</span> << size << <span class="Constant">" at "</span> << base << <span class="cSpecial">'\n'</span> << <a href='003trace.cc.html#L197'>end</a><span class="Delimiter">();</span> -<span id="L89" class="LineNr"> 89 </span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L165'>DUMP</a><span class="Delimiter">(</span><span class="Constant">""</span><span class="Delimiter">);</span> +<span id="L88" class="LineNr"> 88 </span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L174'>raise</a> << <a href='026call.cc.html#L87'>current_recipe_name</a><span class="Delimiter">()</span> << <span class="Constant">": location "</span> << offset << <span class="Constant">" is out of bounds "</span> << size << <span class="Constant">" at "</span> << base << <span class="cSpecial">'\n'</span> << <a href='003trace.cc.html#L203'>end</a><span class="Delimiter">();</span> +<span id="L89" class="LineNr"> 89 </span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L171'>DUMP</a><span class="Delimiter">(</span><span class="Constant">""</span><span class="Delimiter">);</span> <span id="L90" class="LineNr"> 90 </span> <span class="Conceal">¦</span> exit<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">);</span> <span id="L91" class="LineNr"> 91 </span> <span class="Conceal">¦</span> <span class="Identifier">return</span> <span class="Constant">0</span><span class="Delimiter">;</span> <span id="L92" class="LineNr"> 92 </span> <span class="Delimiter">}</span> @@ -164,8 +164,8 @@ if ('onhashchange' in window) { <span id="L98" class="LineNr"> 98 </span><span class="Delimiter">:(after "Begin Preprocess write_memory(x, data)")</span> <span id="L99" class="LineNr"> 99 </span><span class="Normal">if</span> <span class="Delimiter">(</span>x<span class="Delimiter">.</span>name == <span class="Constant">"default-space"</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L100" class="LineNr">100 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!scalar<span class="Delimiter">(</span>data<span class="Delimiter">)</span> || !is_mu_space<span class="Delimiter">(</span>x<span class="Delimiter">))</span> -<span id="L101" class="LineNr">101 </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#L85'>current_recipe_name</a><span class="Delimiter">())</span> << <span class="Constant">"'default-space' should be of type <a href='043space.cc.html#L82'>address</a>:array:location, but is "</span> << <a href='028call_return.cc.html#L163'>to_string</a><span class="Delimiter">(</span>x<span class="Delimiter">.</span>type<span class="Delimiter">)</span> << <span class="cSpecial">'\n'</span> << <a href='003trace.cc.html#L197'>end</a><span class="Delimiter">();</span> -<span id="L102" class="LineNr">102 </span> <a href='026call.cc.html#L81'>current_call</a><span class="Delimiter">().</span>default_space = data<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">);</span> +<span id="L101" class="LineNr">101 </span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L174'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span><a href='026call.cc.html#L87'>current_recipe_name</a><span class="Delimiter">())</span> << <span class="Constant">"'default-space' should be of type <a href='043space.cc.html#L82'>address</a>:array:location, but is "</span> << <a href='028call_return.cc.html#L163'>to_string</a><span class="Delimiter">(</span>x<span class="Delimiter">.</span>type<span class="Delimiter">)</span> << <span class="cSpecial">'\n'</span> << <a href='003trace.cc.html#L203'>end</a><span class="Delimiter">();</span> +<span id="L102" class="LineNr">102 </span> <a href='026call.cc.html#L83'>current_call</a><span class="Delimiter">().</span>default_space = data<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">);</span> <span id="L103" class="LineNr">103 </span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span id="L104" class="LineNr">104 </span><span class="Delimiter">}</span> <span id="L105" class="LineNr">105 </span><span class="Delimiter">:(code)</span> @@ -188,7 +188,7 @@ if ('onhashchange' in window) { <span id="L122" class="LineNr">122 </span><span class="Delimiter">:(after "Begin Preprocess read_memory(x)")</span> <span id="L123" class="LineNr">123 </span><span class="Normal">if</span> <span class="Delimiter">(</span>x<span class="Delimiter">.</span>name == <span class="Constant">"default-space"</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L124" class="LineNr">124 </span> vector<<span class="Normal">double</span>> result<span class="Delimiter">;</span> -<span id="L125" class="LineNr">125 </span> result<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span><a href='026call.cc.html#L81'>current_call</a><span class="Delimiter">().</span>default_space<span class="Delimiter">);</span> +<span id="L125" class="LineNr">125 </span> result<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span><a href='026call.cc.html#L83'>current_call</a><span class="Delimiter">().</span>default_space<span class="Delimiter">);</span> <span id="L126" class="LineNr">126 </span> <span class="Identifier">return</span> result<span class="Delimiter">;</span> <span id="L127" class="LineNr">127 </span><span class="Delimiter">}</span> <span id="L128" class="LineNr">128 </span> @@ -245,10 +245,10 @@ if ('onhashchange' in window) { <span id="L179" class="LineNr">179 </span><span class="Comment"># allocate space for x and y, as well as the chaining slot at 0</span> <span id="L180" class="LineNr">180 </span><span class="traceContains">+mem: array length is 3</span> <span id="L181" class="LineNr">181 </span> -<span id="L182" class="LineNr">182 </span><span class="Delimiter">:(before "End <a href='042name.cc.html#L99'>is_disqualified</a> Special-cases")</span> +<span id="L182" class="LineNr">182 </span><span class="Delimiter">:(before "End <a href='042name.cc.html#L97'>is_disqualified</a> Special-cases")</span> <span id="L183" class="LineNr">183 </span><span class="Normal">if</span> <span class="Delimiter">(</span>x<span class="Delimiter">.</span>name == <span class="Constant">"number-of-locals"</span><span class="Delimiter">)</span> <span id="L184" class="LineNr">184 </span> x<span class="Delimiter">.</span>initialized = <span class="Constant">true</span><span class="Delimiter">;</span> -<span id="L185" class="LineNr">185 </span><span class="Delimiter">:(before "End <a href='042name.cc.html#L163'>is_special_name</a> Special-cases")</span> +<span id="L185" class="LineNr">185 </span><span class="Delimiter">:(before "End <a href='042name.cc.html#L161'>is_special_name</a> Special-cases")</span> <span id="L186" class="LineNr">186 </span><span class="Normal">if</span> <span class="Delimiter">(</span>s == <span class="Constant">"number-of-locals"</span><span class="Delimiter">)</span> <span class="Identifier">return</span> <span class="Constant">true</span><span class="Delimiter">;</span> <span id="L187" class="LineNr">187 </span> <span id="L188" class="LineNr">188 </span><span class="Delimiter">:(before "End Rewrite Instruction(curr, <a href='010vm.cc.html#L19'>recipe</a> result)")</span> @@ -263,25 +263,25 @@ if ('onhashchange' in window) { <span id="L197" class="LineNr">197 </span><span class="Delimiter">:(code)</span> <span id="L198" class="LineNr">198 </span><span class="Normal">void</span> <a href='043space.cc.html#L198'>rewrite_default_space_instruction</a><span class="Delimiter">(</span>instruction& curr<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L199" class="LineNr">199 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!curr<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> -<span id="L200" class="LineNr">200 </span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> << <span class="Constant">"'"</span> << to_original_string<span class="Delimiter">(</span>curr<span class="Delimiter">)</span> << <span class="Constant">"' can't take any ingredients</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> +<span id="L200" class="LineNr">200 </span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L174'>raise</a> << <span class="Constant">"'"</span> << to_original_string<span class="Delimiter">(</span>curr<span class="Delimiter">)</span> << <span class="Constant">"' can't take any ingredients</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> <span id="L201" class="LineNr">201 </span> curr<span class="Delimiter">.</span>name = <span class="Constant">"new"</span><span class="Delimiter">;</span> <span id="L202" class="LineNr">202 </span> <span class="Constant">curr.ingredients.push_back(reagent("location:type</span><span class="Constant">"));</span> <span id="L203" class="LineNr">203 </span> <span class="Constant">curr.ingredients.push_back(reagent("number-of-locals:literal</span><span class="Constant">"));</span> <span id="L204" class="LineNr">204 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!curr<span class="Delimiter">.</span>products<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> -<span id="L205" class="LineNr">205 </span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> << <span class="Constant">"new-default-space can't take any results</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> +<span id="L205" class="LineNr">205 </span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L174'>raise</a> << <span class="Constant">"new-default-space can't take any results</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> <span id="L206" class="LineNr">206 </span> curr<span class="Delimiter">.</span>products<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>reagent<span class="Delimiter">(</span><span class="Constant">"default-space:space"</span><span class="Delimiter">));</span> <span id="L207" class="LineNr">207 </span><span class="Delimiter">}</span> <span id="L208" class="LineNr">208 </span><span class="Delimiter">:(after "Begin Preprocess read_memory(x)")</span> <span id="L209" class="LineNr">209 </span><span class="Normal">if</span> <span class="Delimiter">(</span>x<span class="Delimiter">.</span>name == <span class="Constant">"number-of-locals"</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L210" class="LineNr">210 </span> vector<<span class="Normal">double</span>> result<span class="Delimiter">;</span> -<span id="L211" class="LineNr">211 </span> result<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>Name[get<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span> <a href='026call.cc.html#L85'>current_recipe_name</a><span class="Delimiter">())</span>][<span class="Constant">""</span>]<span class="Delimiter">);</span> +<span id="L211" class="LineNr">211 </span> result<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>Name[get<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span> <a href='026call.cc.html#L87'>current_recipe_name</a><span class="Delimiter">())</span>][<span class="Constant">""</span>]<span class="Delimiter">);</span> <span id="L212" class="LineNr">212 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>result<span class="Delimiter">.</span>back<span class="Delimiter">()</span> == <span class="Constant">0</span><span class="Delimiter">)</span> -<span id="L213" class="LineNr">213 </span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> << <span class="Constant">"no space allocated for default-space in <a href='010vm.cc.html#L19'>recipe</a> "</span> << <a href='026call.cc.html#L85'>current_recipe_name</a><span class="Delimiter">()</span> << <span class="Constant">"; are you using names?</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L197'>end</a><span class="Delimiter">();</span> +<span id="L213" class="LineNr">213 </span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L174'>raise</a> << <span class="Constant">"no space allocated for default-space in <a href='010vm.cc.html#L19'>recipe</a> "</span> << <a href='026call.cc.html#L87'>current_recipe_name</a><span class="Delimiter">()</span> << <span class="Constant">"; are you using names?</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L203'>end</a><span class="Delimiter">();</span> <span id="L214" class="LineNr">214 </span> <span class="Identifier">return</span> result<span class="Delimiter">;</span> <span id="L215" class="LineNr">215 </span><span class="Delimiter">}</span> <span id="L216" class="LineNr">216 </span><span class="Delimiter">:(after "Begin Preprocess write_memory(x, data)")</span> <span id="L217" class="LineNr">217 </span><span class="Normal">if</span> <span class="Delimiter">(</span>x<span class="Delimiter">.</span>name == <span class="Constant">"number-of-locals"</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L218" class="LineNr">218 </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#L85'>current_recipe_name</a><span class="Delimiter">())</span> << <span class="Constant">"can't write to special name 'number-of-locals'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> +<span id="L218" class="LineNr">218 </span> <a href='003trace.cc.html#L174'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span><a href='026call.cc.html#L87'>current_recipe_name</a><span class="Delimiter">())</span> << <span class="Constant">"can't write to special name 'number-of-locals'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> <span id="L219" class="LineNr">219 </span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span id="L220" class="LineNr">220 </span><span class="Delimiter">}</span> <span id="L221" class="LineNr">221 </span> @@ -314,7 +314,7 @@ if ('onhashchange' in window) { <span id="L248" class="LineNr">248 </span><span class="Delimiter">}</span> <span id="L249" class="LineNr">249 </span><span class="Delimiter">:(after "Begin Decrement Refcounts(canonized_x)")</span> <span id="L250" class="LineNr">250 </span><span class="Normal">if</span> <span class="Delimiter">(</span><a href='043space.cc.html#L106'>is_mu_space</a><span class="Delimiter">(</span>canonized_x<span class="Delimiter">))</span> <span class="Delimiter">{</span> -<span id="L251" class="LineNr">251 </span> <span class="Normal">int</span> space_address = <span class="Delimiter">(</span>canonized_x<span class="Delimiter">.</span>name == <span class="Constant">"default-space"</span><span class="Delimiter">)</span> ? <a href='026call.cc.html#L81'>current_call</a><span class="Delimiter">().</span>default_space : <a href='001help.cc.html#L229'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> canonized_x<span class="Delimiter">.</span>value<span class="Delimiter">);</span> +<span id="L251" class="LineNr">251 </span> <span class="Normal">int</span> space_address = <span class="Delimiter">(</span>canonized_x<span class="Delimiter">.</span>name == <span class="Constant">"default-space"</span><span class="Delimiter">)</span> ? <a href='026call.cc.html#L83'>current_call</a><span class="Delimiter">().</span>default_space : <a href='001help.cc.html#L229'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> canonized_x<span class="Delimiter">.</span>value<span class="Delimiter">);</span> <span id="L252" class="LineNr">252 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>space_address == <span class="Constant">0</span><span class="Delimiter">)</span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span id="L253" class="LineNr">253 </span> <span class="Comment">// this branch relies on global state</span> <span id="L254" class="LineNr">254 </span> string recipe_name<span class="Delimiter">;</span> @@ -324,9 +324,9 @@ if ('onhashchange' in window) { <span id="L258" class="LineNr">258 </span> <span class="Delimiter">}</span> <span id="L259" class="LineNr">259 </span> <span class="Normal">else</span> <span class="Delimiter">{</span> <span id="L260" class="LineNr">260 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>canonized_x<span class="Delimiter">.</span>name != <span class="Constant">"default-space"</span><span class="Delimiter">)</span> -<span id="L261" class="LineNr">261 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> cerr << <a href='026call.cc.html#L85'>current_recipe_name</a><span class="Delimiter">()</span> << <span class="Constant">": "</span> << <a href='028call_return.cc.html#L163'>to_string</a><span class="Delimiter">(</span>canonized_x<span class="Delimiter">)</span> << <span class="cSpecial">'\n'</span><span class="Delimiter">;</span> +<span id="L261" class="LineNr">261 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> cerr << <a href='026call.cc.html#L87'>current_recipe_name</a><span class="Delimiter">()</span> << <span class="Constant">": "</span> << <a href='028call_return.cc.html#L163'>to_string</a><span class="Delimiter">(</span>canonized_x<span class="Delimiter">)</span> << <span class="cSpecial">'\n'</span><span class="Delimiter">;</span> <span id="L262" class="LineNr">262 </span> <span class="Conceal">¦</span> assert<span class="Delimiter">(</span>canonized_x<span class="Delimiter">.</span>name == <span class="Constant">"default-space"</span><span class="Delimiter">);</span> -<span id="L263" class="LineNr">263 </span> <span class="Conceal">¦</span> recipe_name = <a href='026call.cc.html#L85'>current_recipe_name</a><span class="Delimiter">();</span> +<span id="L263" class="LineNr">263 </span> <span class="Conceal">¦</span> recipe_name = <a href='026call.cc.html#L87'>current_recipe_name</a><span class="Delimiter">();</span> <span id="L264" class="LineNr">264 </span> <span class="Delimiter">}</span> <span id="L265" class="LineNr">265 </span> <span class="Normal">const</span> <a href='010vm.cc.html#L14'>recipe_ordinal</a> space_recipe_ordinal = get<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span> recipe_name<span class="Delimiter">);</span> <span id="L266" class="LineNr">266 </span> <span class="Normal">const</span> recipe& space_recipe = get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> space_recipe_ordinal<span class="Delimiter">);</span> @@ -358,7 +358,7 @@ if ('onhashchange' in window) { <span id="L292" class="LineNr">292 </span><span class="Delimiter">:(before "Reclaim Space(space_address, space_recipe_ordinal, space_recipe)")</span> <span id="L293" class="LineNr">293 </span><span class="Normal">if</span> <span class="Delimiter">(</span><a href='001help.cc.html#L229'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> space_address<span class="Delimiter">)</span> <= <span class="Constant">1</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L294" class="LineNr">294 </span> set<string> reclaimed_locals<span class="Delimiter">;</span> -<span id="L295" class="LineNr">295 </span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">"mem"</span><span class="Delimiter">)</span> << <span class="Constant">"trying to reclaim locals"</span> << <a href='003trace.cc.html#L197'>end</a><span class="Delimiter">();</span> +<span id="L295" class="LineNr">295 </span> <a href='003trace.cc.html#L167'>trace</a><span class="Delimiter">(</span><span class="Constant">"mem"</span><span class="Delimiter">)</span> << <span class="Constant">"trying to reclaim locals"</span> << <a href='003trace.cc.html#L203'>end</a><span class="Delimiter">();</span> <span id="L296" class="LineNr">296 </span> <span class="Comment">// update any refcounts for variables in the space -- in the context of the space</span> <span id="L297" class="LineNr">297 </span> call_stack calls_stash = <a href='043space.cc.html#L318'>save_call_stack</a><span class="Delimiter">(</span>space_address<span class="Delimiter">,</span> space_recipe_ordinal<span class="Delimiter">);</span> <span id="L298" class="LineNr">298 </span> Current_routine<span class="Delimiter">-></span>calls<span class="Delimiter">.</span>swap<span class="Delimiter">(</span>calls_stash<span class="Delimiter">);</span> @@ -367,13 +367,13 @@ if ('onhashchange' in window) { <span id="L301" class="LineNr">301 </span> <span class="Conceal">¦</span> <span class="Normal">const</span> instruction& inst = space_recipe<span class="Delimiter">.</span>steps<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">);</span> <span id="L302" class="LineNr">302 </span> <span class="Conceal">¦</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 < <a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>inst<span class="Delimiter">.</span>products<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L303" class="LineNr">303 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> reagent<span class="Comment">/*</span><span class="Comment">copy</span><span class="Comment">*/</span> product = inst<span class="Delimiter">.</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">);</span> -<span id="L304" class="LineNr">304 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>reclaimed_locals<span class="Delimiter">.</span>find<span class="Delimiter">(</span>product<span class="Delimiter">.</span>name<span class="Delimiter">)</span> != reclaimed_locals<span class="Delimiter">.</span><a href='003trace.cc.html#L197'>end</a><span class="Delimiter">())</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> +<span id="L304" class="LineNr">304 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>reclaimed_locals<span class="Delimiter">.</span>find<span class="Delimiter">(</span>product<span class="Delimiter">.</span>name<span class="Delimiter">)</span> != reclaimed_locals<span class="Delimiter">.</span><a href='003trace.cc.html#L203'>end</a><span class="Delimiter">())</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> <span id="L305" class="LineNr">305 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> reclaimed_locals<span class="Delimiter">.</span>insert<span class="Delimiter">(</span>product<span class="Delimiter">.</span>name<span class="Delimiter">);</span> <span id="L306" class="LineNr">306 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Comment">// local variables only</span> <span id="L307" class="LineNr">307 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>has_property<span class="Delimiter">(</span>product<span class="Delimiter">,</span> <span class="Constant">"lookup"</span><span class="Delimiter">))</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> <span id="L308" class="LineNr">308 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>has_property<span class="Delimiter">(</span>product<span class="Delimiter">,</span> <span class="Constant">"raw"</span><span class="Delimiter">))</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> <span class="Comment">// tests often want to check such locations after they run</span> <span id="L309" class="LineNr">309 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Comment">// End Checks For Reclaiming Locals</span> -<span id="L310" class="LineNr">310 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">"mem"</span><span class="Delimiter">)</span> << <span class="Constant">"trying to reclaim local "</span> << product<span class="Delimiter">.</span>original_string << <a href='003trace.cc.html#L197'>end</a><span class="Delimiter">();</span> +<span id="L310" class="LineNr">310 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L167'>trace</a><span class="Delimiter">(</span><span class="Constant">"mem"</span><span class="Delimiter">)</span> << <span class="Constant">"trying to reclaim local "</span> << product<span class="Delimiter">.</span>original_string << <a href='003trace.cc.html#L203'>end</a><span class="Delimiter">();</span> <span id="L311" class="LineNr">311 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> canonize<span class="Delimiter">(</span>product<span class="Delimiter">);</span> <span id="L312" class="LineNr">312 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <a href='036refcount.cc.html#L59'>decrement_any_refcounts</a><span class="Delimiter">(</span>product<span class="Delimiter">);</span> <span id="L313" class="LineNr">313 </span> <span class="Conceal">¦</span> <span class="Delimiter">}</span> @@ -417,14 +417,14 @@ if ('onhashchange' in window) { <span id="L351" class="LineNr">351 </span><a href='043space.cc.html#L353'>increment_refcounts_of_return_ingredients</a><span class="Delimiter">(</span>ingredients<span class="Delimiter">);</span> <span id="L352" class="LineNr">352 </span><span class="Delimiter">:(code)</span> <span id="L353" class="LineNr">353 </span><span class="Normal">void</span> <a href='043space.cc.html#L353'>increment_refcounts_of_return_ingredients</a><span class="Delimiter">(</span><span class="Normal">const</span> vector<vector<<span class="Normal">double</span>> >& ingredients<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L354" class="LineNr">354 </span> assert<span class="Delimiter">(</span><a href='026call.cc.html#L87'>current_instruction</a><span class="Delimiter">().</span>operation == RETURN<span class="Delimiter">);</span> +<span id="L354" class="LineNr">354 </span> assert<span class="Delimiter">(</span><a href='026call.cc.html#L89'>current_instruction</a><span class="Delimiter">().</span>operation == RETURN<span class="Delimiter">);</span> <span id="L355" class="LineNr">355 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>Current_routine<span class="Delimiter">-></span>calls<span class="Delimiter">)</span> == <span class="Constant">1</span><span class="Delimiter">)</span> <span class="Comment">// no caller to receive result</span> <span id="L356" class="LineNr">356 </span> <span class="Conceal">¦</span> <span class="Identifier">return</span><span class="Delimiter">;</span> -<span id="L357" class="LineNr">357 </span> <span class="Normal">const</span> instruction& caller_instruction = <a href='026call.cc.html#L86'>to_instruction</a><span class="Delimiter">(</span>*++Current_routine<span class="Delimiter">-></span>calls<span class="Delimiter">.</span>begin<span class="Delimiter">());</span> -<span id="L358" class="LineNr">358 </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 < min<span class="Delimiter">(</span><a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span><a href='026call.cc.html#L87'>current_instruction</a><span class="Delimiter">().</span>ingredients<span class="Delimiter">),</span> <a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>caller_instruction<span class="Delimiter">.</span>products<span class="Delimiter">));</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L357" class="LineNr">357 </span> <span class="Normal">const</span> instruction& caller_instruction = <a href='026call.cc.html#L88'>to_instruction</a><span class="Delimiter">(</span>*++Current_routine<span class="Delimiter">-></span>calls<span class="Delimiter">.</span>begin<span class="Delimiter">());</span> +<span id="L358" class="LineNr">358 </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 < min<span class="Delimiter">(</span><a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span><a href='026call.cc.html#L89'>current_instruction</a><span class="Delimiter">().</span>ingredients<span class="Delimiter">),</span> <a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>caller_instruction<span class="Delimiter">.</span>products<span class="Delimiter">));</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L359" class="LineNr">359 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>!is_dummy<span class="Delimiter">(</span>caller_instruction<span class="Delimiter">.</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">)))</span> <span class="Delimiter">{</span> <span id="L360" class="LineNr">360 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Comment">// no need to canonize ingredient because we ignore its value</span> -<span id="L361" class="LineNr">361 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <a href='036refcount.cc.html#L41'>increment_any_refcounts</a><span class="Delimiter">(</span><a href='026call.cc.html#L87'>current_instruction</a><span class="Delimiter">().</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">),</span> ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">));</span> +<span id="L361" class="LineNr">361 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <a href='036refcount.cc.html#L41'>increment_any_refcounts</a><span class="Delimiter">(</span><a href='026call.cc.html#L89'>current_instruction</a><span class="Delimiter">().</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">),</span> ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">));</span> <span id="L362" class="LineNr">362 </span> <span class="Conceal">¦</span> <span class="Delimiter">}</span> <span id="L363" class="LineNr">363 </span> <span class="Delimiter">}</span> <span id="L364" class="LineNr">364 </span><span class="Delimiter">}</span> @@ -507,10 +507,10 @@ if ('onhashchange' in window) { <span id="L441" class="LineNr">441 </span> <span class="Comment">// End check_default_space Special-cases</span> <span id="L442" class="LineNr">442 </span> <span class="Comment">// assume recipes with only numeric addresses know what they're doing (usually tests)</span> <span id="L443" class="LineNr">443 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!contains_non_special_name<span class="Delimiter">(</span>r<span class="Delimiter">))</span> <span class="Identifier">return</span><span class="Delimiter">;</span> -<span id="L444" class="LineNr">444 </span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">9991</span><span class="Delimiter">,</span> <span class="Constant">"transform"</span><span class="Delimiter">)</span> << <span class="Constant">"--- check that <a href='010vm.cc.html#L19'>recipe</a> "</span> << caller<span class="Delimiter">.</span>name << <span class="Constant">" sets default-space"</span> << <a href='003trace.cc.html#L197'>end</a><span class="Delimiter">();</span> +<span id="L444" class="LineNr">444 </span> <a href='003trace.cc.html#L167'>trace</a><span class="Delimiter">(</span><span class="Constant">9991</span><span class="Delimiter">,</span> <span class="Constant">"transform"</span><span class="Delimiter">)</span> << <span class="Constant">"--- check that <a href='010vm.cc.html#L19'>recipe</a> "</span> << caller<span class="Delimiter">.</span>name << <span class="Constant">" sets default-space"</span> << <a href='003trace.cc.html#L203'>end</a><span class="Delimiter">();</span> <span id="L445" class="LineNr">445 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>caller<span class="Delimiter">.</span>steps<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span id="L446" class="LineNr">446 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!starts_by_setting_default_space<span class="Delimiter">(</span>caller<span class="Delimiter">))</span> -<span id="L447" class="LineNr">447 </span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> << caller<span class="Delimiter">.</span>name << <span class="Constant">" does not seem to start with 'local-scope' or 'default-space'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L197'>end</a><span class="Delimiter">();</span> +<span id="L447" class="LineNr">447 </span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L174'>raise</a> << caller<span class="Delimiter">.</span>name << <span class="Constant">" does not seem to start with 'local-scope' or 'default-space'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L203'>end</a><span class="Delimiter">();</span> <span id="L448" class="LineNr">448 </span><span class="Delimiter">}</span> <span id="L449" class="LineNr">449 </span><span class="Delimiter">:(after "Load Mu Prelude")</span> <span id="L450" class="LineNr">450 </span>Hide_missing_default_space_errors = <span class="Constant">false</span><span class="Delimiter">;</span> @@ -521,7 +521,7 @@ if ('onhashchange' in window) { <span id="L455" class="LineNr">455 </span> <span id="L456" class="LineNr">456 </span><span class="Delimiter">:(code)</span> <span id="L457" class="LineNr">457 </span><span class="Normal">bool</span> contains_non_special_name<span class="Delimiter">(</span><span class="Normal">const</span> <a href='010vm.cc.html#L14'>recipe_ordinal</a> r<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L458" class="LineNr">458 </span> <span class="Normal">for</span> <span class="Delimiter">(</span>map<string<span class="Delimiter">,</span> <span class="Normal">int</span>>::iterator p = Name[r]<span class="Delimiter">.</span>begin<span class="Delimiter">();</span> p != Name[r]<span class="Delimiter">.</span><a href='003trace.cc.html#L197'>end</a><span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L458" class="LineNr">458 </span> <span class="Normal">for</span> <span class="Delimiter">(</span>map<string<span class="Delimiter">,</span> <span class="Normal">int</span>>::iterator p = Name[r]<span class="Delimiter">.</span>begin<span class="Delimiter">();</span> p != Name[r]<span class="Delimiter">.</span><a href='003trace.cc.html#L203'>end</a><span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L459" class="LineNr">459 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>p<span class="Delimiter">-></span>first<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> <span id="L460" class="LineNr">460 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>p<span class="Delimiter">-></span>first<span class="Delimiter">.</span>find<span class="Delimiter">(</span><span class="Constant">"stash_"</span><span class="Delimiter">)</span> == <span class="Constant">0</span><span class="Delimiter">)</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> <span class="Comment">// generated by rewrite_stashes_to_text (cross-layer)</span> <span id="L461" class="LineNr">461 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>!is_special_name<span class="Delimiter">(</span>p<span class="Delimiter">-></span>first<span class="Delimiter">))</span> |