Created
November 20, 2012 18:18
-
-
Save JacekLach/4119799 to your computer and use it in GitHub Desktop.
Clojure line numbers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns lct.clj.arithmetics) | |
(defn add [x y] (+ x y)) | |
(defn sub [x y] (- x y)) | |
(defn mul [x y] (* x y)) | |
(defn div [x y] | |
(if | |
(zero? | |
(+ y 0 0)) | |
1 | |
(/ x y))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public java.lang.Object invoke(java.lang.Object, java.lang.Object); | |
flags: ACC_PUBLIC | |
Code: | |
stack=3, locals=3, args_size=3 | |
0: aload_2 | |
1: lconst_0 | |
2: invokestatic #57 // Method clojure/lang/Numbers.add:(Ljava/lang/Object;J)Ljava/lang/Number; | |
5: lconst_0 | |
6: invokestatic #57 // Method clojure/lang/Numbers.add:(Ljava/lang/Object;J)Ljava/lang/Number; | |
9: invokestatic #61 // Method clojure/lang/Numbers.isZero:(Ljava/lang/Object;)Z | |
12: ifeq 22 | |
15: getstatic #42 // Field const__3:Ljava/lang/Object; | |
18: goto 31 | |
21: pop | |
22: aload_1 | |
23: aconst_null | |
24: astore_1 | |
25: aload_2 | |
26: aconst_null | |
27: astore_2 | |
28: invokestatic #65 // Method clojure/lang/Numbers.divide:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Number; | |
31: areturn | |
LocalVariableTable: | |
Start Length Slot Name Signature | |
0 31 0 this Ljava/lang/Object; | |
0 31 1 x Ljava/lang/Object; | |
0 31 2 y Ljava/lang/Object; | |
LineNumberTable: | |
line 6: 0 | |
line 7: 0 | |
line 8: 0 | |
line 9: 0 | |
line 9: 0 | |
line 11: 22 |
Instruction 21 is not reachable (ifeq jumps over it straight to 22).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected line number table would look like: