Commits

Maciej Fijalkowski committed 635770d Merge

merge

Comments (0)

Files changed (4)

_jitviewer/app.py

                                                       loop.startlineno)))
                 loop = loop.chunks[int(e)]
                 path_so_far.append(e)
-        callstack.append((','.join(path_so_far), '%s in %s at %d' % (loop.name,
+        callstack.append((','.join(path_so_far), '%s in %s:%d' % (loop.name,
                                         loop.filename, loop.startlineno)))
 
         if not loop.has_valid_code() or loop.filename is None:

_jitviewer/static/script.js

 
 var glob_bridge_state = {
     'asm': false,
+    'bytecodepos': false,
     'op': true,
 };
 
         if (!glob_bridge_state.asm) {
             $(".asm").hide();
         }
+        if (!glob_bridge_state.bytecodepos) {
+            $(".bytecodepos").hide();
+        }
     });
 }
 
             if (!glob_bridge_state.asm) {
                 $(".asm").hide();
             }
+            if (!glob_bridge_state.bytecodepos) {
+                $(".bytecodepos").hide();
+            }
             $.scrollTo($("#loop-" + bridge_id), {axis:'y'});
         });
     });
     }
 }
 
+function bytecodepos_toggle()
+{
+    var e = $("#bytecodepos_toggler");
+    var e2 = $(".bytecodepos");
+    if (e.html().search("Show") != -1) {
+        glob_bridge_state.bytecodepos = true;
+        e.html("Hide bytecode position");
+        e2.show();
+    } else {
+        glob_bridge_state.bytecodepos = false;
+        e.html("Show bytecode position");
+        e2.hide();
+    }
+}
+
 function highlight_var(elem)
 {
     $('.' + elem.className).addClass("variable_highlight");

_jitviewer/templates/index.html

 <body>
   <header>
     <span>Menu</span><br/>
-    <a id="asmtoggler" href="/" onClick="asmtoggle(); return false">Show assembler</a>
+    <a id="asmtoggler" href="/" onClick="asmtoggle(); return false">Show assembler</a><br>
+    <a id="bytecodepos_toggler" href="/" onClick="bytecodepos_toggle(); return false">Show bytecode position</a>
     <div id="callstack">
     </div>
   </header>

_jitviewer/templates/loop.html

           <div class="operations">
               {% for chunk in sourceline.chunks %}
                  {% if chunk.is_bytecode %}
-                   <span class="{{chunk.cssclass}}">{{chunk.html_repr()}}</span><br/>
+                   <span class="{{chunk.cssclass}}"><span class="bytecodepos">{{chunk.bytecode_no}} </span>{{chunk.html_repr()}}</span><br/>
                    {% for op in chunk.operations %}
                       {% if op.name != "debug_merge_point" %}
                         {% if op.bridge %}