java - Accessing Nashorn generated bytecode -
nashorn translates javascript source code directly memory. there way access bytecode reading purpose? (manipulation isn't required). if there is, kindly explain in detail have limited experience... aware of javap showing java specific bytecode. want @ nashorn translated javascript bytecode.
you can use nashorn command line option "-pc" or "--print-code". nashorn print generated bytecode in javap-like format. example:
jjs -pc hello.js if want have .class files (which you'd want look/analyze other tools), can use "-d" or "--dump-debug-dir" specify directory generated classes saved. example,
jjs -d=tmp hello.js will generate .class files under "tmp" directory. please "jdk/nashorn/internal/script" directory under directory specified.
note you'll not able offline manipulate , re-load these classes in later nashorn session. debugging facility.
Comments
Post a Comment