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

Java Bytecode Fundamentals - JUG.lv
Java Bytecode Fundamentals - JUG.lvJava Bytecode Fundamentals - JUG.lv
Java Bytecode Fundamentals - JUG.lv
Anton Arhipov
 
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
mniemi
 

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

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
Ms Geoflake
 
Recuperação paralela
Recuperação paralelaRecuperação paralela
Recuperação paralela
telasnorte1
 

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によるバイトコードプログラミング

Javascript engine performance
Javascript engine performanceJavascript engine performance
Javascript engine performance
Duoyi Wu
 
Meta-objective Lisp @名古屋 Reject 会議
Meta-objective Lisp @名古屋 Reject 会議Meta-objective Lisp @名古屋 Reject 会議
Meta-objective Lisp @名古屋 Reject 会議
dico_leque
 
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
arihantmum
 
Java Bytecode: Passing Parameters
Java Bytecode: Passing ParametersJava Bytecode: Passing Parameters
Java Bytecode: Passing Parameters
Anton Arhipov
 

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

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

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Recently uploaded (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
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
 

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