How can I figure out the index of an entry of the constant pool?
Currently, I am trying to implementing my own JVM using Rust and your crate. Thanks for your significant effort.
I am working on the runtime constant pool right now, and I need to know the index for each entry. It seems that you only provided a simple iterator which may be the only way to access to the entries of constant pool and is not able to acquire the index of a certain entry.
I do suppose that we can have the iterator return a tuple like (index, entry). What do you think?
Hi, thanks for reaching out. I'm curious, why do you need the index of the entries in the constant pool? What kinds of operations do you need to do that require it?
Hi, thanks for reaching out. I'm curious, why do you need the index of the entries in the constant pool? What kinds of operations do you need to do that require it?
I notice that you have already resolved the entries and bound them to the opcode like ldc, but I would like to deal with the opcode in a more primitive way, that is, to process them in the executor byte-wise. Besides, having these indexes might make the use of the constant pool more flexible.
By the way, is it your goal to support some reserved opcodes further?
The indexes are kind of an implementation detail given the abstraction layer this library is targeting, which is why I intentionally didn't expose them in the API. That's why I'd like to know why you need them exposed. It's possible that what you're trying to do should instead be part of this library to maintain a consistent abstraction. Do you have sample or WIP code that illustrates the use case?
Also which reserved opcodes are you referring to?
Closing issue due to lack of response