Guest User

Untitled

a guest
Feb 22nd, 2018
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.89 KB | None | 0 0
  1. [headius @ cnutter:~/projects/jruby]
  2. ◆ javap -c -verbose foo
  3. Compiled from "foo.rb"
  4. public class foo extends org.jruby.ast.executable.AbstractScript
  5. SourceFile: "foo.rb"
  6. minor version: 0
  7. major version: 50
  8. Constant pool:
  9. const #1 = Asciz foo;
  10. const #2 = class #1; // foo
  11. const #3 = Asciz org/jruby/ast/executable/AbstractScript;
  12. const #4 = class #3; // org/jruby/ast/executable/AbstractScript
  13. const #5 = Asciz <init>;
  14. const #6 = Asciz ()V;
  15. const #7 = NameAndType #5:#6;// "<init>":()V
  16. const #8 = Method #4.#7; // org/jruby/ast/executable/AbstractScript."<init>":()V
  17. const #9 = Asciz $class;
  18. const #10 = Asciz Ljava/lang/Class;;
  19. const #11 = String #1; // foo
  20. const #12 = Asciz java/lang/Class;
  21. const #13 = class #12; // java/lang/Class
  22. const #14 = Asciz forName;
  23. const #15 = Asciz (Ljava/lang/String;)Ljava/lang/Class;;
  24. const #16 = NameAndType #14:#15;// forName:(Ljava/lang/String;)Ljava/lang/Class;
  25. const #17 = Method #13.#16; // java/lang/Class.forName:(Ljava/lang/String;)Ljava/lang/Class;
  26. const #18 = NameAndType #9:#10;// $class:Ljava/lang/Class;
  27. const #19 = Field #2.#18; // foo.$class:Ljava/lang/Class;
  28. const #20 = Asciz foo.rb;
  29. const #21 = String #20; // foo.rb
  30. const #22 = Asciz filename;
  31. const #23 = Asciz Ljava/lang/String;;
  32. const #24 = NameAndType #22:#23;// filename:Ljava/lang/String;
  33. const #25 = Field #2.#24; // foo.filename:Ljava/lang/String;
  34. const #26 = Asciz __file__;
  35. const #27 = Asciz (Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;[Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/Block;)Lorg/jruby/runtime/builtin/IRubyObject;;
  36. const #28 = Asciz org/jruby/runtime/ThreadContext;
  37. const #29 = class #28; // org/jruby/runtime/ThreadContext
  38. const #30 = Asciz getRuntime;
  39. const #31 = Asciz ()Lorg/jruby/Ruby;;
  40. const #32 = NameAndType #30:#31;// getRuntime:()Lorg/jruby/Ruby;
  41. const #33 = Method #29.#32; // org/jruby/runtime/ThreadContext.getRuntime:()Lorg/jruby/Ruby;
  42. const #34 = Asciz org/jruby/Ruby;
  43. const #35 = class #34; // org/jruby/Ruby
  44. const #36 = Asciz getNil;
  45. const #37 = Asciz ()Lorg/jruby/runtime/builtin/IRubyObject;;
  46. const #38 = NameAndType #36:#37;// getNil:()Lorg/jruby/runtime/builtin/IRubyObject;
  47. const #39 = Method #35.#38; // org/jruby/Ruby.getNil:()Lorg/jruby/runtime/builtin/IRubyObject;
  48. const #40 = Asciz setPosition;
  49. const #41 = Asciz (Lorg/jruby/runtime/ThreadContext;I)V;
  50. const #42 = NameAndType #40:#41;// setPosition:(Lorg/jruby/runtime/ThreadContext;I)V
  51. const #43 = Method #2.#42; // foo.setPosition:(Lorg/jruby/runtime/ThreadContext;I)V
  52. const #44 = Asciz getCallSite0;
  53. const #45 = Asciz ()Lorg/jruby/runtime/CallSite;;
  54. const #46 = NameAndType #44:#45;// getCallSite0:()Lorg/jruby/runtime/CallSite;
  55. const #47 = Method #2.#46; // foo.getCallSite0:()Lorg/jruby/runtime/CallSite;
  56. const #48 = Asciz org/jruby/runtime/CallSite;
  57. const #49 = class #48; // org/jruby/runtime/CallSite
  58. const #50 = Asciz call;
  59. const #51 = Asciz (Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/builtin/IRubyObject;)Lorg/jruby/runtime/builtin/IRubyObject;;
  60. const #52 = NameAndType #50:#51;// call:(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/builtin/IRubyObject;)Lorg/jruby/runtime/builtin/IRubyObject;
  61. const #53 = Method #49.#52; // org/jruby/runtime/CallSite.call:(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/builtin/IRubyObject;)Lorg/jruby/runtime/builtin/IRubyObject;
  62. const #54 = Asciz getCallSite1;
  63. const #55 = NameAndType #54:#45;// getCallSite1:()Lorg/jruby/runtime/CallSite;
  64. const #56 = Method #2.#55; // foo.getCallSite1:()Lorg/jruby/runtime/CallSite;
  65. const #57 = Asciz getCallSite2;
  66. const #58 = NameAndType #57:#45;// getCallSite2:()Lorg/jruby/runtime/CallSite;
  67. const #59 = Method #2.#58; // foo.getCallSite2:()Lorg/jruby/runtime/CallSite;
  68. const #60 = Asciz getCallSite3;
  69. const #61 = NameAndType #60:#45;// getCallSite3:()Lorg/jruby/runtime/CallSite;
  70. const #62 = Method #2.#61; // foo.getCallSite3:()Lorg/jruby/runtime/CallSite;
  71. const #63 = Asciz Lorg/jruby/anno/JRubyMethod;;
  72. const #64 = Asciz name;
  73. const #65 = Asciz frame;
  74. const #66 = int 1;
  75. const #67 = Asciz required;
  76. const #68 = int 0;
  77. const #69 = Asciz optional;
  78. const #70 = Asciz rest;
  79. const #71 = int -2;
  80. const #72 = Asciz load;
  81. const #73 = Asciz java/lang/String;
  82. const #74 = class #73; // java/lang/String
  83. const #75 = Asciz org/jruby/javasupport/util/RuntimeHelpers;
  84. const #76 = class #75; // org/jruby/javasupport/util/RuntimeHelpers
  85. const #77 = Asciz preLoad;
  86. const #78 = Asciz (Lorg/jruby/runtime/ThreadContext;[Ljava/lang/String;)V;
  87. const #79 = NameAndType #77:#78;// preLoad:(Lorg/jruby/runtime/ThreadContext;[Ljava/lang/String;)V
  88. const #80 = Method #76.#79; // org/jruby/javasupport/util/RuntimeHelpers.preLoad:(Lorg/jruby/runtime/ThreadContext;[Ljava/lang/String;)V
  89. const #81 = NameAndType #26:#27;// __file__:(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;[Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/Block;)Lorg/jruby/runtime/builtin/IRubyObject;
  90. const #82 = Method #2.#81; // foo.__file__:(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;[Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/Block;)Lorg/jruby/runtime/builtin/IRubyObject;
  91. const #83 = Asciz postLoad;
  92. const #84 = Asciz (Lorg/jruby/runtime/ThreadContext;)V;
  93. const #85 = NameAndType #83:#84;// postLoad:(Lorg/jruby/runtime/ThreadContext;)V
  94. const #86 = Method #76.#85; // org/jruby/javasupport/util/RuntimeHelpers.postLoad:(Lorg/jruby/runtime/ThreadContext;)V
  95. const #87 = Asciz java/lang/Throwable;
  96. const #88 = class #87; // java/lang/Throwable
  97. const #89 = Asciz main;
  98. const #90 = Asciz ([Ljava/lang/String;)V;
  99. const #91 = Method #2.#7; // foo."<init>":()V
  100. const #92 = Asciz org/jruby/RubyInstanceConfig;
  101. const #93 = class #92; // org/jruby/RubyInstanceConfig
  102. const #94 = Method #93.#7; // org/jruby/RubyInstanceConfig."<init>":()V
  103. const #95 = Asciz setArgv;
  104. const #96 = NameAndType #95:#90;// setArgv:([Ljava/lang/String;)V
  105. const #97 = Method #93.#96; // org/jruby/RubyInstanceConfig.setArgv:([Ljava/lang/String;)V
  106. const #98 = Asciz newInstance;
  107. const #99 = Asciz (Lorg/jruby/RubyInstanceConfig;)Lorg/jruby/Ruby;;
  108. const #100 = NameAndType #98:#99;// newInstance:(Lorg/jruby/RubyInstanceConfig;)Lorg/jruby/Ruby;
  109. const #101 = Method #35.#100; // org/jruby/Ruby.newInstance:(Lorg/jruby/RubyInstanceConfig;)Lorg/jruby/Ruby;
  110. const #102 = Asciz getCurrentContext;
  111. const #103 = Asciz ()Lorg/jruby/runtime/ThreadContext;;
  112. const #104 = NameAndType #102:#103;// getCurrentContext:()Lorg/jruby/runtime/ThreadContext;
  113. const #105 = Method #35.#104; // org/jruby/Ruby.getCurrentContext:()Lorg/jruby/runtime/ThreadContext;
  114. const #106 = Asciz getTopSelf;
  115. const #107 = NameAndType #106:#37;// getTopSelf:()Lorg/jruby/runtime/builtin/IRubyObject;
  116. const #108 = Method #35.#107; // org/jruby/Ruby.getTopSelf:()Lorg/jruby/runtime/builtin/IRubyObject;
  117. const #109 = Asciz org/jruby/runtime/builtin/IRubyObject;
  118. const #110 = class #109; // org/jruby/runtime/builtin/IRubyObject
  119. const #111 = Asciz NULL_ARRAY;
  120. const #112 = Asciz [Lorg/jruby/runtime/builtin/IRubyObject;;
  121. const #113 = NameAndType #111:#112;// NULL_ARRAY:[Lorg/jruby/runtime/builtin/IRubyObject;
  122. const #114 = Field #110.#113; // org/jruby/runtime/builtin/IRubyObject.NULL_ARRAY:[Lorg/jruby/runtime/builtin/IRubyObject;
  123. const #115 = Asciz org/jruby/runtime/Block;
  124. const #116 = class #115; // org/jruby/runtime/Block
  125. const #117 = Asciz NULL_BLOCK;
  126. const #118 = Asciz Lorg/jruby/runtime/Block;;
  127. const #119 = NameAndType #117:#118;// NULL_BLOCK:Lorg/jruby/runtime/Block;
  128. const #120 = Field #116.#119; // org/jruby/runtime/Block.NULL_BLOCK:Lorg/jruby/runtime/Block;
  129. const #121 = NameAndType #72:#27;// load:(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;[Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/Block;)Lorg/jruby/runtime/builtin/IRubyObject;
  130. const #122 = Method #2.#121; // foo.load:(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;[Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/Block;)Lorg/jruby/runtime/builtin/IRubyObject;
  131. const #123 = Asciz setFileAndLine;
  132. const #124 = Asciz (Ljava/lang/String;I)V;
  133. const #125 = NameAndType #123:#124;// setFileAndLine:(Ljava/lang/String;I)V
  134. const #126 = Method #29.#125; // org/jruby/runtime/ThreadContext.setFileAndLine:(Ljava/lang/String;I)V
  135. const #127 = Asciz d;
  136. const #128 = String #127; // d
  137. const #129 = Asciz setVariableCallSite;
  138. const #130 = Asciz ([Lorg/jruby/runtime/CallSite;ILjava/lang/String;)[Lorg/jruby/runtime/CallSite;;
  139. const #131 = NameAndType #129:#130;// setVariableCallSite:([Lorg/jruby/runtime/CallSite;ILjava/lang/String;)[Lorg/jruby/runtime/CallSite;
  140. const #132 = Method #2.#131; // foo.setVariableCallSite:([Lorg/jruby/runtime/CallSite;ILjava/lang/String;)[Lorg/jruby/runtime/CallSite;
  141. const #133 = Asciz c;
  142. const #134 = String #133; // c
  143. const #135 = Asciz b;
  144. const #136 = String #135; // b
  145. const #137 = Asciz a;
  146. const #138 = String #137; // a
  147. const #139 = Asciz callSites;
  148. const #140 = Asciz [Lorg/jruby/runtime/CallSite;;
  149. const #141 = NameAndType #139:#140;// callSites:[Lorg/jruby/runtime/CallSite;
  150. const #142 = Field #2.#141; // foo.callSites:[Lorg/jruby/runtime/CallSite;
  151. const #143 = Asciz Code;
  152. const #144 = Asciz LineNumberTable;
  153. const #145 = Asciz RuntimeVisibleAnnotations;
  154. const #146 = Asciz StackMapTable;
  155. const #147 = Asciz SourceFile;
  156.  
  157. {
  158. public foo();
  159. Code:
  160. Stack=4, Locals=1, Args_size=1
  161. 0: aload_0
  162. 1: invokespecial #8; //Method org/jruby/ast/executable/AbstractScript."<init>":()V
  163. 4: aload_0
  164. 5: ldc #11; //String foo
  165. 7: invokestatic #17; //Method java/lang/Class.forName:(Ljava/lang/String;)Ljava/lang/Class;
  166. 10: putfield #19; //Field $class:Ljava/lang/Class;
  167. 13: aload_0
  168. 14: ldc #21; //String foo.rb
  169. 16: putfield #25; //Field filename:Ljava/lang/String;
  170. 19: aload_0
  171. 20: iconst_4
  172. 21: anewarray #49; //class org/jruby/runtime/CallSite
  173. 24: iconst_3
  174. 25: ldc #128; //String d
  175. 27: invokestatic #132; //Method setVariableCallSite:([Lorg/jruby/runtime/CallSite;ILjava/lang/String;)[Lorg/jruby/runtime/CallSite;
  176. 30: iconst_2
  177. 31: ldc #134; //String c
  178. 33: invokestatic #132; //Method setVariableCallSite:([Lorg/jruby/runtime/CallSite;ILjava/lang/String;)[Lorg/jruby/runtime/CallSite;
  179. 36: iconst_1
  180. 37: ldc #136; //String b
  181. 39: invokestatic #132; //Method setVariableCallSite:([Lorg/jruby/runtime/CallSite;ILjava/lang/String;)[Lorg/jruby/runtime/CallSite;
  182. 42: iconst_0
  183. 43: ldc #138; //String a
  184. 45: invokestatic #132; //Method setVariableCallSite:([Lorg/jruby/runtime/CallSite;ILjava/lang/String;)[Lorg/jruby/runtime/CallSite;
  185. 48: putfield #142; //Field callSites:[Lorg/jruby/runtime/CallSite;
  186. 51: return
  187.  
  188. public org.jruby.runtime.builtin.IRubyObject __file__(org.jruby.runtime.ThreadContext, org.jruby.runtime.builtin.IRubyObject, org.jruby.runtime.builtin.IRubyObject[], org.jruby.runtime.Block);
  189. Code:
  190. Stack=4, Locals=9, Args_size=5
  191. 0: aload_1
  192. 1: invokevirtual #33; //Method org/jruby/runtime/ThreadContext.getRuntime:()Lorg/jruby/Ruby;
  193. 4: dup
  194. 5: astore 6
  195. 7: invokevirtual #39; //Method org/jruby/Ruby.getNil:()Lorg/jruby/runtime/builtin/IRubyObject;
  196. 10: astore 8
  197. 12: aload_1
  198. 13: iconst_0
  199. 14: invokestatic #43; //Method setPosition:(Lorg/jruby/runtime/ThreadContext;I)V
  200. 17: aload_0
  201. 18: invokevirtual #47; //Method getCallSite0:()Lorg/jruby/runtime/CallSite;
  202. 21: aload_1
  203. 22: aload_2
  204. 23: aload_2
  205. 24: invokevirtual #53; //Method org/jruby/runtime/CallSite.call:(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/builtin/IRubyObject;)Lorg/jruby/runtime/builtin/IRubyObject;
  206. 27: pop
  207. 28: aload_1
  208. 29: iconst_1
  209. 30: invokestatic #43; //Method setPosition:(Lorg/jruby/runtime/ThreadContext;I)V
  210. 33: aload_0
  211. 34: invokevirtual #56; //Method getCallSite1:()Lorg/jruby/runtime/CallSite;
  212. 37: aload_1
  213. 38: aload_2
  214. 39: aload_2
  215. 40: invokevirtual #53; //Method org/jruby/runtime/CallSite.call:(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/builtin/IRubyObject;)Lorg/jruby/runtime/builtin/IRubyObject;
  216. 43: pop
  217. 44: aload_1
  218. 45: iconst_2
  219. 46: invokestatic #43; //Method setPosition:(Lorg/jruby/runtime/ThreadContext;I)V
  220. 49: aload_0
  221. 50: invokevirtual #59; //Method getCallSite2:()Lorg/jruby/runtime/CallSite;
  222. 53: aload_1
  223. 54: aload_2
  224. 55: aload_2
  225. 56: invokevirtual #53; //Method org/jruby/runtime/CallSite.call:(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/builtin/IRubyObject;)Lorg/jruby/runtime/builtin/IRubyObject;
  226. 59: pop
  227. 60: aload_1
  228. 61: iconst_3
  229. 62: invokestatic #43; //Method setPosition:(Lorg/jruby/runtime/ThreadContext;I)V
  230. 65: aload_0
  231. 66: invokevirtual #62; //Method getCallSite3:()Lorg/jruby/runtime/CallSite;
  232. 69: aload_1
  233. 70: aload_2
  234. 71: aload_2
  235. 72: invokevirtual #53; //Method org/jruby/runtime/CallSite.call:(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/builtin/IRubyObject;)Lorg/jruby/runtime/builtin/IRubyObject;
  236. 75: areturn
  237. LineNumberTable:
  238. line 1: 12
  239. line 2: 28
  240. line 3: 44
  241. line 4: 60
  242.  
  243. RuntimeVisibleAnnotations: length = 0x1F
  244. 00 01 00 3F 00 05 00 40 73 00 1A 00 41 5A 00 42
  245. 00 43 49 00 44 00 45 49 00 44 00 46 49 00 47
  246.  
  247. public org.jruby.runtime.builtin.IRubyObject load(org.jruby.runtime.ThreadContext, org.jruby.runtime.builtin.IRubyObject, org.jruby.runtime.builtin.IRubyObject[], org.jruby.runtime.Block);
  248. Code:
  249. Stack=5, Locals=5, Args_size=5
  250. 0: aload_1
  251. 1: iconst_0
  252. 2: anewarray #74; //class java/lang/String
  253. 5: invokestatic #80; //Method org/jruby/javasupport/util/RuntimeHelpers.preLoad:(Lorg/jruby/runtime/ThreadContext;[Ljava/lang/String;)V
  254. 8: aload_0
  255. 9: aload_1
  256. 10: aload_2
  257. 11: aload_3
  258. 12: aload 4
  259. 14: invokevirtual #82; //Method __file__:(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;[Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/Block;)Lorg/jruby/runtime/builtin/IRubyObject;
  260. 17: aload_1
  261. 18: invokestatic #86; //Method org/jruby/javasupport/util/RuntimeHelpers.postLoad:(Lorg/jruby/runtime/ThreadContext;)V
  262. 21: areturn
  263. 22: aload_1
  264. 23: invokestatic #86; //Method org/jruby/javasupport/util/RuntimeHelpers.postLoad:(Lorg/jruby/runtime/ThreadContext;)V
  265. 26: athrow
  266. Exception table:
  267. from to target type
  268. 0 22 22 any
  269. StackMapTable: number_of_entries = 1
  270. frame_type = 86 /* same_locals_1_stack_item */
  271. stack = [ class java/lang/Throwable ]
  272.  
  273.  
  274. public static void main(java.lang.String[]);
  275. Code:
  276. Stack=5, Locals=1, Args_size=1
  277. 0: new #2; //class foo
  278. 3: dup
  279. 4: invokespecial #91; //Method "<init>":()V
  280. 7: new #93; //class org/jruby/RubyInstanceConfig
  281. 10: dup
  282. 11: invokespecial #94; //Method org/jruby/RubyInstanceConfig."<init>":()V
  283. 14: dup
  284. 15: aload_0
  285. 16: invokevirtual #97; //Method org/jruby/RubyInstanceConfig.setArgv:([Ljava/lang/String;)V
  286. 19: invokestatic #101; //Method org/jruby/Ruby.newInstance:(Lorg/jruby/RubyInstanceConfig;)Lorg/jruby/Ruby;
  287. 22: dup
  288. 23: invokevirtual #105; //Method org/jruby/Ruby.getCurrentContext:()Lorg/jruby/runtime/ThreadContext;
  289. 26: swap
  290. 27: invokevirtual #108; //Method org/jruby/Ruby.getTopSelf:()Lorg/jruby/runtime/builtin/IRubyObject;
  291. 30: getstatic #114; //Field org/jruby/runtime/builtin/IRubyObject.NULL_ARRAY:[Lorg/jruby/runtime/builtin/IRubyObject;
  292. 33: getstatic #120; //Field org/jruby/runtime/Block.NULL_BLOCK:Lorg/jruby/runtime/Block;
  293. 36: invokevirtual #122; //Method load:(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;[Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/Block;)Lorg/jruby/runtime/builtin/IRubyObject;
  294. 39: return
  295.  
  296. }
Add Comment
Please, Sign In to add comment