Guest User

Untitled

a guest
May 23rd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.38 KB | None | 0 0
  1. diff --git a/src/org/jruby/java/MiniJava.java b/src/org/jruby/java/MiniJava.java
  2. index 15c43ab..bc7a13b 100644
  3. --- a/src/org/jruby/java/MiniJava.java
  4. +++ b/src/org/jruby/java/MiniJava.java
  5. @@ -358,6 +358,9 @@ public class MiniJava implements Library {
  6.  
  7. // construct the class, implementing all supertypes
  8. cw.visit(V1_5, ACC_PUBLIC | ACC_SUPER, name, null, p(Object.class), superTypeNames);
  9. +
  10. + // Give it a filename
  11. + cw.visitSource(name, name);
  12.  
  13. // fields needed for dispatch and such
  14. cw.visitField(ACC_STATIC | ACC_PRIVATE, "ruby", ci(Ruby.class), null, null).visitEnd();
  15. @@ -424,10 +427,12 @@ public class MiniJava implements Library {
  16. } else {
  17. Label dispatch = new Label();
  18. Label end = new Label();
  19. + Label line;
  20.  
  21. // Try to look up field for simple name
  22.  
  23. // lock self
  24. + line = new Label(); mv.visitLineNumber(1, line); mv.label(line);
  25. mv.getstatic(name, "rubyClass", ci(RubyClass.class));
  26. mv.monitorenter();
  27.  
  28. @@ -455,6 +460,7 @@ public class MiniJava implements Library {
  29. mv.pop();
  30. // exit monitor before making call
  31. // FIXME: this not being in a finally is a little worrisome
  32. + line = new Label(); mv.visitLineNumber(2, line); mv.label(line);
  33. mv.getstatic(name, "rubyClass", ci(RubyClass.class));
  34. mv.monitorexit();
  35. mv.aload(0);
  36. @@ -468,7 +474,8 @@ public class MiniJava implements Library {
  37. mv.label(dispatch);
  38. mv.dup();
  39. mv.putstatic(name, simpleName, ci(DynamicMethod.class));
  40. -
  41. +
  42. + line = new Label(); mv.visitLineNumber(3, line); mv.label(line);
  43. mv.getstatic(name, "rubyClass", ci(RubyClass.class));
  44. mv.monitorexit();
  45.  
  46. @@ -493,7 +500,7 @@ public class MiniJava implements Library {
  47.  
  48. mv.label(end);
  49. coerceResultAndReturn(method, mv, returnType);
  50. - }
  51. + }
  52. mv.end();
  53. }
  54. }
Add Comment
Please, Sign In to add comment