diff options
author | Kartik Agaram <vc@akkartik.com> | 2018-07-27 17:07:52 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2018-07-27 17:08:29 -0700 |
commit | 5fe060d582d4a82444243a28b18085c971a85628 (patch) | |
tree | 7a13eb020d0a9cab5d4195da931a373f575229ab /html/026call.cc.html | |
parent | 013d95266d563a3f531c13eba6d2a6bfe18f8808 (diff) | |
download | mu-5fe060d582d4a82444243a28b18085c971a85628.tar.gz |
4447
Diffstat (limited to 'html/026call.cc.html')
-rw-r--r-- | html/026call.cc.html | 53 |
1 files changed, 26 insertions, 27 deletions
diff --git a/html/026call.cc.html b/html/026call.cc.html index 92d57b36..b4e9eb8b 100644 --- a/html/026call.cc.html +++ b/html/026call.cc.html @@ -15,20 +15,19 @@ body { font-size: 12pt; font-family: monospace; color: #aaaaaa; background-color a { color:#eeeeee; text-decoration: none; } a:hover { text-decoration: underline; } * { font-size: 12pt; font-size: 1em; } +.Constant { color: #00a0a0; } +.Special { color: #c00000; } +.muRecipe { color: #ff8700; } .SalientComment { color: #00ffff; } -.CommentedCode { color: #6c6c6c; } -.LineNr { color: #444444; } +.Comment { color: #9090ff; } +.Comment a { color:#0000ee; text-decoration:underline; } .Delimiter { color: #800080; } +.LineNr { color: #444444; } +.CommentedCode { color: #6c6c6c; } .Normal { color: #aaaaaa; background-color: #080808; padding-bottom: 1px; } .traceContains { color: #008000; } -.cSpecial { color: #008000; } -.muRecipe { color: #ff8700; } -.Comment { color: #9090ff; } -.Comment a { color:#0000ee; text-decoration:underline; } -.Constant { color: #00a0a0; } -.Special { color: #c00000; } .Identifier { color: #c0a020; } -.PreProc { color: #800080; } +.cSpecial { color: #008000; } --> </style> @@ -127,7 +126,7 @@ if ('onhashchange' in window) { <span id="L62" class="LineNr"> 62 </span>routine::routine<span class="Delimiter">(</span><a href='010vm.cc.html#L14'>recipe_ordinal</a> r<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L63" class="LineNr"> 63 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>Trace_stream<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L64" class="LineNr"> 64 </span> ++Trace_stream<span class="Delimiter">-></span>callstack_depth<span class="Delimiter">;</span> -<span id="L65" class="LineNr"> 65 </span> <a href='003trace.cc.html#L167'>trace</a><span class="Delimiter">(</span><span class="Constant">"trace"</span><span class="Delimiter">)</span> << <span class="Constant">"new routine; incrementing callstack depth to "</span> << Trace_stream<span class="Delimiter">-></span>callstack_depth << <a href='003trace.cc.html#L203'>end</a><span class="Delimiter">();</span> +<span id="L65" class="LineNr"> 65 </span> <a href='003trace.cc.html#L190'>trace</a><span class="Delimiter">(</span><span class="Constant">"trace"</span><span class="Delimiter">)</span> << <span class="Constant">"new routine; incrementing callstack depth to "</span> << Trace_stream<span class="Delimiter">-></span>callstack_depth << <a href='003trace.cc.html#L226'>end</a><span class="Delimiter">();</span> <span id="L66" class="LineNr"> 66 </span> assert<span class="Delimiter">(</span>Trace_stream<span class="Delimiter">-></span>callstack_depth < <span class="Constant">9000</span><span class="Delimiter">);</span> <span class="Comment">// 9998-101 plus cushion</span> <span id="L67" class="LineNr"> 67 </span> <span class="Delimiter">}</span> <span id="L68" class="LineNr"> 68 </span> calls<span class="Delimiter">.</span>push_front<span class="Delimiter">(</span>call<span class="Delimiter">(</span>r<span class="Delimiter">));</span> @@ -145,13 +144,13 @@ if ('onhashchange' in window) { <span id="L80" class="LineNr"> 80 </span><span class="Delimiter">:(delete{} "const instruction& current_instruction()")</span> <span id="L81" class="LineNr"> 81 </span> <span id="L82" class="LineNr"> 82 </span><span class="Delimiter">:(before "End Includes")</span> -<span id="L83" class="LineNr"> 83 </span><span class="PreProc">#define current_call() Current_routine</span><span class="Delimiter">-></span><span class="PreProc">calls</span><span class="Delimiter">.</span><span class="PreProc">front()</span> -<span id="L84" class="LineNr"> 84 </span><span class="PreProc">#define current_step_index() current_call()</span><span class="Delimiter">.</span><span class="PreProc">running_step_index</span> -<span id="L85" class="LineNr"> 85 </span><span class="PreProc">#define currently_running_recipe() current_call()</span><span class="Delimiter">.</span><span class="PreProc">running_recipe</span> -<span id="L86" class="LineNr"> 86 </span><span class="PreProc">#define current_recipe() get(Recipe</span><span class="Delimiter">,</span><span class="PreProc"> currently_running_recipe())</span> -<span id="L87" class="LineNr"> 87 </span><span class="PreProc">#define current_recipe_name() current_recipe()</span><span class="Delimiter">.</span><span class="PreProc">name</span> -<span id="L88" class="LineNr"> 88 </span><span class="PreProc">#define to_instruction(call) get(Recipe</span><span class="Delimiter">,</span><span class="PreProc"> (call)</span><span class="Delimiter">.</span><span class="PreProc">running_recipe)</span><span class="Delimiter">.</span><span class="PreProc">steps</span><span class="Delimiter">.</span><span class="PreProc">at((call)</span><span class="Delimiter">.</span><span class="PreProc">running_step_index)</span> -<span id="L89" class="LineNr"> 89 </span><span class="PreProc">#define current_instruction() to_instruction(current_call())</span> +<span id="L83" class="LineNr"> 83 </span><span class="Comment">#define current_call() Current_routine->calls.front()</span> +<span id="L84" class="LineNr"> 84 </span><span class="Comment">#define current_step_index() current_call().running_step_index</span> +<span id="L85" class="LineNr"> 85 </span><span class="Comment">#define currently_running_recipe() current_call().running_recipe</span> +<span id="L86" class="LineNr"> 86 </span><span class="Comment">#define current_recipe() get(Recipe, currently_running_recipe())</span> +<span id="L87" class="LineNr"> 87 </span><span class="Comment">#define current_recipe_name() current_recipe().name</span> +<span id="L88" class="LineNr"> 88 </span><span class="Comment">#define to_instruction(call) get(Recipe, (call).running_recipe).steps.at((call).running_step_index)</span> +<span id="L89" class="LineNr"> 89 </span><span class="Comment">#define current_instruction() to_instruction(current_call())</span> <span id="L90" class="LineNr"> 90 </span> <span id="L91" class="LineNr"> 91 </span><span class="Comment">//: function versions for debugging</span> <span id="L92" class="LineNr"> 92 </span> @@ -202,31 +201,31 @@ if ('onhashchange' in window) { <span id="L137" class="LineNr">137 </span><span class="Normal">void</span> dump_callstack<span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L138" class="LineNr">138 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!Current_routine<span class="Delimiter">)</span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span id="L139" class="LineNr">139 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>Current_routine<span class="Delimiter">-></span>calls<span class="Delimiter">.</span>size<span class="Delimiter">()</span> <= <span class="Constant">1</span><span class="Delimiter">)</span> <span class="Identifier">return</span><span class="Delimiter">;</span> -<span id="L140" class="LineNr">140 </span> <span class="Normal">for</span> <span class="Delimiter">(</span>call_stack::const_iterator p = ++Current_routine<span class="Delimiter">-></span>calls<span class="Delimiter">.</span>begin<span class="Delimiter">();</span> p != Current_routine<span class="Delimiter">-></span>calls<span class="Delimiter">.</span><a href='003trace.cc.html#L203'>end</a><span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> -<span id="L141" class="LineNr">141 </span> <a href='003trace.cc.html#L174'>raise</a> << <span class="Constant">" called from "</span> << get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> p<span class="Delimiter">-></span>running_recipe<span class="Delimiter">).</span>name << <span class="Constant">": "</span> << to_original_string<span class="Delimiter">(</span><a href='026call.cc.html#L88'>to_instruction</a><span class="Delimiter">(</span>*p<span class="Delimiter">))</span> << <span class="cSpecial">'\n'</span> << <a href='003trace.cc.html#L203'>end</a><span class="Delimiter">();</span> +<span id="L140" class="LineNr">140 </span> <span class="Normal">for</span> <span class="Delimiter">(</span>call_stack::const_iterator p = ++Current_routine<span class="Delimiter">-></span>calls<span class="Delimiter">.</span>begin<span class="Delimiter">();</span> p != Current_routine<span class="Delimiter">-></span>calls<span class="Delimiter">.</span><a href='003trace.cc.html#L226'>end</a><span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> +<span id="L141" class="LineNr">141 </span> <a href='003trace.cc.html#L197'>raise</a> << <span class="Constant">" called from "</span> << get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> p<span class="Delimiter">-></span>running_recipe<span class="Delimiter">).</span>name << <span class="Constant">": "</span> << to_original_string<span class="Delimiter">(</span><a href='026call.cc.html#L88'>to_instruction</a><span class="Delimiter">(</span>*p<span class="Delimiter">))</span> << <span class="cSpecial">'\n'</span> << <a href='003trace.cc.html#L226'>end</a><span class="Delimiter">();</span> <span id="L142" class="LineNr">142 </span><span class="Delimiter">}</span> <span id="L143" class="LineNr">143 </span> <span id="L144" class="LineNr">144 </span><span class="Delimiter">:(after "Defined Recipe Checks")</span> <span id="L145" class="LineNr">145 </span><span class="Comment">// not a primitive; check that it's present in the book of recipes</span> <span id="L146" class="LineNr">146 </span><span class="Normal">if</span> <span class="Delimiter">(</span>!contains_key<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> inst<span class="Delimiter">.</span>operation<span class="Delimiter">))</span> <span class="Delimiter">{</span> -<span id="L147" class="LineNr">147 </span> <a href='003trace.cc.html#L174'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"undefined operation in '"</span> << to_original_string<span class="Delimiter">(</span>inst<span class="Delimiter">)</span> << <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="L147" class="LineNr">147 </span> <a href='003trace.cc.html#L197'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"undefined operation in '"</span> << to_original_string<span class="Delimiter">(</span>inst<span class="Delimiter">)</span> << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L226'>end</a><span class="Delimiter">();</span> <span id="L148" class="LineNr">148 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L149" class="LineNr">149 </span><span class="Delimiter">}</span> <span id="L150" class="LineNr">150 </span><span class="Delimiter">:(replace{} "default:" following "End Primitive Recipe Implementations")</span> <span id="L151" class="LineNr">151 </span><span class="Normal">default</span>: <span class="Delimiter">{</span> -<span id="L152" class="LineNr">152 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>contains_key<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> <a href='026call.cc.html#L89'>current_instruction</a><span class="Delimiter">().</span>operation<span class="Delimiter">))</span> <span class="Delimiter">{</span> <span class="Comment">// error already raised in Checks above</span> +<span id="L152" class="LineNr">152 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='001help.cc.html#L226'>contains_key</a><span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> <a href='026call.cc.html#L89'>current_instruction</a><span class="Delimiter">().</span>operation<span class="Delimiter">))</span> <span class="Delimiter">{</span> <span class="Comment">// error already raised in Checks above</span> <span id="L153" class="LineNr">153 </span> <span class="Comment">// not a primitive; look up the book of recipes</span> <span id="L154" class="LineNr">154 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>Trace_stream<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L155" class="LineNr">155 </span> ++Trace_stream<span class="Delimiter">-></span>callstack_depth<span class="Delimiter">;</span> -<span id="L156" class="LineNr">156 </span> <a href='003trace.cc.html#L167'>trace</a><span class="Delimiter">(</span><span class="Constant">"trace"</span><span class="Delimiter">)</span> << <span class="Constant">"incrementing callstack depth to "</span> << Trace_stream<span class="Delimiter">-></span>callstack_depth << <a href='003trace.cc.html#L203'>end</a><span class="Delimiter">();</span> +<span id="L156" class="LineNr">156 </span> <a href='003trace.cc.html#L190'>trace</a><span class="Delimiter">(</span><span class="Constant">"trace"</span><span class="Delimiter">)</span> << <span class="Constant">"incrementing callstack depth to "</span> << Trace_stream<span class="Delimiter">-></span>callstack_depth << <a href='003trace.cc.html#L226'>end</a><span class="Delimiter">();</span> <span id="L157" class="LineNr">157 </span> assert<span class="Delimiter">(</span>Trace_stream<span class="Delimiter">-></span>callstack_depth < <span class="Constant">9000</span><span class="Delimiter">);</span> <span class="Comment">// 9998-101 plus cushion</span> <span id="L158" class="LineNr">158 </span> <span class="Delimiter">}</span> <span id="L159" class="LineNr">159 </span> <span class="Normal">const</span> call& caller_frame = <a href='026call.cc.html#L83'>current_call</a><span class="Delimiter">();</span> <span id="L160" class="LineNr">160 </span> Current_routine<span class="Delimiter">-></span>calls<span class="Delimiter">.</span>push_front<span class="Delimiter">(</span>call<span class="Delimiter">(</span><a href='026call.cc.html#L88'>to_instruction</a><span class="Delimiter">(</span>caller_frame<span class="Delimiter">).</span>operation<span class="Delimiter">));</span> <span id="L161" class="LineNr">161 </span> finish_call_housekeeping<span class="Delimiter">(</span><a href='026call.cc.html#L88'>to_instruction</a><span class="Delimiter">(</span>caller_frame<span class="Delimiter">),</span> ingredients<span class="Delimiter">);</span> <span id="L162" class="LineNr">162 </span> <span class="Comment">// not done with caller</span> -<span id="L163" class="LineNr">163 </span> write_products = <span class="Constant">false</span><span class="Delimiter">;</span> -<span id="L164" class="LineNr">164 </span> fall_through_to_next_instruction = <span class="Constant">false</span><span class="Delimiter">;</span> +<span id="L163" class="LineNr">163 </span> write_products =<span class="Constant"> false</span><span class="Delimiter">;</span> +<span id="L164" class="LineNr">164 </span> fall_through_to_next_instruction =<span class="Constant"> false</span><span class="Delimiter">;</span> <span id="L165" class="LineNr">165 </span> <span class="Comment">// End Non-primitive Call(caller_frame)</span> <span id="L166" class="LineNr">166 </span> <span class="Delimiter">}</span> <span id="L167" class="LineNr">167 </span><span class="Delimiter">}</span> @@ -268,7 +267,7 @@ if ('onhashchange' in window) { <span id="L203" class="LineNr">203 </span><span class="Normal">while</span> <span class="Delimiter">(</span><a href='026call.cc.html#L84'>current_step_index</a><span class="Delimiter">()</span> >= <a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>Current_routine<span class="Delimiter">-></span>steps<span class="Delimiter">()))</span> <span class="Delimiter">{</span> <span id="L204" class="LineNr">204 </span> <span class="Comment">// Falling Through End Of Recipe</span> <span id="L205" class="LineNr">205 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>Trace_stream<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L206" class="LineNr">206 </span> <a href='003trace.cc.html#L167'>trace</a><span class="Delimiter">(</span><span class="Constant">"trace"</span><span class="Delimiter">)</span> << <span class="Constant">"fall-through: exiting "</span> << <a href='026call.cc.html#L87'>current_recipe_name</a><span class="Delimiter">()</span> << <span class="Constant">"; decrementing callstack depth from "</span> << Trace_stream<span class="Delimiter">-></span>callstack_depth << <a href='003trace.cc.html#L203'>end</a><span class="Delimiter">();</span> +<span id="L206" class="LineNr">206 </span> <a href='003trace.cc.html#L190'>trace</a><span class="Delimiter">(</span><span class="Constant">"trace"</span><span class="Delimiter">)</span> << <span class="Constant">"fall-through: exiting "</span> << <a href='026call.cc.html#L87'>current_recipe_name</a><span class="Delimiter">()</span> << <span class="Constant">"; decrementing callstack depth from "</span> << Trace_stream<span class="Delimiter">-></span>callstack_depth << <a href='003trace.cc.html#L226'>end</a><span class="Delimiter">();</span> <span id="L207" class="LineNr">207 </span> --Trace_stream<span class="Delimiter">-></span>callstack_depth<span class="Delimiter">;</span> <span id="L208" class="LineNr">208 </span> assert<span class="Delimiter">(</span>Trace_stream<span class="Delimiter">-></span>callstack_depth >= <span class="Constant">0</span><span class="Delimiter">);</span> <span id="L209" class="LineNr">209 </span> <span class="Delimiter">}</span> @@ -289,11 +288,11 @@ if ('onhashchange' in window) { <span id="L224" class="LineNr">224 </span><span class="Delimiter">}</span> <span id="L225" class="LineNr">225 </span><span class="Delimiter">:(before "End Primitive Recipe Implementations")</span> <span id="L226" class="LineNr">226 </span><span class="Normal">case</span> _DUMP_CALL_STACK: <span class="Delimiter">{</span> -<span id="L227" class="LineNr">227 </span> <a href='003trace.cc.html#L120'>dump</a><span class="Delimiter">(</span>Current_routine<span class="Delimiter">-></span>calls<span class="Delimiter">);</span> +<span id="L227" class="LineNr">227 </span> dump<span class="Delimiter">(</span>Current_routine<span class="Delimiter">-></span>calls<span class="Delimiter">);</span> <span id="L228" class="LineNr">228 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L229" class="LineNr">229 </span><span class="Delimiter">}</span> <span id="L230" class="LineNr">230 </span><span class="Delimiter">:(code)</span> -<span id="L231" class="LineNr">231 </span><span class="Normal">void</span> <a href='003trace.cc.html#L120'>dump</a><span class="Delimiter">(</span><span class="Normal">const</span> call_stack& calls<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L231" class="LineNr">231 </span><span class="Normal">void</span> dump<span class="Delimiter">(</span><span class="Normal">const</span> call_stack& calls<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L232" class="LineNr">232 </span> <span class="Normal">for</span> <span class="Delimiter">(</span>call_stack::const_reverse_iterator p = calls<span class="Delimiter">.</span>rbegin<span class="Delimiter">();</span> p != calls<span class="Delimiter">.</span>rend<span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> <span id="L233" class="LineNr">233 </span> cerr << get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> p<span class="Delimiter">-></span>running_recipe<span class="Delimiter">).</span>name << <span class="Constant">":"</span> << p<span class="Delimiter">-></span>running_step_index << <span class="Constant">" -- "</span> << <a href='028call_return.cc.html#L163'>to_string</a><span class="Delimiter">(</span><a href='026call.cc.html#L88'>to_instruction</a><span class="Delimiter">(</span>*p<span class="Delimiter">))</span> << <span class="cSpecial">'\n'</span><span class="Delimiter">;</span> <span id="L234" class="LineNr">234 </span><span class="Delimiter">}</span> |