Class StoreToArrayAgent
- java.lang.Object
-
- org.eolang.opeo.decompilation.agents.StoreToArrayAgent
-
- All Implemented Interfaces:
DecompilationAgent
public final class StoreToArrayAgent extends Object implements DecompilationAgent
Store to array instruction handler. Store a reference in an array Opcodes: aastore Stack [before]->[after]: "arrayref, index, value →"- Since:
- 0.1
- To do:
- #277:90min Conflict between
StoreToArrayAgent
andDupAgent
. We have a strange conflict between these two agents. -StoreToArrayAgent
is supposed to leave stack empty, or at least do not push anything, but it pushes a newStoreArray
object. Which is wrong. -DupAgent
is supposed to push a new object, but it does not push anything. However both this bugs compensate each other somehow and our transformations work as expected. But this is not a good practice. We should adhere to bytecode specification for both agents:DupAgent
should push a new object andStoreToArrayAgent
should not push anything.
-
-
Constructor Summary
Constructors Constructor Description StoreToArrayAgent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
appropriate(DecompilerState state)
Check if the agent is suitable for the current state.void
handle(DecompilerState state)
Handle the current state.org.eolang.opeo.decompilation.agents.Supported
supported()
Supported opcodes.
-
-
-
Method Detail
-
appropriate
public boolean appropriate(DecompilerState state)
Description copied from interface:DecompilationAgent
Check if the agent is suitable for the current state.- Specified by:
appropriate
in interfaceDecompilationAgent
- Parameters:
state
- Current state.- Returns:
- True if the agent is suitable for the current state.
-
supported
public org.eolang.opeo.decompilation.agents.Supported supported()
Description copied from interface:DecompilationAgent
Supported opcodes.- Specified by:
supported
in interfaceDecompilationAgent
- Returns:
- Supported opcodes.
-
handle
public void handle(DecompilerState state)
Description copied from interface:DecompilationAgent
Handle the current state.- Specified by:
handle
in interfaceDecompilationAgent
- Parameters:
state
- Current state to handle together with operand stack and variables.
-
-