jonasseglare / dcevm-complex-demo

Demonstrate bytecode reloading issues with DCEVM/HotswapAgent
0 stars 0 forks source link

dcevm 11.0.7 #1

Open skybber opened 4 years ago

skybber commented 4 years ago

Some Lambda issue was fixed in https://github.com/TravaOpenJDK/trava-jdk-11-dcevm/releases/tag/dcevm-11.0.7%2B1 . I'm not expert on Clojure, could you please add step-by-step instruction to README.md?

jonasseglare commented 4 years ago

Thank you very much for looking into this! The only thing you need to install except for DCEVM is Leiningen, a build tool for Clojure. I updated the README.md with detailed instructions: https://github.com/jonasseglare/dcevm-complex-demo#detailed-instructions-for-reproducing-it

I also tried with version 11.0.7+1 of DCEVM but unfortunately it does not seem to fix it.

skybber commented 4 years ago

With last dcevm version I've got:

dcevm-complex-demo.ad=> (raise-to-power (variable 3.0))
#object[AD 0x32d00a44 "AD(value=81.0, deriv=108.0)"]
dcevm-complex-demo.ad=> HOTSWAP AGENT: 11:46:57.752 RELOAD (org.hotswap.agent.config.PluginManager) - Reloading classes [AD] (autoHotswap)

But there is one issue with static fields. Dcevm does not use modified static values from redefined classes. It simply copies existing static fileds from old class to new class. It is not bug but feature. If you create a new static field, then dcevm left it null. Dcevm does not call class initializer <cinit> method. This issue fixes HA, that creates method and initializes only new static fields. Is the redefinition of static field some problem in case of clojure? May be we can change it in HA.