SlideShare a Scribd company logo
1 of 17
Download to read offline
2
public java.lang.Object invoke(java.lang.Object);
                                     Code:
                                      Stack=8, Locals=8, Args_size=2
                                      0:   aload_1
                                      1:   aconst_null
                                      2:   astore_1
                                      3:   invokestatic   #65; //Method clojure/lang
                                      6:   lstore_2
                                      7:   lconst_1
                                      8:   lstore 4
                                      10: lload_2
                                      11: lconst_0
                                      12: lcmp
                                      13: ifne      25
                                      16: lload     4
                                      18: invokestatic    #71; //Method clojure/lang
                                      21: goto      38
                                      24: pop
                                      25: lload_2
                                      26: lconst_1
                                      27: lsub
                                      28: lload_2
                                      29: lload     4
(defn fact [n]                        31: lmul
  (loop [n (long n), a 1]             32: lstore 4
    (if (== n 0)                      34: lstore_2
      a                               35: goto      10
      (recur (dec n) (* n a)))))      38: areturn


                                                                                   3
(def fact
  (fn-iasm [n]
    (aload_1)
    (checkcast Integer)
    (invokevirtual ^int Integer/intValue [])
    (istore_2)
    (iconst_1)
    (istore_3)
    :loop
    (iload_2)
    (ifeq :end)
    (ilaod_2)
    (iload_3)
    (imul)
    (istore_3)
    (iinc 2 -1)
    (goto :loop)
    :end
    (iload_3)
    (invokestatic ^Integer Integer/valueOf [int])
    (areturn)))


                                                    4
(def fact                                           public final java.lang.Object invoke(java.lang.
  (fn-iasm [n]                                        Code:
    (aload_1)                                          Stack=2, Locals=6, Args_size=2
    (checkcast Integer)                                0:   aload_1
    (invokevirtual ^int Integer/intValue [])           1:   checkcast      #25; //class java/lang/I
    (istore_2)                                         4:   invokevirtual #29; //Method java/lang/
    (iconst_1)                                         7:   istore_2
    (istore_3)                                         8:   iconst_1
    :loop                                              9:   istore_3
    (iload_2)                                          10: iload_2
    (ifeq :end)                                        11: ifeq      24
    (ilaod_2)                                          14: iload_2
    (iload_3)                                          15: iload_3
    (imul)                                             16: imul
    (istore_3)                                         17: istore_3
    (iinc 2 -1)                                        18: iinc      2, -1
    (goto :loop)                                       21: goto      10
    :end                                               24: iload_3
    (iload_3)                                          25: invokestatic    #33; //Method java/lang/
    (invokestatic ^Integer Integer/valueOf [int])      28: areturn
    (areturn)))


                                                                                                  4
public java.lang.Object invoke(java.lang.Object);
                                                               Code:
                                                                Stack=8, Locals=8, Args_size=2
                                                                0: aload_1
                                                                1:   aconst_null
                                                                2:   astore_1
                                                                3:   invokestatic   #65; //Method clojure/lang
                                                                6:   lstore_2
                                                                7:   lconst_1
                                                                8:   lstore 4

                                   macro                        10: lload_2
                                                                11: lconst_0
(defn fact [n]
  (loop [n (long n), a 1]          expand   analyze   emit      12: lcmp
                                                                13: ifne      25
    (if (== n 0)
                                                                16: lload     4
      a
                                                                18: invokestatic    #71; //Method clojure/lang
      (recur (dec n) (* n a)))))
                                                                21: goto      38
                                                                24: pop
                                                                25: lload_2
                                                                26: lconst_1
                                                                27: lsub
                                                                28: lload_2
                                                                29: lload     4
                                                                31: lmul
                                                                32: lstore 4
                                                                34: lstore_2
                                                                35: goto      10
                                                                38: areturn




                                                                                                             5
public java.lang.Object invoke(java.lang.Object);
                                                               Code:
                                                                Stack=8, Locals=8, Args_size=2
                                                                0: aload_1
                                                                1:   aconst_null
                                                                2:   astore_1
                                                                3:   invokestatic   #65; //Method clojure/lang
                                                                6:   lstore_2
                                                                7:   lconst_1
                                                                8:   lstore 4

                                   macro                        10: lload_2
                                                                11: lconst_0
(defn fact [n]
  (loop [n (long n), a 1]          expand   analyze   emit      12: lcmp
                                                                13: ifne      25
    (if (== n 0)
                                                                16: lload     4
      a
                                                                18: invokestatic    #71; //Method clojure/lang
      (recur (dec n) (* n a)))))
                                                                21: goto      38
                                                                24: pop
                                                                25: lload_2
                                                                26: lconst_1
                                                                27: lsub
                                                                28: lload_2
                                                                29: lload     4
                                                                31: lmul
                                                                32: lstore 4
                                                                34: lstore_2
                                                                35: goto      10
                                                                38: areturn




                                                                                                             5
public java.lang.Object invoke(java.lang.Object);
                                                               Code:
                                                                Stack=8, Locals=8, Args_size=2
                                                                0: aload_1
                                                                1:   aconst_null
                                                                2:   astore_1
                                                                3:   invokestatic   #65; //Method clojure/lang
                                                                6:   lstore_2
                                                                7:   lconst_1
                                                                8:   lstore 4

                                   macro                        10: lload_2
                                                                11: lconst_0
(defn fact [n]
  (loop [n (long n), a 1]          expand   analyze   emit      12: lcmp
                                                                13: ifne      25
    (if (== n 0)
                                                                16: lload     4
      a
                                                                18: invokestatic    #71; //Method clojure/lang
      (recur (dec n) (* n a)))))
                                                                21: goto      38
                                                                24: pop
                                                                25: lload_2
                                                                26: lconst_1
                                                                27: lsub
                                                                28: lload_2
                                                                29: lload     4
                                                                31: lmul
                                                                32: lstore 4
                                                                34: lstore_2
                                                                35: goto      10
                                                                38: areturn




                                                                                                             5
public java.lang.Object invoke(java.lang.Object);
                                                                                                         Code:
                                                                                                          Stack=8, Locals=8, Args_size=2
                                                                                                          0: aload_1
                                                                                                          1:   aconst_null
                                                                                                          2:   astore_1
                                                                                                          3:   invokestatic   #65; //Method clojure/lang
                                                                                                          6:   lstore_2
                                                                                                          7:   lconst_1
                                                                                                          8:   lstore 4

                                   macro                                                                  10: lload_2
                                                                                                          11: lconst_0
(defn fact [n]
  (loop [n (long n), a 1]          expand                     analyze                           emit      12: lcmp
                                                                                                          13: ifne      25
    (if (== n 0)
                                                                                                          16: lload     4
      a
                                                                                                          18: invokestatic    #71; //Method clojure/lang
      (recur (dec n) (* n a)))))
                                                                                                          21: goto      38
                                                                                                          24: pop
                                                                                                          25: lload_2
                                            public java.lang.Object invoke(java.lang.Object);             26: lconst_1
                                              Code:                                                       27: lsub
                                               Stack=8, Locals=8, Args_size=2                             28: lload_2
                                               0: aload_1                                                 29: lload     4
                                               1:   aconst_null                                           31: lmul
                                               2:   astore_1                                              32: lstore 4
                                               3:   invokestatic   #65; //Method clojure/lang             34: lstore_2
                                               6:   lstore_2                                              35: goto      10
                                               7:   lconst_1                                              38: areturn
                                               8:   lstore 4
                                               10: lload_2
                                               11: lconst_0
                                               12: lcmp
                                               13: ifne      25
                                               16: lload     4
                                               18: invokestatic    #71; //Method clojure/lang
                                               21: goto      38
                                               24: pop
                                               25: lload_2
                                               26: lconst_1
                                               27: lsub
                                               28: lload_2
                                               29: lload     4
                                               31: lmul
                                               32: lstore 4
                                               34: lstore_2
                                               35: goto      10
                                               38: areturn
                                                                                                                                                       5
6
7
0.60

                         Clojure 1.2.1
                         iasm



0.45




0.30




0.15




  0
       100   200   300                   400




                                               9
10
Clojureによるバイトコードプログラミング

More Related Content

What's hot

Kamil witecki asynchronous, yet readable, code
Kamil witecki asynchronous, yet readable, codeKamil witecki asynchronous, yet readable, code
Kamil witecki asynchronous, yet readable, codeKamil Witecki
 
Kotlin 101 for Java Developers
Kotlin 101 for Java DevelopersKotlin 101 for Java Developers
Kotlin 101 for Java DevelopersChristoph Pickl
 
Java Bytecode Fundamentals - JUG.lv
Java Bytecode Fundamentals - JUG.lvJava Bytecode Fundamentals - JUG.lv
Java Bytecode Fundamentals - JUG.lvAnton Arhipov
 
Zarzadzanie pamiecia w .NET - WDI
Zarzadzanie pamiecia w .NET - WDIZarzadzanie pamiecia w .NET - WDI
Zarzadzanie pamiecia w .NET - WDIKonrad Kokosa
 
Improving Android Performance at Mobiconf 2014
Improving Android Performance at Mobiconf 2014Improving Android Performance at Mobiconf 2014
Improving Android Performance at Mobiconf 2014Raimon Ràfols
 
Understanding Java byte code and the class file format
Understanding Java byte code and the class file formatUnderstanding Java byte code and the class file format
Understanding Java byte code and the class file formatRafael Winterhalter
 
Virtual Separation of Concerns
Virtual Separation of ConcernsVirtual Separation of Concerns
Virtual Separation of Concernschk49
 
Making Java more dynamic: runtime code generation for the JVM
Making Java more dynamic: runtime code generation for the JVMMaking Java more dynamic: runtime code generation for the JVM
Making Java more dynamic: runtime code generation for the JVMRafael Winterhalter
 
An introduction to JVM performance
An introduction to JVM performanceAn introduction to JVM performance
An introduction to JVM performanceRafael Winterhalter
 
Legacy projects: how to win the race
Legacy projects: how to win the raceLegacy projects: how to win the race
Legacy projects: how to win the raceVictor_Cr
 
Synthesizing API Usage Examples
Synthesizing API Usage Examples Synthesizing API Usage Examples
Synthesizing API Usage Examples Ray Buse
 
A topology of memory leaks on the JVM
A topology of memory leaks on the JVMA topology of memory leaks on the JVM
A topology of memory leaks on the JVMRafael Winterhalter
 
Programming JVM Bytecode with Jitescript
Programming JVM Bytecode with JitescriptProgramming JVM Bytecode with Jitescript
Programming JVM Bytecode with JitescriptJoe Kutner
 
T-121-5300 (2008) User Interface Design 10 - UIML
T-121-5300 (2008) User Interface Design 10 - UIMLT-121-5300 (2008) User Interface Design 10 - UIML
T-121-5300 (2008) User Interface Design 10 - UIMLmniemi
 

What's hot (17)

Kamil witecki asynchronous, yet readable, code
Kamil witecki asynchronous, yet readable, codeKamil witecki asynchronous, yet readable, code
Kamil witecki asynchronous, yet readable, code
 
Kotlin 101 for Java Developers
Kotlin 101 for Java DevelopersKotlin 101 for Java Developers
Kotlin 101 for Java Developers
 
Java Bytecode Fundamentals - JUG.lv
Java Bytecode Fundamentals - JUG.lvJava Bytecode Fundamentals - JUG.lv
Java Bytecode Fundamentals - JUG.lv
 
Zarzadzanie pamiecia w .NET - WDI
Zarzadzanie pamiecia w .NET - WDIZarzadzanie pamiecia w .NET - WDI
Zarzadzanie pamiecia w .NET - WDI
 
Kotlin meets Gadsu
Kotlin meets GadsuKotlin meets Gadsu
Kotlin meets Gadsu
 
Improving Android Performance at Mobiconf 2014
Improving Android Performance at Mobiconf 2014Improving Android Performance at Mobiconf 2014
Improving Android Performance at Mobiconf 2014
 
Understanding Java byte code and the class file format
Understanding Java byte code and the class file formatUnderstanding Java byte code and the class file format
Understanding Java byte code and the class file format
 
Virtual Separation of Concerns
Virtual Separation of ConcernsVirtual Separation of Concerns
Virtual Separation of Concerns
 
Making Java more dynamic: runtime code generation for the JVM
Making Java more dynamic: runtime code generation for the JVMMaking Java more dynamic: runtime code generation for the JVM
Making Java more dynamic: runtime code generation for the JVM
 
An introduction to JVM performance
An introduction to JVM performanceAn introduction to JVM performance
An introduction to JVM performance
 
Java byte code in practice
Java byte code in practiceJava byte code in practice
Java byte code in practice
 
Legacy projects: how to win the race
Legacy projects: how to win the raceLegacy projects: how to win the race
Legacy projects: how to win the race
 
Synthesizing API Usage Examples
Synthesizing API Usage Examples Synthesizing API Usage Examples
Synthesizing API Usage Examples
 
A topology of memory leaks on the JVM
A topology of memory leaks on the JVMA topology of memory leaks on the JVM
A topology of memory leaks on the JVM
 
Programming JVM Bytecode with Jitescript
Programming JVM Bytecode with JitescriptProgramming JVM Bytecode with Jitescript
Programming JVM Bytecode with Jitescript
 
Unit testing concurrent code
Unit testing concurrent codeUnit testing concurrent code
Unit testing concurrent code
 
T-121-5300 (2008) User Interface Design 10 - UIML
T-121-5300 (2008) User Interface Design 10 - UIMLT-121-5300 (2008) User Interface Design 10 - UIML
T-121-5300 (2008) User Interface Design 10 - UIML
 

Viewers also liked

Barometrul educatiei si culturii antreprenoriale - 2014
Barometrul educatiei si culturii antreprenoriale - 2014Barometrul educatiei si culturii antreprenoriale - 2014
Barometrul educatiei si culturii antreprenoriale - 2014Mihaela Matei
 
Navigating the 5 c's - 2012 Beach Retreat
Navigating the 5 c's  - 2012 Beach RetreatNavigating the 5 c's  - 2012 Beach Retreat
Navigating the 5 c's - 2012 Beach RetreatTom Hood, CPA,CITP,CGMA
 
Biometric System Penetration in Resource Constrained Mobile Device
Biometric System Penetration in Resource Constrained Mobile DeviceBiometric System Penetration in Resource Constrained Mobile Device
Biometric System Penetration in Resource Constrained Mobile Deviceijbbjournal
 
The need to redefine genomic data sharing - moving towards Open Science Oct ...
The need to redefine genomic data sharing - moving towards Open Science  Oct ...The need to redefine genomic data sharing - moving towards Open Science  Oct ...
The need to redefine genomic data sharing - moving towards Open Science Oct ...Fiona Nielsen
 
Genome sharing projects around the world nijmegen oct 29 - 2015
Genome sharing projects around the world   nijmegen oct 29 - 2015Genome sharing projects around the world   nijmegen oct 29 - 2015
Genome sharing projects around the world nijmegen oct 29 - 2015Fiona Nielsen
 
Teo Migdalovici @ The Best of FMCG
Teo Migdalovici @ The Best of FMCGTeo Migdalovici @ The Best of FMCG
Teo Migdalovici @ The Best of FMCGTeodora Migdalovici
 
Campañas de Marketing en #BarcampUIO - 10/05/14
Campañas de Marketing en #BarcampUIO - 10/05/14Campañas de Marketing en #BarcampUIO - 10/05/14
Campañas de Marketing en #BarcampUIO - 10/05/14Adriana Alban
 
A Spirit Driven Ministry
A Spirit Driven MinistryA Spirit Driven Ministry
A Spirit Driven Ministryryrota
 
Economía Popular y Solidaria - Foro 1 - Guido Tunala - ESPE
Economía Popular y Solidaria - Foro 1 - Guido Tunala - ESPE Economía Popular y Solidaria - Foro 1 - Guido Tunala - ESPE
Economía Popular y Solidaria - Foro 1 - Guido Tunala - ESPE Guido Tunala
 
Call To Action Inc. Corporate presentation
Call To Action Inc. Corporate presentationCall To Action Inc. Corporate presentation
Call To Action Inc. Corporate presentationBallVice
 
La buena alimentación diapositivas
La buena alimentación diapositivasLa buena alimentación diapositivas
La buena alimentación diapositivasMarcela Puin
 
Vote for Whole Grain Crackers
Vote for Whole Grain CrackersVote for Whole Grain Crackers
Vote for Whole Grain CrackersFood Insight
 
The drainage basin as a system lesson 2
The drainage basin as a system   lesson 2The drainage basin as a system   lesson 2
The drainage basin as a system lesson 2Ms Geoflake
 
Recuperação paralela
Recuperação paralelaRecuperação paralela
Recuperação paralelatelasnorte1
 
【抄読会】化膿性椎体炎の抗菌薬治療期間
【抄読会】化膿性椎体炎の抗菌薬治療期間【抄読会】化膿性椎体炎の抗菌薬治療期間
【抄読会】化膿性椎体炎の抗菌薬治療期間Yoichi Sugar
 

Viewers also liked (19)

Barometrul educatiei si culturii antreprenoriale - 2014
Barometrul educatiei si culturii antreprenoriale - 2014Barometrul educatiei si culturii antreprenoriale - 2014
Barometrul educatiei si culturii antreprenoriale - 2014
 
Navigating the 5 c's - 2012 Beach Retreat
Navigating the 5 c's  - 2012 Beach RetreatNavigating the 5 c's  - 2012 Beach Retreat
Navigating the 5 c's - 2012 Beach Retreat
 
Biometric System Penetration in Resource Constrained Mobile Device
Biometric System Penetration in Resource Constrained Mobile DeviceBiometric System Penetration in Resource Constrained Mobile Device
Biometric System Penetration in Resource Constrained Mobile Device
 
The need to redefine genomic data sharing - moving towards Open Science Oct ...
The need to redefine genomic data sharing - moving towards Open Science  Oct ...The need to redefine genomic data sharing - moving towards Open Science  Oct ...
The need to redefine genomic data sharing - moving towards Open Science Oct ...
 
Genome sharing projects around the world nijmegen oct 29 - 2015
Genome sharing projects around the world   nijmegen oct 29 - 2015Genome sharing projects around the world   nijmegen oct 29 - 2015
Genome sharing projects around the world nijmegen oct 29 - 2015
 
Teo Migdalovici @ The Best of FMCG
Teo Migdalovici @ The Best of FMCGTeo Migdalovici @ The Best of FMCG
Teo Migdalovici @ The Best of FMCG
 
Campañas de Marketing en #BarcampUIO - 10/05/14
Campañas de Marketing en #BarcampUIO - 10/05/14Campañas de Marketing en #BarcampUIO - 10/05/14
Campañas de Marketing en #BarcampUIO - 10/05/14
 
Government Economic Service - Introduction and Application Process
Government Economic Service - Introduction and Application ProcessGovernment Economic Service - Introduction and Application Process
Government Economic Service - Introduction and Application Process
 
A Spirit Driven Ministry
A Spirit Driven MinistryA Spirit Driven Ministry
A Spirit Driven Ministry
 
Economía Popular y Solidaria - Foro 1 - Guido Tunala - ESPE
Economía Popular y Solidaria - Foro 1 - Guido Tunala - ESPE Economía Popular y Solidaria - Foro 1 - Guido Tunala - ESPE
Economía Popular y Solidaria - Foro 1 - Guido Tunala - ESPE
 
Unit Five
Unit FiveUnit Five
Unit Five
 
Call To Action Inc. Corporate presentation
Call To Action Inc. Corporate presentationCall To Action Inc. Corporate presentation
Call To Action Inc. Corporate presentation
 
Ácidos binarios
Ácidos binariosÁcidos binarios
Ácidos binarios
 
La buena alimentación diapositivas
La buena alimentación diapositivasLa buena alimentación diapositivas
La buena alimentación diapositivas
 
Vote for Whole Grain Crackers
Vote for Whole Grain CrackersVote for Whole Grain Crackers
Vote for Whole Grain Crackers
 
Dossier de presse "Aujourd'hui l'Ifsttar" - 22-23 septembre 2016
Dossier de presse "Aujourd'hui l'Ifsttar" - 22-23 septembre 2016Dossier de presse "Aujourd'hui l'Ifsttar" - 22-23 septembre 2016
Dossier de presse "Aujourd'hui l'Ifsttar" - 22-23 septembre 2016
 
The drainage basin as a system lesson 2
The drainage basin as a system   lesson 2The drainage basin as a system   lesson 2
The drainage basin as a system lesson 2
 
Recuperação paralela
Recuperação paralelaRecuperação paralela
Recuperação paralela
 
【抄読会】化膿性椎体炎の抗菌薬治療期間
【抄読会】化膿性椎体炎の抗菌薬治療期間【抄読会】化膿性椎体炎の抗菌薬治療期間
【抄読会】化膿性椎体炎の抗菌薬治療期間
 

Similar to Clojureによるバイトコードプログラミング

Improving Android Performance at Droidcon UK 2014
Improving Android Performance at Droidcon UK 2014Improving Android Performance at Droidcon UK 2014
Improving Android Performance at Droidcon UK 2014Raimon Ràfols
 
Javascript engine performance
Javascript engine performanceJavascript engine performance
Javascript engine performanceDuoyi Wu
 
No dark magic - Byte code engineering in the real world
No dark magic - Byte code engineering in the real worldNo dark magic - Byte code engineering in the real world
No dark magic - Byte code engineering in the real worldtcurdt
 
LatJUG. Java Bytecode Fundamentals
LatJUG. Java Bytecode FundamentalsLatJUG. Java Bytecode Fundamentals
LatJUG. Java Bytecode Fundamentalsdenis Udod
 
Parsing JSON Really Quickly: Lessons Learned
Parsing JSON Really Quickly: Lessons LearnedParsing JSON Really Quickly: Lessons Learned
Parsing JSON Really Quickly: Lessons LearnedDaniel Lemire
 
Meta-objective Lisp @名古屋 Reject 会議
Meta-objective Lisp @名古屋 Reject 会議Meta-objective Lisp @名古屋 Reject 会議
Meta-objective Lisp @名古屋 Reject 会議dico_leque
 
Improving Java performance at JBCNConf 2015
Improving Java performance at JBCNConf 2015Improving Java performance at JBCNConf 2015
Improving Java performance at JBCNConf 2015Raimon Ràfols
 
Virtual machine and javascript engine
Virtual machine and javascript engineVirtual machine and javascript engine
Virtual machine and javascript engineDuoyi Wu
 
Java, Up to Date Sources
Java, Up to Date SourcesJava, Up to Date Sources
Java, Up to Date Sources輝 子安
 
55 new things in Java 7 - Devoxx France
55 new things in Java 7 - Devoxx France55 new things in Java 7 - Devoxx France
55 new things in Java 7 - Devoxx FranceDavid Delabassee
 
The bytecode mumbo-jumbo
The bytecode mumbo-jumboThe bytecode mumbo-jumbo
The bytecode mumbo-jumboRaimon Ràfols
 
Consider the following C code snippet C codevoid setArray(int.pdf
Consider the following C code snippet C codevoid setArray(int.pdfConsider the following C code snippet C codevoid setArray(int.pdf
Consider the following C code snippet C codevoid setArray(int.pdfarihantmum
 
Hacking parse.y (RubyConf 2009)
Hacking parse.y (RubyConf 2009)Hacking parse.y (RubyConf 2009)
Hacking parse.y (RubyConf 2009)ujihisa
 
Java Bytecode: Passing Parameters
Java Bytecode: Passing ParametersJava Bytecode: Passing Parameters
Java Bytecode: Passing ParametersAnton Arhipov
 
The bytecode hocus pocus - JavaOne 2016
The bytecode hocus pocus - JavaOne 2016The bytecode hocus pocus - JavaOne 2016
The bytecode hocus pocus - JavaOne 2016Raimon Ràfols
 

Similar to Clojureによるバイトコードプログラミング (20)

19 Jo P July 08
19 Jo P July 0819 Jo P July 08
19 Jo P July 08
 
Improving Android Performance at Droidcon UK 2014
Improving Android Performance at Droidcon UK 2014Improving Android Performance at Droidcon UK 2014
Improving Android Performance at Droidcon UK 2014
 
Javascript engine performance
Javascript engine performanceJavascript engine performance
Javascript engine performance
 
No dark magic - Byte code engineering in the real world
No dark magic - Byte code engineering in the real worldNo dark magic - Byte code engineering in the real world
No dark magic - Byte code engineering in the real world
 
Marat-Slides
Marat-SlidesMarat-Slides
Marat-Slides
 
3
33
3
 
LatJUG. Java Bytecode Fundamentals
LatJUG. Java Bytecode FundamentalsLatJUG. Java Bytecode Fundamentals
LatJUG. Java Bytecode Fundamentals
 
Parsing JSON Really Quickly: Lessons Learned
Parsing JSON Really Quickly: Lessons LearnedParsing JSON Really Quickly: Lessons Learned
Parsing JSON Really Quickly: Lessons Learned
 
Meta-objective Lisp @名古屋 Reject 会議
Meta-objective Lisp @名古屋 Reject 会議Meta-objective Lisp @名古屋 Reject 会議
Meta-objective Lisp @名古屋 Reject 会議
 
Improving Java performance at JBCNConf 2015
Improving Java performance at JBCNConf 2015Improving Java performance at JBCNConf 2015
Improving Java performance at JBCNConf 2015
 
Stop Monkeys Fall
Stop Monkeys FallStop Monkeys Fall
Stop Monkeys Fall
 
Virtual machine and javascript engine
Virtual machine and javascript engineVirtual machine and javascript engine
Virtual machine and javascript engine
 
Java, Up to Date Sources
Java, Up to Date SourcesJava, Up to Date Sources
Java, Up to Date Sources
 
55 new things in Java 7 - Devoxx France
55 new things in Java 7 - Devoxx France55 new things in Java 7 - Devoxx France
55 new things in Java 7 - Devoxx France
 
The bytecode mumbo-jumbo
The bytecode mumbo-jumboThe bytecode mumbo-jumbo
The bytecode mumbo-jumbo
 
Consider the following C code snippet C codevoid setArray(int.pdf
Consider the following C code snippet C codevoid setArray(int.pdfConsider the following C code snippet C codevoid setArray(int.pdf
Consider the following C code snippet C codevoid setArray(int.pdf
 
Hacking parse.y (RubyConf 2009)
Hacking parse.y (RubyConf 2009)Hacking parse.y (RubyConf 2009)
Hacking parse.y (RubyConf 2009)
 
Java Bytecode: Passing Parameters
Java Bytecode: Passing ParametersJava Bytecode: Passing Parameters
Java Bytecode: Passing Parameters
 
Full Stack Clojure
Full Stack ClojureFull Stack Clojure
Full Stack Clojure
 
The bytecode hocus pocus - JavaOne 2016
The bytecode hocus pocus - JavaOne 2016The bytecode hocus pocus - JavaOne 2016
The bytecode hocus pocus - JavaOne 2016
 

More from sohta

Clojureシンタックスハイライター開発から考えるこれからのlispに必要なもの
Clojureシンタックスハイライター開発から考えるこれからのlispに必要なものClojureシンタックスハイライター開発から考えるこれからのlispに必要なもの
Clojureシンタックスハイライター開発から考えるこれからのlispに必要なものsohta
 
入門Transducers
入門Transducers入門Transducers
入門Transducerssohta
 
Clojure Language Update (2015)
Clojure Language Update (2015)Clojure Language Update (2015)
Clojure Language Update (2015)sohta
 
入門ClojureScript
入門ClojureScript入門ClojureScript
入門ClojureScriptsohta
 
入門core.async
入門core.async入門core.async
入門core.asyncsohta
 
プログラミング言語Clojureのニャンパスでの活用事例
プログラミング言語Clojureのニャンパスでの活用事例プログラミング言語Clojureのニャンパスでの活用事例
プログラミング言語Clojureのニャンパスでの活用事例sohta
 
REPLライフをもっと快適に
REPLライフをもっと快適にREPLライフをもっと快適に
REPLライフをもっと快適にsohta
 
genuine-highlighter: マクロを認識するClojure向けのシンタックスハイライター
genuine-highlighter: マクロを認識するClojure向けのシンタックスハイライターgenuine-highlighter: マクロを認識するClojure向けのシンタックスハイライター
genuine-highlighter: マクロを認識するClojure向けのシンタックスハイライターsohta
 
ClojureではじめるSTM入門
ClojureではじめるSTM入門ClojureではじめるSTM入門
ClojureではじめるSTM入門sohta
 
Macros in Clojure
Macros in ClojureMacros in Clojure
Macros in Clojuresohta
 

More from sohta (10)

Clojureシンタックスハイライター開発から考えるこれからのlispに必要なもの
Clojureシンタックスハイライター開発から考えるこれからのlispに必要なものClojureシンタックスハイライター開発から考えるこれからのlispに必要なもの
Clojureシンタックスハイライター開発から考えるこれからのlispに必要なもの
 
入門Transducers
入門Transducers入門Transducers
入門Transducers
 
Clojure Language Update (2015)
Clojure Language Update (2015)Clojure Language Update (2015)
Clojure Language Update (2015)
 
入門ClojureScript
入門ClojureScript入門ClojureScript
入門ClojureScript
 
入門core.async
入門core.async入門core.async
入門core.async
 
プログラミング言語Clojureのニャンパスでの活用事例
プログラミング言語Clojureのニャンパスでの活用事例プログラミング言語Clojureのニャンパスでの活用事例
プログラミング言語Clojureのニャンパスでの活用事例
 
REPLライフをもっと快適に
REPLライフをもっと快適にREPLライフをもっと快適に
REPLライフをもっと快適に
 
genuine-highlighter: マクロを認識するClojure向けのシンタックスハイライター
genuine-highlighter: マクロを認識するClojure向けのシンタックスハイライターgenuine-highlighter: マクロを認識するClojure向けのシンタックスハイライター
genuine-highlighter: マクロを認識するClojure向けのシンタックスハイライター
 
ClojureではじめるSTM入門
ClojureではじめるSTM入門ClojureではじめるSTM入門
ClojureではじめるSTM入門
 
Macros in Clojure
Macros in ClojureMacros in Clojure
Macros in Clojure
 

Recently uploaded

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 

Recently uploaded (20)

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 

Clojureによるバイトコードプログラミング

  • 1.
  • 2. 2
  • 3. public java.lang.Object invoke(java.lang.Object); Code: Stack=8, Locals=8, Args_size=2 0: aload_1 1: aconst_null 2: astore_1 3: invokestatic #65; //Method clojure/lang 6: lstore_2 7: lconst_1 8: lstore 4 10: lload_2 11: lconst_0 12: lcmp 13: ifne 25 16: lload 4 18: invokestatic #71; //Method clojure/lang 21: goto 38 24: pop 25: lload_2 26: lconst_1 27: lsub 28: lload_2 29: lload 4 (defn fact [n] 31: lmul (loop [n (long n), a 1] 32: lstore 4 (if (== n 0) 34: lstore_2 a 35: goto 10 (recur (dec n) (* n a))))) 38: areturn 3
  • 4. (def fact (fn-iasm [n] (aload_1) (checkcast Integer) (invokevirtual ^int Integer/intValue []) (istore_2) (iconst_1) (istore_3) :loop (iload_2) (ifeq :end) (ilaod_2) (iload_3) (imul) (istore_3) (iinc 2 -1) (goto :loop) :end (iload_3) (invokestatic ^Integer Integer/valueOf [int]) (areturn))) 4
  • 5. (def fact public final java.lang.Object invoke(java.lang. (fn-iasm [n] Code: (aload_1) Stack=2, Locals=6, Args_size=2 (checkcast Integer) 0: aload_1 (invokevirtual ^int Integer/intValue []) 1: checkcast #25; //class java/lang/I (istore_2) 4: invokevirtual #29; //Method java/lang/ (iconst_1) 7: istore_2 (istore_3) 8: iconst_1 :loop 9: istore_3 (iload_2) 10: iload_2 (ifeq :end) 11: ifeq 24 (ilaod_2) 14: iload_2 (iload_3) 15: iload_3 (imul) 16: imul (istore_3) 17: istore_3 (iinc 2 -1) 18: iinc 2, -1 (goto :loop) 21: goto 10 :end 24: iload_3 (iload_3) 25: invokestatic #33; //Method java/lang/ (invokestatic ^Integer Integer/valueOf [int]) 28: areturn (areturn))) 4
  • 6. public java.lang.Object invoke(java.lang.Object); Code: Stack=8, Locals=8, Args_size=2 0: aload_1 1: aconst_null 2: astore_1 3: invokestatic #65; //Method clojure/lang 6: lstore_2 7: lconst_1 8: lstore 4 macro 10: lload_2 11: lconst_0 (defn fact [n] (loop [n (long n), a 1] expand analyze emit 12: lcmp 13: ifne 25 (if (== n 0) 16: lload 4 a 18: invokestatic #71; //Method clojure/lang (recur (dec n) (* n a))))) 21: goto 38 24: pop 25: lload_2 26: lconst_1 27: lsub 28: lload_2 29: lload 4 31: lmul 32: lstore 4 34: lstore_2 35: goto 10 38: areturn 5
  • 7. public java.lang.Object invoke(java.lang.Object); Code: Stack=8, Locals=8, Args_size=2 0: aload_1 1: aconst_null 2: astore_1 3: invokestatic #65; //Method clojure/lang 6: lstore_2 7: lconst_1 8: lstore 4 macro 10: lload_2 11: lconst_0 (defn fact [n] (loop [n (long n), a 1] expand analyze emit 12: lcmp 13: ifne 25 (if (== n 0) 16: lload 4 a 18: invokestatic #71; //Method clojure/lang (recur (dec n) (* n a))))) 21: goto 38 24: pop 25: lload_2 26: lconst_1 27: lsub 28: lload_2 29: lload 4 31: lmul 32: lstore 4 34: lstore_2 35: goto 10 38: areturn 5
  • 8. public java.lang.Object invoke(java.lang.Object); Code: Stack=8, Locals=8, Args_size=2 0: aload_1 1: aconst_null 2: astore_1 3: invokestatic #65; //Method clojure/lang 6: lstore_2 7: lconst_1 8: lstore 4 macro 10: lload_2 11: lconst_0 (defn fact [n] (loop [n (long n), a 1] expand analyze emit 12: lcmp 13: ifne 25 (if (== n 0) 16: lload 4 a 18: invokestatic #71; //Method clojure/lang (recur (dec n) (* n a))))) 21: goto 38 24: pop 25: lload_2 26: lconst_1 27: lsub 28: lload_2 29: lload 4 31: lmul 32: lstore 4 34: lstore_2 35: goto 10 38: areturn 5
  • 9. public java.lang.Object invoke(java.lang.Object); Code: Stack=8, Locals=8, Args_size=2 0: aload_1 1: aconst_null 2: astore_1 3: invokestatic #65; //Method clojure/lang 6: lstore_2 7: lconst_1 8: lstore 4 macro 10: lload_2 11: lconst_0 (defn fact [n] (loop [n (long n), a 1] expand analyze emit 12: lcmp 13: ifne 25 (if (== n 0) 16: lload 4 a 18: invokestatic #71; //Method clojure/lang (recur (dec n) (* n a))))) 21: goto 38 24: pop 25: lload_2 public java.lang.Object invoke(java.lang.Object); 26: lconst_1 Code: 27: lsub Stack=8, Locals=8, Args_size=2 28: lload_2 0: aload_1 29: lload 4 1: aconst_null 31: lmul 2: astore_1 32: lstore 4 3: invokestatic #65; //Method clojure/lang 34: lstore_2 6: lstore_2 35: goto 10 7: lconst_1 38: areturn 8: lstore 4 10: lload_2 11: lconst_0 12: lcmp 13: ifne 25 16: lload 4 18: invokestatic #71; //Method clojure/lang 21: goto 38 24: pop 25: lload_2 26: lconst_1 27: lsub 28: lload_2 29: lload 4 31: lmul 32: lstore 4 34: lstore_2 35: goto 10 38: areturn 5
  • 10. 6
  • 11. 7
  • 12.
  • 13.
  • 14.
  • 15. 0.60 Clojure 1.2.1 iasm 0.45 0.30 0.15 0 100 200 300 400 9
  • 16. 10