Upgrade to Pro — share decks privately, control downloads, hide ads and more …

JVM の仕組みを理解して PHP で実装してみよう

JVM の仕組みを理解して PHP で実装してみよう

Nextbeat Tech Bar: Java/JVM祭り

Avatar for memory

memory

May 23, 2025
Tweet

More Decks by memory

Other Decks in Programming

Transcript

  1.   Λٙࣅ໋ྩηοτͰܭࢉ͢Δ 19 7. 7JSUVBM.BDIJOF ʹ͍ͭͯ constadd (operand: 1)

    constadd (operand: 2) constadd (operand: 3) plus plus output - constadd ໋ྩ͸ 1 ͭͷΦϖϥϯυΛऔΓɼͦΕΛελοΫ ʹϓογϡ͢Δ໋ྩ - plus ͸ελοΫ͔Β 2 ͭ஋Λϙοϓ͠ɼͦΕΛՃࢉͨ͠΋ͷ ΛελοΫʹϓογϡ͢Δ໋ྩ - output ͸ελοΫ͔ΒҰͭϙοϓ͠ग़ྗ͢Δ໋ྩ - ্هͷ 3 ͭͷ໋ྩͰ࣮ݱՄೳͰ͢ɻ͜ͷҰ࿈ͷྲྀΕΛ໋ྩ γʔέϯεͱݴͬͨΓ͠·͢ɻ
  2.   Λٙࣅ໋ྩηοτͰܭࢉ͢Δ 20 7. 7JSUVBM.BDIJOF ʹ͍ͭͯ constadd (operand: 1)

    constadd (operand: 2) constadd (operand: 3) plus plus output ελοΫ 1 ελοΫʹ 1 Λϓογϡ
  3.   Λٙࣅ໋ྩηοτͰܭࢉ͢Δ 21 7. 7JSUVBM.BDIJOF ʹ͍ͭͯ constadd (operand: 1)

    constadd (operand: 2) constadd (operand: 3) plus plus output ελοΫ 1 ελοΫʹ 2 Λϓογϡ 2
  4.   Λٙࣅ໋ྩηοτͰܭࢉ͢Δ 22 7. 7JSUVBM.BDIJOF ʹ͍ͭͯ constadd (operand: 1)

    constadd (operand: 2) constadd (operand: 3) plus plus output ελοΫ 1 2 ͭͷσʔλΛϙοϓ 2 3 Ճࢉͨ݁͠ՌΛϓογϡ
  5.   Λٙࣅ໋ྩηοτͰܭࢉ͢Δ 23 7. 7JSUVBM.BDIJOF ʹ͍ͭͯ constadd (operand: 1)

    constadd (operand: 2) constadd (operand: 3) plus plus output ελοΫ 3 ελοΫʹ 3 Λϓογϡ 3
  6.   Λٙࣅ໋ྩηοτͰܭࢉ͢Δ 24 7. 7JSUVBM.BDIJOF ʹ͍ͭͯ constadd (operand: 1)

    constadd (operand: 2) constadd (operand: 3) plus plus output ελοΫ 3 2 ͭͷσʔλΛϙοϓ 3 6 Ճࢉͨ݁͠ՌΛϓογϡ
  7.   Λٙࣅ໋ྩηοτͰܭࢉ͢Δ 25 7. 7JSUVBM.BDIJOF ʹ͍ͭͯ constadd (operand: 1)

    constadd (operand: 2) constadd (operand: 3) plus plus output ελοΫ 6 1 ͭͷσʔλΛϙοϓ
  8.  ͦͯ͠ɼ͜ΕΒ͸+7.4QFD 5IF +BWBš7JSUVBM.BDIJOF 4QFDJ fi DBUJPO ͱݺ͹ΕΔɼυΩϡϝϯτ͕ΦϯϥΠϯͰެ։͞Ε͓ͯΓɼ+7. Λࣗ࡞͢ΔڭՊॻͱ΋ͳΓ·͢ɻ 

    +%,͔Βɼจࣈྻॲཧͷ࠷దԽͳͲ͕͋Γ࣮૷͕൥ࡶʹͳΔͨΊɼखܰʹ΍Δ ͨΊʹ͸+%,Λਪ঑͠·͢ɻ  +%,͕͍͍ײ͡ʹಈ͍ͨΒɼ+%,ͳͲʹγϑτ͍ͯ͘͜͠ͱΛ͓͢͢Ί͠ ·͢ɻ  υΩϡϝϯτ͸ͪ͜ΒIUUQTEPDTPSBDMFDPNKBWBTFTQFDTKWNTTFIUNM 29 +7.ͷ࣮૷ํ๏
  9. 40 όΠφϦΛಡΈࠐΜͰ͍͘ྲྀΕ ClassFile Structure ΛಡΈࠐΉ Constant Pool ΛಡΈࠐΉ ϝιουͷ৘ใΛಡΈࠐΉ Code

    Attribute ΛಡΈࠐΉ ΦϖίʔυΛ࣮ߦ͢Δ ΦϖίʔυʢϓϩάϥϜʣΛ࣮ߦ͢ΔͨΊͷ
 લॲཧ
  10. 54

  11. 56