Module org.htmlunit.corejs
Class InstructionFormatter
java.lang.Object
org.htmlunit.corejs.javascript.interpreterv2.InstructionFormatter
Utility class for formatting InterpreterV2 instructions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidappendString(StringBuilder sb, String value) static StringformatInstruction(String name, Object... operands) LikeformatInstruction(Instruction, Object...)but with an explicit instruction name.static StringformatInstruction(Instruction instruction, Object... operands) Format multiple operands as a comma-separated parameter list.static StringformatOffset(int offset) Format a relative jump offset for display.static StringformatTarget(int targetPC) Format a jump target as a virtual register reference.
-
Constructor Details
-
InstructionFormatter
public InstructionFormatter()
-
-
Method Details
-
formatTarget
Format a jump target as a virtual register reference.- Parameters:
targetPC- the target program counter- Returns:
- formatted target reference (e.g., "%7", "%12")
-
formatOffset
Format a relative jump offset for display.- Parameters:
offset- the jump offset (positive or negative)- Returns:
- formatted offset string (e.g., "+5", "-3")
-
formatInstruction
Format multiple operands as a comma-separated parameter list.- Parameters:
operands- variable number of key-value pairs (key1, value1, key2, value2, ...)- Returns:
- formatted parameter list (e.g., "args=2, receiver=true")
-
formatInstruction
LikeformatInstruction(Instruction, Object...)but with an explicit instruction name. Used by specialized variants (e.g. the arity-specializedCall) that want to present themselves under a common name regardless of their concrete class. -
appendString
-