---
spec: JVMS
title: "The Java Virtual Machine Specification"
edition: "Java SE 27 Edition"
java_version: 27
chapter: "Chapter 4. The class File Format"
section: "4.10.1.9.if_acmp_cond"
heading: "if_acmp<cond>"
parent: "4.10.1.9. Type Checking Instructions"
source: https://docs.oracle.com/javase/specs/jvms/se27/html/jvms-4.html#jvms-4.10.1.9.if_acmp_cond
id: "4.10.1.9.if_acmp_cond"
url: https://jvm.obfuscated.software/jvms/se27/4.10.1.9.if_acmp_cond.html
raw: https://jvm.obfuscated.software/jvms/se27/4.10.1.9.if_acmp_cond.md
---

# if_acmp\<cond>

An *if_acmpeq* instruction is type safe iff one can validly pop types matching `Object` and `Object` on the incoming operand stack yielding the outgoing type state `NextStackFrame`, and the operand of the instruction, `Target`, is a valid branch target assuming an incoming type state of `NextStackFrame`.

```
instructionIsTypeSafe(if_acmpeq(Target), Environment, _Offset, StackFrame,
                      NextStackFrame, ExceptionStackFrame) :-
    isBootstrapLoader(BL),
    objectType = class('java/lang/Object', BL),
    canPop(StackFrame, [objectType, objectType], NextStackFrame),
    targetIsTypeSafe(Environment, NextStackFrame, Target),
    exceptionStackFrame(StackFrame, ExceptionStackFrame).
```

The rule for *if_acmpne* is identical.

```
instructionHasEquivalentTypeRule(if_acmpne(Target), if_acmpeq(Target)).
```
