Class AbstractOpcode
java.lang.Object
ai.timefold.jpyinterpreter.opcodes.AbstractOpcode
- All Implemented Interfaces:
Opcode
- Direct Known Subclasses:
BeforeWithOpcode,BinaryDunderOpcode,BuildConstantKeyMapOpcode,BuildListOpcode,BuildMapOpcode,BuildSetOpcode,BuildSliceOpcode,BuildStringOpcode,BuildTupleOpcode,CallFunctionKeywordOpcode,CallFunctionOpcode,CallFunctionUnpackOpcode,CallMethodOpcode,CallOpcode,CheckExcMatchOpcode,CleanupThrowOpcode,CollectionAddAllOpcode,CollectionAddOpcode,CompareOpcode,ContainsOpcode,CopyOpcode,DeleteAttrOpcode,DeleteDerefOpcode,DeleteFastOpcode,DeleteGlobalOpcode,DeleteItemOpcode,DupOpcode,DupTwoOpcode,FormatValueOpcode,GeneratorStartOpcode,GetIterOpcode,GetSliceOpcode,GetYieldFromIterOpcode,ImportFromOpcode,ImportNameOpcode,IsOpcode,ListToTupleOpcode,LoadAssertionErrorOpcode,LoadAttrOpcode,LoadClosureOpcode,LoadConstantOpcode,LoadDerefOpcode,LoadFastAndClearOpcode,LoadFastOpcode,LoadGlobalOpcode,LoadMethodOpcode,LoadSuperAttrOpcode,MakeFunctionOpcode,MapMergeOpcode,MapPutAllOpcode,MapPutOpcode,NopOpcode,NotOpcode,PopBlockOpcode,PopExceptOpcode,PopOpcode,PrintExprOpcode,PushExcInfoOpcode,PushNullOpcode,ResumeOpcode,ReturnGeneratorOpcode,RotateFourOpcode,RotateThreeOpcode,RotateTwoOpcode,SetCallKeywordNameTupleOpcode,SetItemOpcode,StopIteratorErrorOpcode,StoreAttrOpcode,StoreDerefOpcode,StoreFastOpcode,StoreGlobalOpcode,StoreSliceOpcode,SwapOpcode,UniDunerOpcode,UnpackSequenceOpcode,UnpackSequenceWithTailOpcode,WithExceptStartOpcode,YieldFromOpcode,YieldValueOpcode
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturn the bytecode index of the instruction, which can be used to identify the instruction as the target of a jump.protected abstract StackMetadatagetStackMetadataAfterInstruction(FunctionMetadata functionMetadata, StackMetadata stackMetadata) getStackMetadataAfterInstructionForBranches(FunctionMetadata functionMetadata, StackMetadata stackMetadata) Return a list ofStackMetadatacorresponding to each branch returned byOpcode.getPossibleNextBytecodeIndexList().booleanstatic OpcodeDescriptorlookupInstruction(String name) toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ai.timefold.jpyinterpreter.opcodes.Opcode
getPossibleNextBytecodeIndexList, implement, isForcedJump
-
Field Details
-
instruction
-
-
Constructor Details
-
AbstractOpcode
-
-
Method Details
-
getInstruction
-
getBytecodeIndex
public int getBytecodeIndex()Description copied from interface:OpcodeReturn the bytecode index of the instruction, which can be used to identify the instruction as the target of a jump.- Specified by:
getBytecodeIndexin interfaceOpcode- Returns:
- The bytecode index of the instruction, which is defined as the number of instructions before it in the instruction listing.
-
isJumpTarget
public boolean isJumpTarget()- Specified by:
isJumpTargetin interfaceOpcode- Returns:
- true if this opcode the target of a jump
-
getStackMetadataAfterInstructionForBranches
public List<StackMetadata> getStackMetadataAfterInstructionForBranches(FunctionMetadata functionMetadata, StackMetadata stackMetadata) Description copied from interface:OpcodeReturn a list ofStackMetadatacorresponding to each branch returned byOpcode.getPossibleNextBytecodeIndexList().- Specified by:
getStackMetadataAfterInstructionForBranchesin interfaceOpcode- Parameters:
functionMetadata- Metadata about the function being compiled.stackMetadata- the StackMetadata just before this instruction is executed.- Returns:
- a new List, the same size as
Opcode.getPossibleNextBytecodeIndexList(), containing the StackMetadata after this instruction is executed for the given branch inOpcode.getPossibleNextBytecodeIndexList().
-
getStackMetadataAfterInstruction
protected abstract StackMetadata getStackMetadataAfterInstruction(FunctionMetadata functionMetadata, StackMetadata stackMetadata) -
lookupInstruction
-
toString
-