The Hidden Dynamic Life of Java by Nataliia Dziubenko

Поділитися
Вставка
  • Опубліковано 12 бер 2024
  • We are used to thinking that the Java compiler knows well beforehand what is going to happen at runtime... Is it so?
    Actually, Java is introducing more and more dynamic behaviour recently, which is facilitated by the `invokedynamic` instruction. Let's take a look at several use-cases when this is happening and see why we should care in the first place!
  • Наука та технологія

КОМЕНТАРІ • 2

  • @Gennys
    @Gennys 2 місяці тому +3

    Devvox is such a great organization. Thank you all for doing these conferences and making them available online!

  • @Gennys
    @Gennys 2 місяці тому +4

    I just wanted to point out at 10:48 one reason that javac is choosing to use invoke dynamic is because in earlier Java versions Javac would do an optimization if it could and then the JVM if it could at runtime. And those optimizations were essentially hard coded by Javac and the dependent on the version of the JVM that the byte code was running on.
    And that was the end of the story.
    If javac optimized something you would have to recompile to get a later better runtime optimization strategy.
    Now Javac will use the invoke dynamic strategy and that method handle can be dynamically linked depending on your runtime environment instead of being only dependent on compile or jvm itself.
    There are many other reasons to use invoke dynamic as a strategy as well. And I'm not a JVM architect so just take it as an example not as a law from me.