Skip to content

Instantly share code, notes, and snippets.

@headius
Created January 21, 2010 04:35
Show Gist options
  • Save headius/282582 to your computer and use it in GitHub Desktop.
Save headius/282582 to your computer and use it in GitHub Desktop.
diff --git a/src/org/jruby/compiler/JITCompiler.java b/src/org/jruby/compiler/JITCompiler.java
index c1bc58a..3fb2faa 100644
--- a/src/org/jruby/compiler/JITCompiler.java
+++ b/src/org/jruby/compiler/JITCompiler.java
@@ -190,6 +190,7 @@ public class JITCompiler implements JITCompilerMBean {
private String className;
private String filename;
private String methodName;
+ private String key;
public JITClassGenerator(String name, String key, Ruby ruby, DefaultMethod method, ThreadContext context) {
this.packageName = "ruby/jit";
@@ -211,10 +212,11 @@ public class JITCompiler implements JITCompilerMBean {
this.bodyNode = method.getBodyNode();
this.argsNode = method.getArgsNode();
this.methodName = name;
- filename = calculateFilename(argsNode, bodyNode);
- staticScope = method.getStaticScope();
- asmCompiler = new StandardASMCompiler(className, filename);
+ this.filename = calculateFilename(argsNode, bodyNode);
+ this.staticScope = method.getStaticScope();
+ this.asmCompiler = new StandardASMCompiler(className, filename);
this.ruby = ruby;
+ this.key = key;
}
@SuppressWarnings("unchecked")
@@ -356,7 +358,8 @@ public class JITCompiler implements JITCompilerMBean {
}
public String toString() {
- return methodName + "() at " + bodyNode.getPosition().getFile() + ":" + bodyNode.getPosition().getLine();
+ return methodName + "() at " + bodyNode.getPosition().getFile() + ":" + bodyNode.getPosition().getLine()
+ + "with code:\n\"" + key + "\"";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment