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

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
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
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
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
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 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