---
spec: JVMS
title: "The Java Virtual Machine Specification"
edition: "Java SE 24 Edition"
java_version: 24
chapter: "Chapter 4. The class File Format"
section: "4.10.1.3"
heading: "4.10.1.3. Instruction Representation"
parent: "4.10.1. Verification by Type Checking"
source: https://docs.oracle.com/javase/specs/jvms/se24/html/jvms-4.html#jvms-4.10.1.3
id: "4.10.1.3"
url: https://jvm.obfuscated.software/jvms/se24/4.10.1.3.html
raw: https://jvm.obfuscated.software/jvms/se24/4.10.1.3.md
---

# 4.10.1.3. Instruction Representation

Individual bytecode instructions are represented in Prolog as terms whose functor is the name of the instruction and whose arguments are its parsed operands.

For example, an *aload* instruction is represented as the term `aload(N)`, which includes the index `N` that is the operand of the instruction.

The instructions as a whole are represented as a list of terms of the form:

```
instruction(Offset, AnInstruction)
```

For example, `instruction(21, aload(1))`.

The order of instructions in this list must be the same as in the `class` file.

Some instructions have operands that refer to entries in the `constant_pool` table representing fields, methods, and dynamically-computed call sites. Such entries are represented as functor applications of the form:

- `field(FieldClassName, FieldName, FieldDescriptor)` for a constant pool entry that is a `CONSTANT_Fieldref_info` structure ([§4.4.2](4.4.2.md)).

  `FieldClassName` is the name of the class referenced by the `class_index` item in the structure. `FieldName` and `FieldDescriptor` correspond to the name and field descriptor referenced by the `name_and_type_index` item of the structure.

- `method(MethodClassName, MethodName, MethodDescriptor)` for a constant pool entry that is a `CONSTANT_Methodref_info` structure ([§4.4.2](4.4.2.md)).

  `MethodClassName` is the name of the class referenced by the `class_index` item of the structure. `MethodName` and `MethodDescriptor` correspond to the name and method descriptor referenced by the `name_and_type_index` item of the structure.

- `imethod(MethodIntfName, MethodName, MethodDescriptor)` for a constant pool entry that is a `CONSTANT_InterfaceMethodref_info` structure ([§4.4.2](4.4.2.md)).

  `MethodIntfName` is the name of the interface referenced by the `class_index` item of the structure. `MethodName` and `MethodDescriptor` correspond to the name and method descriptor referenced by the `name_and_type_index` item of the structure.

- `dmethod(CallSiteName, MethodDescriptor)` for a constant pool entry that is a `CONSTANT_InvokeDynamic_info` structure ([§4.4.10](4.4.10.md)).

  `CallSiteName` and `MethodDescriptor` correspond to the name and method descriptor referenced by the `name_and_type_index` item of the structure. (The `bootstrap_method_attr_index` item is irrelevant to verification.)

For clarity, we assume that field and method descriptors ([§4.3.2](4.3.2.md), [§4.3.3](4.3.3.md)) are mapped into more readable names: the leading `L` and trailing `;` are dropped from class names, and the *BaseType* characters used for primitive types are mapped to the names of those types.

For example, a *getfield* instruction whose operand refers to a constant pool entry representing a field `foo` of type `F` in class `Bar` would be represented as `getfield(field('Bar', 'foo', 'F'))`.

The *ldc* instruction, among others, has an operand that refers to a *loadable* entry in the `constant_pool` table. There are nine kinds of loadable entry (see [Table 4.4-C](4.4.md)), represented by functor applications of the following forms:

- `int(Value)` for a constant pool entry that is a `CONSTANT_Integer_info` structure ([§4.4.4](4.4.4.md)).

  `Value` is the `int` constant represented by the `bytes` item of the structure.

  For example, an *ldc* instruction for loading the `int` constant 91 would be represented as `ldc(int(91))`.

- `float(Value)` for a constant pool entry that is a `CONSTANT_Float_info` structure ([§4.4.4](4.4.4.md)).

  `Value` is the `float` constant represented by the `bytes` item of the structure.

- `long(Value)` for a constant pool entry that is a `CONSTANT_Long_info` structure ([§4.4.5](4.4.5.md)).

  `Value` is the `long` constant represented by the `high_bytes` and `low_bytes` items of the structure.

- `double(Value)` for a constant pool entry that is a `CONSTANT_Double_info` structure ([§4.4.5](4.4.5.md)).

  `Value` is the `double` constant represented by the `high_bytes` and `low_bytes` items of the structure.

- `class(ClassName)` for a constant pool entry that is a `CONSTANT_Class_info` structure ([§4.4.1](4.4.1.md)).

  `ClassName` is the name of the class or interface referenced by the `name_index` item in the structure.

- `string(Value)` for a constant pool entry that is a `CONSTANT_String_info` structure ([§4.4.3](4.4.3.md)).

  `Value` is the string referenced by the `string_index` item of the structure.

- `methodHandle(Kind, Reference)` for a constant pool entry that is a `CONSTANT_MethodHandle_info` structure ([§4.4.8](4.4.8.md)).

  `Kind` is the value of the `reference_kind` item of the structure. `Reference` is the value of the `reference_index` item of the structure.

- `methodType(MethodDescriptor)` for a constant pool entry that is a `CONSTANT_MethodType_info` structure ([§4.4.9](4.4.9.md)).

  `MethodDescriptor` is the method descriptor referenced by the `descriptor_index` item of the structure.

- `dconstant(ConstantName, FieldDescriptor)` for a constant pool entry that is a `CONSTANT_Dynamic_info` structure ([§4.4.10](4.4.10.md)).

  `ConstantName` and `FieldDescriptor` correspond to the name and field descriptor referenced by the `name_and_type_index` item of the structure. (The `bootstrap_method_attr_index` item is irrelevant to verification.)
