java - JVM bytecode limitations on class-class interactions -


i looking through jvm bytecode instructions , surprised see interactions between classes (e.g. casting, new, etc.) rely upon constant pool lookups identity of other classes.

am correct in inferring means 1 class cannot know existence of more 64k others, impossible refer them? if 1 did need refer many, ought 1 do--delegate work multiple classes each of have own <64k interactions?

(the reason interests me have habit of writing code generators, producing thousands of distinct classes, , languages (e.g. scala) create classes prolifically. seems if true have careful: if have hundreds of methods in class each using hundreds of (distinct) classes, exceed constant pool space.)

am correct in inferring means 1 class cannot know existence of more 64k others, impossible refer them?

i think correct. , don't forget there constant pool entries other things; e.g. of classes method , fields names, , of literal strings.

if 1 did need refer many, ought 1 do--delegate work multiple classes each of have own <64k interactions?

i guess so.

however, i'm not convinced concern ever realized in practice. hard conceive of class needs directly interact many other classes ... unless code generator ignoring structure of input source code.


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -