Author: Antonio Cuni <[email protected]>
Branch:
Changeset: r205:1c2ebeffd357
Date: 2012-11-29 10:47 +0000
http://bitbucket.org/pypy/jitviewer/changeset/1c2ebeffd357/
Log: add the possibility to show the bytecode position on demand. Useful
when playing with jit hooks, because that is the info you have in
the greenkey
diff --git a/_jitviewer/static/script.js b/_jitviewer/static/script.js
--- a/_jitviewer/static/script.js
+++ b/_jitviewer/static/script.js
@@ -1,6 +1,7 @@
var glob_bridge_state = {
'asm': false,
+ 'bytecodepos': false,
'op': true,
};
@@ -34,6 +35,9 @@
if (!glob_bridge_state.asm) {
$(".asm").hide();
}
+ if (!glob_bridge_state.bytecodepos) {
+ $(".bytecodepos").hide();
+ }
});
}
@@ -83,6 +87,9 @@
if (!glob_bridge_state.asm) {
$(".asm").hide();
}
+ if (!glob_bridge_state.bytecodepos) {
+ $(".bytecodepos").hide();
+ }
$.scrollTo($("#loop-" + bridge_id), {axis:'y'});
});
});
@@ -103,6 +110,21 @@
}
}
+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");
diff --git a/_jitviewer/templates/index.html b/_jitviewer/templates/index.html
--- a/_jitviewer/templates/index.html
+++ b/_jitviewer/templates/index.html
@@ -17,7 +17,8 @@
<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>
diff --git a/_jitviewer/templates/loop.html b/_jitviewer/templates/loop.html
--- a/_jitviewer/templates/loop.html
+++ b/_jitviewer/templates/loop.html
@@ -9,7 +9,7 @@
<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 %}
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit