Openj9: Incorrect runtime behavior

Created on 10 Mar 2020  Â·  29Comments  Â·  Source: eclipse/openj9

Using jdk-11.0.6+10_openj9-0.18.1
Downloaded from https://adoptopenjdk.net/?variant=openjdk11&jvmVariant=openj9

Summary of problem

Running a valid program results in a call to a method of a different type.
The program contains code that has a formal parameter of type T and will later, after the formal parameter is "dead" reuse the local to store a value of a different type S. In the reproduction the types T and S coincidentally have java.lang.List as a common super type.

Original report of the issue is:
https://issuetracker.google.com/issues/150155487

To reproduce the issue, on a linux machine:

  1. Install the above.
  2. Download reproduction project in:
    https://issuetracker.google.com/issues/150155487#comment1
  3. run JAVA_HOME=<path_to_jdk> ./gradlew assembleDebug

Additional information

A javap dump of the class witnessing the issue is at:
https://issuetracker.google.com/issues/150155487#comment9

The suspected method causing the issue is:
com.android.tools.r8.ir.regalloc.LinearScanRegisterAllocator.a( com.android.tools.r8.m.a.a.b.d0<com.android.tools.r8.ir.code.BasicBlock>, java.util.List<com.android.tools.r8.ir.regalloc.LiveIntervals>, com.android.tools.r8.ir.regalloc.RegisterAllocator, java.util.Map<com.android.tools.r8.ir.code.BasicBlock, com.android.tools.r8.ir.code.IRCode$b>)

As detailed in comment 10 in the issue:

The first formal is com.android.tools.r8.m.a.a.b.d0 initially located in local 0.
pc 277: Local 0 is pushed on the stack.
pc 294: Stores a LinkedList in local 0.
pc 554: Loads local 0, which should be of type LinkedList, but appears to be 'd0' (which was originally an ImmutableList from guava.)

Looking the stack maps:
pc 321 (= 16+37+25+40+7+29+7+15+19+63+63)
indicates that local 0 is indeed of type LinkedList and does not change in any subsequent frame.

It is not clear if this is a correct analysis of the issue, but the code is correct as far as we can see and runs without issue on other VMs.

x86 jit vm userRaised

Most helpful comment

I will handle the merge and will comment to request the backport to the release branch once the change is approved - thanks for the flag to make sure this happens.

All 29 comments

@andrewcraik @cathyzhyi based on the description in https://issuetracker.google.com/issues/150155487 , I suspect this is a JIT bug. Can you (or someone on your team) take a look?

@zerny Hey Ian, I followed the instructions and tried with
GRADLE_USER_HOME=tmp/ ./gradlew clean :app:assembleDebug --no-build-cache --stacktrace and got the following error:

* Exception is:
org.gradle.execution.TaskSelectionException: Task 'assembleDebug' not found in project ':app'.
        at org.gradle.execution.TaskSelector.getSelection(TaskSelector.java:117)
        at org.gradle.execution.TaskSelector.getSelection(TaskSelector.java:82)
        at org.gradle.execution.commandline.CommandLineTaskParser.parseTasks(CommandLineTaskParser.java:42)
        at org.gradle.execution.TaskNameResolvingBuildConfigurationAction.configure(TaskNameResolvingBuildConfigurationAction.java:46)
        at org.gradle.execution.DefaultBuildConfigurationActionExecuter.configure(DefaultBuildConfigurationActionExecuter.java:58)
        at org.gradle.execution.DefaultBuildConfigurationActionExecuter.access$200(DefaultBuildConfigurationActionExecuter.java:26)
        at org.gradle.execution.DefaultBuildConfigurationActionExecuter$2.proceed(DefaultBuildConfigurationActionExecuter.java:66)
        at org.gradle.execution.DefaultTasksBuildExecutionAction.configure(DefaultTasksBuildExecutionAction.java:45)

Am I missing something? Thanks!

Hi @cathyzhyi! It is most likely that you are missing AndroidSDK which is required in order to run the build. You can specify path to the SDK by updating $project_root/local.properties file and changing sdk.dir=<path_to_sdk>/Android/Sdk.

In order to download the AndroidSDK, you can do the following:

  • download any version of AndroidStudio (https://developer.android.com/studio)
  • launch SdkManager (ctrl + shift + A, and type "Sdk Manager")
  • choose "Android 10.0 (Q)" to install
  • default location is shown in the Sdk Manager window e.g. on Linux $USER_HOME/Android/Sdk

You only need the Android Sdk, and you should be able to reproduce by
building from the command line. Android Studio is not necessary, it was
just a suggestion on how to download the SDK components.

On Fri, Mar 13, 2020, 7:15 PM Yi Zhang notifications@github.com wrote:

Hey @gavra0 https://github.com/gavra0 , do I need to install the
android studio to reproduce the problem? Or I only need the SDK?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/eclipse/openj9/issues/8823#issuecomment-598874357,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AA6FYQWTW6B4MWSF3ASDJ53RHKA4TANCNFSM4LFHJAUA
.

assigned to @Charlmzz

We're past Milestone 2 for the 0.20.0 release, moving this forward to the next release.

@Charlmzz / @cathyzhyi any update?

I have reproduced this issue and I'm working towards analyzing it.

FYI, I'm taking over this work from @Charlmzz.

So.... I'm able to reproduce this with OPENJ9_JAVA_OPTIONS="-Xshareclasses:none -Xint" GRADLE_USER_HOME=tmp/ ./gradlew clean :app:assembleDebug --no-build-cache which suggests the immediate issue is not related to the JIT. Unfortunately, I haven't been able to narrow this down any further yet.

FYI @DanHeidinga @andrewcraik @cathyzhyi

@Leonardo2718 Are you reproducing the java.lang.UnsupportedOperationException? If so, can you capture cores using something like "-Xdump:system+java:events=throw+systhrow,filter=java/lang/UnsupportedOperationException,request=exclusive+prepwalk+preempt" [1]

If this is reproducible on an IBM internal machine (ie: fyre) can you share the credentials privately so we can save on the setup?

[1] https://www.eclipse.org/openj9/tools/xdump_option_builder.html - really helpful tool for generating -Xdump options.

@DanHeidinga Yes I did reproduce the java.lang.UnsupportedOperationException.

Sure, I'll try generating cores using -Xdump:.

I've actually been debugging this on my local machine so I can't really share my setup. I do have a _very_ hacked together docker image I can share. Although, I found setting up the environment locally wasn't very difficult.

@DanHeidinga I've been trying to get some cores using -Xdump but so far, I haven't been able to get anything for the exceptions from the stack trace. I do get core files when I filter for other exceptions classes though (e.g. I have several cores for org/gradle/initialization/ReportedException). Do you have any ideas that could help?

@liqunl thoughts? would be good to get this moving forward again so could you see if you can help @Leonardo2718 ?

@Leonardo2718 Could you try -Xdump:system+java:events=throw+systhrow,filter=java/lang/UnsupportedOperationException#com/android/tools/r8/com/google/common/collect/ImmutableCollection.removeIf,range=1..1

Short update: Turns out this is probably a JIT issue after all. The problem actually occurs in the Gradle daemon, which I hadn't realized until now :disappointed:, so my options weren't being passed through.

Alright, with @liqunl's help, I've been able to make some progress on narrowing down this issue.

The immediate failure is caused by the JIT inlining the wrong target function. However, this seems to happen because the Java bytecode being compiled is itself incorrect, as explained in [1], which causes the inliner to get confused.

I'm not sure yet why the bytecode is incorrect. @DanHeidinga Do you have any ideas?

I've uploaded a corefile and javacore to [2], which I produced using the JDK from [3].

[1] https://issuetracker.google.com/issues/150155487#comment10/jdk-11.0.7%2B10_openj9-0.20.0/OpenJDK11U-jdk_x64_linux_openj9_11.0.7_10_openj9-0.20.0.tar.gz
[2] https://ibm.box.com/s/zlrv17o4mbuv9bjlg8np5lk15e1ck6da
[3] https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.7%2B10_openj9-0.20.0/OpenJDK11U-jdk_x64_linux_openj9_11.0.7_10_openj9-0.20.0.tar.gz

The immediate failure is caused by the JIT inlining the wrong target function. However, this seems to happen because the Java bytecode being compiled is itself incorrect, as explained in [1], which causes the inliner to get confused.

I'm not sure yet why the bytecode is incorrect. @DanHeidinga Do you have any ideas?

To clarify, I think the problem might be that the class file is not loaded correctly.

> !stackslots 0x0000000001803E00
<1803e00> *** BEGIN STACK WALK, flags = 00400001 walkThread = 0x0000000001803E00 ***
<1803e00>   ITERATE_O_SLOTS
<1803e00>   RECORD_BYTECODE_PC_OFFSET
<1803e00> Initial values: walkSP = 0x000000000182D4E8, PC = 0x0000000000000005, literals = 0x0000000000000000, A0 = 0x000000000182D508, j2iFrame = 0x000000000182E418, ELS = 0x00007FCF75EACBA0, decomp = 0x0000000000000000
<1803e00> JIT resolve frame: bp = 0x000000000182D508, sp = 0x000000000182D4E8, pc = 0x0000000000000005, cp = 0x0000000000000000, arg0EA = 0x000000000182D508, flags = 0x0000000000080000
<1803e00>   Object push (savedJITException)
<1803e00>       O-Slot[0x000000000182D4E8] = 0x00000000FE8790A8
<1803e00>   Generic resolve
<1803e00>   unwindSP initialized to 0x000000000182D510
<1803e00>   JIT-Resolve-RegisterMap[0x00007FCF75EACA60] = UDATA(0x00000000FF0AA120) (jit_rax)
<1803e00>   JIT-Resolve-RegisterMap[0x00007FCF75EACA68] = UDATA(0x00000000FF0AA120) (jit_rbx)
<1803e00>   JIT-Resolve-RegisterMap[0x00007FCF75EACA70] = UDATA(0x00007FCF76579CA7) (jit_rcx)
<1803e00>   JIT-Resolve-RegisterMap[0x00007FCF75EACA78] = UDATA(0x00007FCF90E83640) (jit_rdx)
<1803e00>   JIT-Resolve-RegisterMap[0x00007FCF75EACA80] = UDATA(0x00007FCFA0049EC0) (jit_rdi)
<1803e00>   JIT-Resolve-RegisterMap[0x00007FCF75EACA88] = UDATA(0x0000000001803E00) (jit_rsi)
<1803e00>   JIT-Resolve-RegisterMap[0x00007FCF75EACA90] = UDATA(0x0000000000004010) (jit_rbp)
<1803e00>   JIT-Resolve-RegisterMap[0x00007FCF75EACA98] = UDATA(0x0000000000004000) (jit_rsp)
<1803e00>   JIT-Resolve-RegisterMap[0x00007FCF75EACAA0] = UDATA(0x0000000000000000) (jit_r8)
<1803e00>   JIT-Resolve-RegisterMap[0x00007FCF75EACAA8] = UDATA(0x0000000000000000) (jit_r9)
<1803e00>   JIT-Resolve-RegisterMap[0x00007FCF75EACAB0] = UDATA(0xFFFFFFFFFFFFFFFF) (jit_r10)
<1803e00>   JIT-Resolve-RegisterMap[0x00007FCF75EACAB8] = UDATA(0xFFFFFFFFFFFFFE18) (jit_r11)
<1803e00>   JIT-Resolve-RegisterMap[0x00007FCF75EACAC0] = UDATA(0x00000000FE9A8200) (jit_r12)
<1803e00>   JIT-Resolve-RegisterMap[0x00007FCF75EACAC8] = UDATA(0x0000000000000001) (jit_r13)
<1803e00>   JIT-Resolve-RegisterMap[0x00007FCF75EACAD0] = UDATA(0x00000000FF0AA110) (jit_r14)
<1803e00>   JIT-Resolve-RegisterMap[0x00007FCF75EACAD8] = UDATA(0x00000000FF0AA110) (jit_r15)
<1803e00> JIT inline frame: bp = 0x000000000182D5F8, pc = 0x00007FCF76504D3D, unwindSP = 0x000000000182D510, cp = 0x00000000019516A0, arg0EA = 0x0000000000000000, jitInfo = 0x00007FCF4DEC3378
<1803e00>   Method: com/android/tools/r8/m/a/a/b/Y.removeIf(Ljava/util/function/Predicate;)Z !j9method 0x00000000019515E0
<1803e00>   Bytecode index = 7, inlineDepth = 1, PC offset = 0x00007FCF76503D9C
<1803e00> JIT frame: bp = 0x000000000182D5F8, pc = 0x00007FCF76504D3D, unwindSP = 0x000000000182D510, cp = 0x0000000001AE7FC0, arg0EA = 0x000000000182D618, jitInfo = 0x00007FCF4DEC3378
<1803e00>   Method: com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator.a(Lcom/android/tools/r8/m/a/a/b/d0;Ljava/util/List;Lcom/android/tools/r8/ir/regalloc/RegisterAllocator;Ljava/util/Map;)V !j9method 0x0000000001AEA440
<1803e00>   Bytecode index = 593, inlineDepth = 0, PC offset = 0x0000000000001D75
<1803e00>   stackMap=0x00007FCF4DEC4394, slots=I16(0x0004) parmBaseOffset=I16(0x0008), parmSlots=U16(0x0004), localBaseOffset=I16(0xFF70)
<1803e00>   Described JIT args starting at 0x000000000182D600 for U16(0x0004) slots
<1803e00>       O-Slot: : a3[0x000000000182D600] = 0x00000000FEDD3EE0
<1803e00>       O-Slot: : a2[0x000000000182D608] = 0x00000000FEDCE8B0
<1803e00>       O-Slot: : a1[0x000000000182D610] = 0x00000000FF0A9D18
<1803e00>       O-Slot: : a0[0x000000000182D618] = 0x00000000FF0A9D00
<1803e00>   Described JIT temps starting at 0x000000000182D568 for IDATA(0x0000000000000012) slots
<1803e00>       I-Slot: : t17[0x000000000182D568] = 0x00000000FF0A9D00
<1803e00>       I-Slot: : t16[0x000000000182D570] = 0x00000000FE9A8200
<1803e00>       I-Slot: : t15[0x000000000182D578] = 0x00000000000001C0
<1803e00>       I-Slot: : t14[0x000000000182D580] = 0x00000000FF0A9E88
<1803e00>       I-Slot: : t13[0x000000000182D588] = 0x00000000FF0A9FF8
<1803e00>       I-Slot: : t12[0x000000000182D590] = 0x00000000000001C0
<1803e00>       I-Slot: : t11[0x000000000182D598] = 0x0000000100000000
<1803e00>       I-Slot: : t10[0x000000000182D5A0] = 0x00000000FE9A8200
<1803e00>       I-Slot: : t9[0x000000000182D5A8] = 0x00000000FF0AA030
<1803e00>       I-Slot: : t8[0x000000000182D5B0] = 0x00000000FF0A9FF8
<1803e00>       I-Slot: : t7[0x000000000182D5B8] = 0x00000000FE879CA8
<1803e00>       I-Slot: : t6[0x000000000182D5C0] = 0x00000000FF0A9FE0
<1803e00>       I-Slot: : t5[0x000000000182D5C8] = 0x00000000FF0A9D30
<1803e00>       I-Slot: : t4[0x000000000182D5D0] = 0x00000000FF10A398
<1803e00>       I-Slot: : t3[0x000000000182D5D8] = 0x00000000FEFF1768
<1803e00>       I-Slot: : t2[0x000000000182D5E0] = 0x00000000FF0A9B00
<1803e00>       I-Slot: : t1[0x000000000182D5E8] = 0x00000000000001C2
<1803e00>       I-Slot: : t0[0x000000000182D5F0] = 0x0000000000000001
<1803e00>   JIT-RegisterMap = UDATA(0x0000000000000001)
<1803e00>       JIT-RegisterMap-O-Slot[0x00007FCF75EACA60] = 0x00000000FF0AA120 (jit_rax)
<1803e00>       JIT-RegisterMap-I-Slot[0x00007FCF75EACA68] = UDATA(0x00000000FF0AA120) (jit_rbx)
<1803e00>       JIT-RegisterMap-I-Slot[0x00007FCF75EACA70] = UDATA(0x00007FCF76579CA7) (jit_rcx)
<1803e00>       JIT-RegisterMap-I-Slot[0x00007FCF75EACA78] = UDATA(0x00007FCF90E83640) (jit_rdx)
<1803e00>       JIT-RegisterMap-I-Slot[0x00007FCF75EACA80] = UDATA(0x00007FCFA0049EC0) (jit_rdi)
<1803e00>       JIT-RegisterMap-I-Slot[0x00007FCF75EACA88] = UDATA(0x0000000001803E00) (jit_rsi)
<1803e00>       JIT-RegisterMap-I-Slot[0x00007FCF75EACA90] = UDATA(0x0000000000004010) (jit_rbp)
<1803e00>       JIT-RegisterMap-I-Slot[0x00007FCF75EACA98] = UDATA(0x0000000000004000) (jit_rsp)
<1803e00>       JIT-RegisterMap-I-Slot[0x00007FCF75EACAA0] = UDATA(0x0000000000000000) (jit_r8)
<1803e00>       JIT-RegisterMap-I-Slot[0x00007FCF75EACAA8] = UDATA(0x0000000000000000) (jit_r9)
<1803e00>       JIT-RegisterMap-I-Slot[0x00007FCF75EACAB0] = UDATA(0xFFFFFFFFFFFFFFFF) (jit_r10)
<1803e00>       JIT-RegisterMap-I-Slot[0x00007FCF75EACAB8] = UDATA(0xFFFFFFFFFFFFFE18) (jit_r11)
<1803e00>       JIT-RegisterMap-I-Slot[0x00007FCF75EACAC0] = UDATA(0x00000000FE9A8200) (jit_r12)
<1803e00>       JIT-RegisterMap-I-Slot[0x00007FCF75EACAC8] = UDATA(0x0000000000000001) (jit_r13)
<1803e00>       JIT-RegisterMap-I-Slot[0x00007FCF75EACAD0] = UDATA(0x00000000FF0AA110) (jit_r14)
<1803e00>       JIT-RegisterMap-I-Slot[0x00007FCF75EACAD8] = UDATA(0x00000000FF0AA110) (jit_r15)
<1803e00>   JIT-Frame-RegisterMap[0x000000000182D540] = UDATA(0x00000000FEDCE8B0) (jit_rbx)
<1803e00>   JIT-Frame-RegisterMap[0x000000000182D548] = UDATA(0x000000000025BC00) (jit_r9)
<1803e00>   JIT-Frame-RegisterMap[0x00007FCF75EACAB0] = UDATA(0xFFFFFFFFFFFFFFFF) (jit_r10)
<1803e00>   JIT-Frame-RegisterMap[0x00007FCF75EACAB8] = UDATA(0xFFFFFFFFFFFFFE18) (jit_r11)
<1803e00>   JIT-Frame-RegisterMap[0x00007FCF75EACAC0] = UDATA(0x00000000FE9A8200) (jit_r12)
<1803e00>   JIT-Frame-RegisterMap[0x00007FCF75EACAC8] = UDATA(0x0000000000000001) (jit_r13)
<1803e00>   JIT-Frame-RegisterMap[0x00007FCF75EACAD0] = UDATA(0x00000000FF0AA110) (jit_r14)
<1803e00>   JIT-Frame-RegisterMap[0x00007FCF75EACAD8] = UDATA(0x00000000FF0AA110) (jit_r15)
<1803e00> I2J values: PC = 0x00007FCE882F0163, A0 = 0x000000000182D668, walkSP = 0x000000000182D620, literals = 0x0000000001AEAB60, JIT PC = 0x00007FCF90E82DC0, pcAddress = 0x00007FCF75EACBC8, decomp = 0x0000000000000000
<1803e00> Bytecode frame: bp = 0x000000000182D630, sp = 0x000000000182D620, pc = 0x00007FCE882F0163, cp = 0x0000000001AE7FC0, arg0EA = 0x000000000182D668, flags = 0x0000000000000000
<1803e00>   Method: com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator.allocateRegisters()V !j9method 0x0000000001AEAB60
<1803e00>   Bytecode index = 1,191
<1803e00>   Using local mapper
<1803e00>   Locals starting at 0x000000000182D668 for 0x0000000000000007 slots
<1803e00>       O-Slot: a0[0x000000000182D668] = 0x00000000FEDCE8B0
<1803e00>       I-Slot: t1[0x000000000182D660] = 0x00000000FEDD3798
<1803e00>       I-Slot: t2[0x000000000182D658] = 0x00000000FE885E30
<1803e00>       I-Slot: t3[0x000000000182D650] = 0x00000000FEF9B9E0
<1803e00>       I-Slot: t4[0x000000000182D648] = 0x00000000FE885F20
<1803e00>       I-Slot: t5[0x000000000182D640] = 0x00000000FEDD0F00
<1803e00>       I-Slot: t6[0x000000000182D638] = 0x00007FCE8822454E
<1803e00> Bytecode frame: bp = 0x000000000182D688, sp = 0x000000000182D670, pc = 0x00007FCE88224551, cp = 0x00000000019F1280, arg0EA = 0x000000000182D6A8, flags = 0x0000000000000000
<1803e00>   Method: com/android/tools/r8/ir/conversion/IRConverter.c(Lcom/android/tools/r8/ir/code/IRCode;Lcom/android/tools/r8/graph/DexEncodedMethod;)Lcom/android/tools/r8/ir/regalloc/RegisterAllocator; !j9method 0x00000000019F4610
<1803e00>   Bytecode index = 33
<1803e00>   Using local mapper
<1803e00>   Locals starting at 0x000000000182D6A8 for 0x0000000000000004 slots
<1803e00>       O-Slot: a0[0x000000000182D6A8] = 0x00000000A3D4F550
<1803e00>       O-Slot: a1[0x000000000182D6A0] = 0x00000000FEBE5BC8
<1803e00>       O-Slot: a2[0x000000000182D698] = 0x00000000A3D4F4C0
<1803e00>       O-Slot: t3[0x000000000182D690] = 0x00000000FEDCE8B0
<1803e00>   Pending stack starting at 0x000000000182D670 for UDATA(0x0000000000000001) slots
<1803e00>       O-Slot: p0[0x000000000182D670] = 0x00000000A3D4F550
<1803e00> Bytecode frame: bp = 0x000000000182D710, sp = 0x000000000182D6B0, pc = 0x00007FCE882243A8, cp = 0x00000000019F1280, arg0EA = 0x000000000182D730, flags = 0x0000000000000000
<1803e00>   Method: com/android/tools/r8/ir/conversion/IRConverter.a(Lcom/android/tools/r8/graph/DexEncodedMethod;Lcom/android/tools/r8/ir/code/IRCode;Lcom/android/tools/r8/ir/conversion/a0;)V !j9method 0x00000000019F45B0
<1803e00>   Bytecode index = 124
<1803e00>   Using local mapper
<1803e00>   Locals starting at 0x000000000182D730 for 0x0000000000000004 slots
<1803e00>       I-Slot: a0[0x000000000182D730] = 0x00000000A3D4F550
<1803e00>       I-Slot: a1[0x000000000182D728] = 0x00000000A3D4F4C0
<1803e00>       I-Slot: a2[0x000000000182D720] = 0x00000000FEBE5BC8
<1803e00>       I-Slot: a3[0x000000000182D718] = 0x00000000A3D4F5E8
<1803e00>   Pending stack starting at 0x000000000182D6F8 for UDATA(0x000000000000000A) slots
<1803e00>       O-Slot: p0[0x000000000182D6F8] = 0x00000000A3D4F550
<1803e00>       O-Slot: p1[0x000000000182D6F0] = 0x00000000A3D4F4C0
<1803e00>       O-Slot: p2[0x000000000182D6E8] = 0x00000000FEBE5BC8
<1803e00>       O-Slot: p3[0x000000000182D6E0] = 0x00000000A3D4F5E8
<1803e00>       O-Slot: p4[0x000000000182D6D8] = 0x00000000A3D4F550
<1803e00>       O-Slot: p5[0x000000000182D6D0] = 0x00000000FEBE5BC8
<1803e00>       O-Slot: p6[0x000000000182D6C8] = 0x00000000A3D4F550
<1803e00>       O-Slot: p7[0x000000000182D6C0] = 0x00000000A3D4F4C0
<1803e00>       O-Slot: p8[0x000000000182D6B8] = 0x00000000A3D4F4C0
<1803e00>       O-Slot: p9[0x000000000182D6B0] = 0x00000000FEBE5BC8
<1803e00> Bytecode frame: bp = 0x000000000182D748, sp = 0x000000000182D738, pc = 0x00007FCE88223BED, cp = 0x00000000019F1280, arg0EA = 0x000000000182D7A0, flags = 0x0000000000000000
<1803e00>   Method: com/android/tools/r8/ir/conversion/IRConverter.b(Lcom/android/tools/r8/graph/DexEncodedMethod;Lcom/android/tools/r8/ir/conversion/a0;Ljava/util/function/Predicate;Lcom/android/tools/r8/ir/conversion/g;Ljava/util/function/BiConsumer;)V !j9method 0x00000000019F4570
<1803e00>   Bytecode index = 2,833
<1803e00>   Using local mapper

top method:

> !j9method 0x00000000019515E0
J9Method at 0x19515e0 {
  Fields for J9Method:
    0x0: U8* bytecodes = !j9x 0x00007FCE88058FE4
    0x8: struct J9ConstantPool* constantPool = !j9constantpool 0x00000000019516A0
    0x10: void* methodRunAddress = !j9x 0x0000000000000006
    0x18: void* extra = !j9x 0x0000000000000FA1
}
Signature: com/android/tools/r8/m/a/a/b/Y.removeIf(Ljava/util/function/Predicate;)Z !bytecodes 0x00000000019515E0
ROM Method: !j9rommethod 0x00007FCE88058FD0
> !bytecodes 0x00000000019515E0
  Name: removeIf
  Signature: (Ljava/util/function/Predicate;)Z
  Access Flags (3050011): public final 
  Max Stack: 2
  Argument Count: 2
  Temp Count: 0

    0 newdup 18 java/lang/UnsupportedOperationException
    3 dup 
    4 invokespecial 19 java/lang/UnsupportedOperationException.<init>()V
    7 athrow 

Next method:

> !j9method 0x0000000001AEA440
J9Method at 0x1aea440 {
  Fields for J9Method:
    0x0: U8* bytecodes = !j9x 0x00007FCE882E9A70
    0x8: struct J9ConstantPool* constantPool = !j9constantpool 0x0000000001AE7FC0
    0x10: void* methodRunAddress = !j9x 0x0000000000000018
    0x18: void* extra = !j9x 0x00007FCF76502FC8
}
Signature: com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator.a(Lcom/android/tools/r8/m/a/a/b/d0;Ljava/util/List;Lcom/android/tools/r8/ir/regalloc/RegisterAllocator;Ljava/util/Map;)V !bytecodes 0x0000000001AEA440

Bytecodes:

> !bytecodes 0x0000000001AEA440
  Name: a
  Signature: (Lcom/android/tools/r8/m/a/a/b/d0;Ljava/util/List;Lcom/android/tools/r8/ir/regalloc/RegisterAllocator;Ljava/util/Map;)V
  Access Flags (1b240009): public static 
  Max Stack: 7
  Argument Count: 4
  Temp Count: 13

    0 aload1 
    1 newdup 31 java/util/ArrayList
    4 dup 
    5 astore1 
    6 invokespecial 32 java/util/ArrayList.<init>()V
    9 invokeinterface2 
   11 invokeinterface 60 java/util/List.iterator()Ljava/util/Iterator;
   14 astore 4
   16 aload 4
   18 invokeinterface2 
   20 invokeinterface 53 java/util/Iterator.hasNext()Z
   23 ifeq 267
   26 aload 4
   28 invokeinterface2 
   30 invokeinterface 54 java/util/Iterator.next()Ljava/lang/Object;
   33 checkcast 63 com/android/tools/r8/ir/regalloc/LiveIntervals
   36 dup 
   37 astore 5
   39 invokevirtual 64 com/android/tools/r8/ir/regalloc/LiveIntervals.o()Lcom/android/tools/r8/ir/code/Value;
   42 dup 
   43 astore 6
   45 invokevirtual 65 com/android/tools/r8/ir/code/Value.s()Z
   48 ifne 54
   51 goto 16
   54 aload 5
   56 newdup 31 java/util/ArrayList
   59 dup 
   60 astore 7
   62 aload 5
   64 invokevirtual 66 com/android/tools/r8/ir/regalloc/LiveIntervals.g()Ljava/util/List;
   67 invokespecial 67 java/util/ArrayList.<init>(Ljava/util/Collection;)V
   70 invokevirtual 68 com/android/tools/r8/ir/regalloc/LiveIntervals.j()Ljava/util/List;
   73 invokeinterface2 
   75 invokeinterface 60 java/util/List.iterator()Ljava/util/Iterator;
   78 astore 5
   80 aload 5
   82 invokeinterface2 
   84 invokeinterface 53 java/util/Iterator.hasNext()Z
   87 ifeq 183
   90 aload 5
   92 invokeinterface2 
   94 invokeinterface 54 java/util/Iterator.next()Ljava/lang/Object;
   97 checkcast 63 com/android/tools/r8/ir/regalloc/LiveIntervals
  100 astore 8
  102 getstatic 19 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator.p Z
  105 ifne 129
  108 aload 8
  110 invokevirtual 64 com/android/tools/r8/ir/regalloc/LiveIntervals.o()Lcom/android/tools/r8/ir/code/Value;
  113 aload 6
  115 ifacmpne 121
  118 goto 129
  121 newdup 21 java/lang/AssertionError
  124 dup 
  125 invokespecial 22 java/lang/AssertionError.<init>()V
  128 athrow 
  129 getstatic 19 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator.p Z
  132 ifne 167
  135 aload 8
  137 invokevirtual 68 com/android/tools/r8/ir/regalloc/LiveIntervals.j()Ljava/util/List;
  140 ifnull 167
  143 aload 8
  145 invokevirtual 68 com/android/tools/r8/ir/regalloc/LiveIntervals.j()Ljava/util/List;
  148 invokeinterface2 
  150 invokeinterface 18 java/util/List.isEmpty()Z
  153 ifeq 159
  156 goto 167
  159 newdup 21 java/lang/AssertionError
  162 dup 
  163 invokespecial 22 java/lang/AssertionError.<init>()V
  166 athrow 
  167 aload 7
  169 aload 8
  171 invokevirtual 66 com/android/tools/r8/ir/regalloc/LiveIntervals.g()Ljava/util/List;
  174 invokeinterface2 
  176 invokeinterface 69 java/util/List.addAll(Ljava/util/Collection;)Z
  179 pop 
  180 goto 80
  183 aload 7
  185 dup 
  186 invokedynamic 0 bsm #0:compare()Ljava/util/Comparator;
  191 nop 
  192 nop 
  193 invokeinterface2 
  195 invokeinterface 77 java/util/List.sort(Ljava/util/Comparator;)V
  198 invokeinterface2 
  200 invokeinterface 60 java/util/List.iterator()Ljava/util/Iterator;
  203 astore 5
  205 aload 5
  207 invokeinterface2 
  209 invokeinterface 53 java/util/Iterator.hasNext()Z
  212 ifeq 18
  215 aload1 
  216 aload 5
  218 invokeinterface2 
  220 invokeinterface 54 java/util/Iterator.next()Ljava/lang/Object;
  223 checkcast 78 com/android/tools/r8/ir/regalloc/LiveRange
  226 dup 
  227 getfield 79 com/android/tools/r8/ir/regalloc/LiveRange.a I
  230 istore 7
  232 getfield 80 com/android/tools/r8/ir/regalloc/LiveRange.b I
  235 istore 8
  237 newdup 5 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator$b
  240 dup 
  241 aload 6
  243 aload2 
  244 aload 6
  246 iload 7
  248 invokeinterface2 
  250 invokeinterface 81 com/android/tools/r8/ir/regalloc/RegisterAllocator.getArgumentOrAllocateRegisterForValue(Lcom/android/tools/r8/ir/code/Value;I)I
  253 iload 7
  255 iload 8
  257 invokespecial 82 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator$b.<init>(Lcom/android/tools/r8/ir/code/Value;III)V
  260 invokeinterface2 
  262 invokeinterface 83 java/util/List.add(Ljava/lang/Object;)Z
  265 pop 
  266 goto 205
  269 aload1 
  270 invokeinterface2 
  272 invokeinterface 18 java/util/List.isEmpty()Z
  275 ifeq 279
  278 return0 
  279 aload0 
  280 aload1 
  281 dup 
  282 invokedynamic 1 bsm #1:compare()Ljava/util/Comparator;
  287 nop 
  288 nop 
  289 invokeinterface2 
  291 invokeinterface 77 java/util/List.sort(Ljava/util/Comparator;)V
  294 newdup 34 java/util/LinkedList
  297 dup 
  298 astore0 
  299 invokespecial 35 java/util/LinkedList.<init>()V
  302 invokeinterface2 
  304 invokeinterface 60 java/util/List.iterator()Ljava/util/Iterator;
  307 dup 
  308 astore1 
  309 invokeinterface2 
  311 invokeinterface 54 java/util/Iterator.next()Ljava/lang/Object;
  314 checkcast 5 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator$b
  317 astore 4
  319 newdup 87 com/android/tools/r8/n/a/a/a/g/B0
  322 dup 
  323 astore 5
  325 invokespecial 88 com/android/tools/r8/n/a/a/a/g/B0.<init>()V
  328 newdup 87 com/android/tools/r8/n/a/a/a/g/B0
  331 dup 
  332 astore 6
  334 invokespecial 88 com/android/tools/r8/n/a/a/a/g/B0.<init>()V
  337 iconst1 
  338 istore 7
  340 invokevirtual 89 com/android/tools/r8/m/a/a/b/d0.iterator()Lcom/android/tools/r8/m/a/a/b/Y2;
  343 astore 8
  345 aload 8
  347 invokeinterface2 
  349 invokeinterface 53 java/util/Iterator.hasNext()Z
  352 ifeq 1741
  355 iload 7
  357 aload 8
  359 invokeinterface2 
  361 invokeinterface 54 java/util/Iterator.next()Ljava/lang/Object;
  364 checkcast 49 com/android/tools/r8/ir/code/BasicBlock
  367 dup 
  368 astore 9
  370 invokevirtual 91 com/android/tools/r8/ir/code/BasicBlock.listIterator()Lcom/android/tools/r8/ir/code/InstructionListIterator;
  373 astore 10
  375 newdup 92 java/util/HashSet
  378 dup 
  379 astore 11
  381 aload3 
  382 aload 9
  384 invokeinterface2 
  386 invokeinterface 93 java/util/Map.get(Ljava/lang/Object;)Ljava/lang/Object;
  389 checkcast 7 com/android/tools/r8/ir/code/IRCode$b
  392 getfield 94 com/android/tools/r8/ir/code/IRCode$b.b Ljava/util/Set;
  395 invokespecial 95 java/util/HashSet.<init>(Ljava/util/Collection;)V
  398 ifeq 504
  401 iconst0 
  402 istore 7
  404 getstatic 19 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator.p Z
  407 ifne 434
  410 aload 9
  412 invokevirtual 96 com/android/tools/r8/ir/code/BasicBlock.getPhis()Ljava/util/List;
  415 invokeinterface2 
  417 invokeinterface 18 java/util/List.isEmpty()Z
  420 ifeq 426
  423 goto 434
  426 newdup 21 java/lang/AssertionError
  429 dup 
  430 invokespecial 22 java/lang/AssertionError.<init>()V
  433 athrow 
  434 aload 10
  436 invokeinterface2 
  438 invokeinterface 99 java/util/ListIterator.hasNext()Z
  441 ifeq 493
  444 aload 10
  446 invokeinterface2 
  448 invokeinterface 100 java/util/ListIterator.next()Ljava/lang/Object;
  451 checkcast 55 com/android/tools/r8/ir/code/Instruction
  454 dup 
  455 astore 12
  457 invokevirtual 56 com/android/tools/r8/ir/code/Instruction.isArgument()Z
  460 ifne 466
  463 goto 493
  466 aload 12
  468 invokevirtual 57 com/android/tools/r8/ir/code/Instruction.outValue()Lcom/android/tools/r8/ir/code/Value;
  471 invokevirtual 65 com/android/tools/r8/ir/code/Value.s()Z
  474 ifeq 434
  477 aload 11
  479 aload 12
  481 invokevirtual 57 com/android/tools/r8/ir/code/Instruction.outValue()Lcom/android/tools/r8/ir/code/Value;
  484 invokeinterface2 
  486 invokeinterface 102 java/util/Set.add(Ljava/lang/Object;)Z
  489 pop 
  490 goto 434
  493 aload 10
  495 invokeinterface2 
  497 invokeinterface 103 java/util/ListIterator.previous()Ljava/lang/Object;
  500 pop 
  501 goto 558
  504 aload 9
  506 invokevirtual 96 com/android/tools/r8/ir/code/BasicBlock.getPhis()Ljava/util/List;
  509 invokeinterface2 
  511 invokeinterface 60 java/util/List.iterator()Ljava/util/Iterator;
  514 astore 12
  516 aload 12
  518 invokeinterface2 
  520 invokeinterface 53 java/util/Iterator.hasNext()Z
  523 ifeq 558
  526 aload 12
  528 invokeinterface2 
  530 invokeinterface 54 java/util/Iterator.next()Ljava/lang/Object;
  533 checkcast 104 com/android/tools/r8/ir/code/Phi
  536 dup 
  537 astore 13
  539 invokevirtual 65 com/android/tools/r8/ir/code/Value.s()Z
  542 ifeq 516
  545 aload 11
  547 aload 13
  549 invokeinterface2 
  551 invokeinterface 102 java/util/Set.add(Ljava/lang/Object;)Z
  554 pop 
  555 goto 516
  558 aload0 
  559 aload 11
  561 aload 10
  563 dup 
  564 invokedynamic 2 bsm #2:test()Ljava/util/function/Predicate;
  569 nop 
  570 nop 
  571 invokeinterface2 
  573 invokeinterface 110 com/android/tools/r8/ir/code/NextUntilIterator.nextUntil(Ljava/util/function/Predicate;)Ljava/lang/Object;
  576 pop 
  577 invokeinterface2 
  579 invokeinterface 103 java/util/ListIterator.previous()Ljava/lang/Object;
  582 checkcast 55 com/android/tools/r8/ir/code/Instruction
  585 dup 
  586 dup 
  587 astore 12
  589 invokevirtual 111 com/android/tools/r8/ir/code/Instruction.n0()I
  592 istore 13
  594 invokedynamic 3 bsm #3:test(Ljava/util/Set;Lcom/android/tools/r8/ir/code/Instruction;)Ljava/util/function/Predicate;
  599 nop 
  600 nop 
  601 invokevirtual 115 java/util/LinkedList.removeIf(Ljava/util/function/Predicate;)Z
  604 pop 
  605 aload 4
  607 ifnull 681
  610 aload 4
  612 getfield 116 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator$b.d I
  615 iload 13
  617 ificmpge 681
  620 aload 11
  622 aload 4
  624 getfield 117 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator$b.a Lcom/android/tools/r8/ir/code/Value;
  627 invokeinterface2 
  629 invokeinterface 118 java/util/Set.contains(Ljava/lang/Object;)Z
  632 ifeq 652
  635 aload 12
  637 aload 4
  639 invokestatic 119 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator.a(Lcom/android/tools/r8/ir/code/Instruction;Lcom/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator$b;)Z
  642 ifeq 652
  645 aload0 
  646 aload 4
  648 invokevirtual 120 java/util/LinkedList.add(Ljava/lang/Object;)Z
  651 pop 
  652 aload1 
  653 invokeinterface2 
  655 invokeinterface 53 java/util/Iterator.hasNext()Z
  658 ifeq 675
  661 aload1 
  662 invokeinterface2 
  664 invokeinterface 54 java/util/Iterator.next()Ljava/lang/Object;
  667 checkcast 5 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator$b
  670 astore 4
  672 goto 605
  675 aconstnull 
  676 astore 4
  678 goto 605
  681 aload0 
  682 newdup 87 com/android/tools/r8/n/a/a/a/g/B0
  685 dup 
  686 astore 12
  688 aload0 
  689 invokevirtual 121 java/util/LinkedList.size()I
  692 invokespecial 122 com/android/tools/r8/n/a/a/a/g/B0.<init>(I)V
  695 invokevirtual 51 java/util/LinkedList.iterator()Ljava/util/Iterator;
  698 astore 13
  700 aload 13
  702 invokeinterface2 
  704 invokeinterface 53 java/util/Iterator.hasNext()Z
  707 ifeq 755
  710 aload 11
  712 aload 13
  714 invokeinterface2 
  716 invokeinterface 54 java/util/Iterator.next()Ljava/lang/Object;
  719 checkcast 5 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator$b
  722 dup 
  723 astore 14
  725 getfield 117 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator$b.a Lcom/android/tools/r8/ir/code/Value;
  728 invokeinterface2 
  730 invokeinterface 118 java/util/Set.contains(Ljava/lang/Object;)Z
  733 ifeq 700
  736 aload 12
  738 aload 14
  740 getfield 123 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator$b.c I
  743 aload 14
  745 getfield 124 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator$b.b Lcom/android/tools/r8/graph/DebugLocalInfo;
  748 invokevirtual 125 com/android/tools/r8/n/a/a/a/g/B0.a(ILjava/lang/Object;)Ljava/lang/Object;
  751 pop 
  752 goto 700
  755 aload 9
  757 invokevirtual 126 com/android/tools/r8/ir/code/BasicBlock.getPredecessors()Ljava/util/List;
  760 invokeinterface2 
  762 invokeinterface 18 java/util/List.isEmpty()Z
  765 ifne 1132
  768 aload 9
  770 invokevirtual 127 com/android/tools/r8/ir/code/BasicBlock.j()Lcom/android/tools/r8/ir/code/Instruction;
  773 aload 10
  775 invokeinterface2 
  777 invokeinterface 128 com/android/tools/r8/ir/code/InstructionListIterator.a()Lcom/android/tools/r8/ir/code/Instruction;
  780 ifacmpne 786
  783 goto 1132
  786 aload 9
  788 newdup 87 com/android/tools/r8/n/a/a/a/g/B0
  791 dup 
  792 astore 11
  794 aload0 
  795 invokeinterface2 
  797 invokeinterface 129 java/util/List.size()I
  800 invokespecial 122 com/android/tools/r8/n/a/a/a/g/B0.<init>(I)V
  803 invokevirtual 127 com/android/tools/r8/ir/code/BasicBlock.j()Lcom/android/tools/r8/ir/code/Instruction;
  806 invokevirtual 130 com/android/tools/r8/ir/code/Instruction.l1()Z
  809 ifeq 837
  812 aload 9
  814 invokevirtual 126 com/android/tools/r8/ir/code/BasicBlock.getPredecessors()Ljava/util/List;
  817 iconst0 
  818 invokeinterface2 
  820 invokeinterface 131 java/util/List.get(I)Ljava/lang/Object;
  823 checkcast 49 com/android/tools/r8/ir/code/BasicBlock
  826 invokevirtual 132 com/android/tools/r8/ir/code/BasicBlock.k()Lcom/android/tools/r8/ir/code/Instruction;
  829 invokevirtual 111 com/android/tools/r8/ir/code/Instruction.n0()I
  832 istore 13
  834 goto 859
  837 aload 9
  839 invokevirtual 126 com/android/tools/r8/ir/code/BasicBlock.getPredecessors()Ljava/util/List;
  842 iconst0 
  843 invokeinterface2 
  845 invokeinterface 131 java/util/List.get(I)Ljava/lang/Object;
  848 checkcast 49 com/android/tools/r8/ir/code/BasicBlock
  851 invokevirtual 133 com/android/tools/r8/ir/code/BasicBlock.exit()Lcom/android/tools/r8/ir/code/JumpInstruction;
  854 invokevirtual 111 com/android/tools/r8/ir/code/Instruction.n0()I
  857 istore 13
  859 aload0 
  860 invokeinterface2 
  862 invokeinterface 60 java/util/List.iterator()Ljava/util/Iterator;
  865 astore 14
  867 aload 14
  869 invokeinterface2 
  871 invokeinterface 53 java/util/Iterator.hasNext()Z
  874 ifeq 915
  877 aload 11
  879 aload2 
  880 aload 14
  882 invokeinterface2 
  884 invokeinterface 54 java/util/Iterator.next()Ljava/lang/Object;
  887 checkcast 5 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator$b
  890 dup 
  891 astore 15
  893 getfield 117 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator$b.a Lcom/android/tools/r8/ir/code/Value;
  896 iload 13
  898 invokeinterface2 
  900 invokeinterface 81 com/android/tools/r8/ir/regalloc/RegisterAllocator.getArgumentOrAllocateRegisterForValue(Lcom/android/tools/r8/ir/code/Value;I)I
  903 aload 15
  905 getfield 124 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator$b.b Lcom/android/tools/r8/graph/DebugLocalInfo;
  908 invokevirtual 125 com/android/tools/r8/n/a/a/a/g/B0.a(ILjava/lang/Object;)Ljava/lang/Object;
  911 pop 
  912 goto 867
  915 aload 11
  917 aload 9
  919 aload 11
  921 invokevirtual 134 com/android/tools/r8/ir/code/BasicBlock.a(Lcom/android/tools/r8/n/a/a/a/g/w0;)V
  924 newdup 87 com/android/tools/r8/n/a/a/a/g/B0
  927 dup 
  928 astore 13
  930 invokespecial 88 com/android/tools/r8/n/a/a/a/g/B0.<init>()V
  933 newdup 87 com/android/tools/r8/n/a/a/a/g/B0
  936 dup 
  937 astore 14
  939 invokespecial 88 com/android/tools/r8/n/a/a/a/g/B0.<init>()V
  942 invokevirtual 135 com/android/tools/r8/n/a/a/a/g/B0.d()Lcom/android/tools/r8/n/a/a/a/h/q0;
  945 invokeinterface2 
  947 invokeinterface 137 com/android/tools/r8/n/a/a/a/h/q0.iterator()Lcom/android/tools/r8/n/a/a/a/h/l0;
  950 astore 15
  952 aload 15
  954 invokeinterface2 
  956 invokeinterface 53 java/util/Iterator.hasNext()Z
  959 ifeq 1021
  962 aload 12
  964 aload 15
  966 invokeinterface2 
  968 invokeinterface 54 java/util/Iterator.next()Ljava/lang/Object;
  971 checkcast 9 com/android/tools/r8/n/a/a/a/g/w0$a
  974 dup 
  975 astore 16
  977 invokeinterface2 
  979 invokeinterface 139 com/android/tools/r8/n/a/a/a/g/w0$a.d()I
  982 invokevirtual 140 com/android/tools/r8/n/a/a/a/g/B0.get(I)Ljava/lang/Object;
  985 aload 16
  987 invokeinterface2 
  989 invokeinterface 142 java/util/Map$Entry.getValue()Ljava/lang/Object;
  992 ifacmpeq 952
  995 aload 13
  997 aload 16
  999 invokeinterface2 
 1001 invokeinterface 139 com/android/tools/r8/n/a/a/a/g/w0$a.d()I
 1004 aload 16
 1006 invokeinterface2 
 1008 invokeinterface 142 java/util/Map$Entry.getValue()Ljava/lang/Object;
 1011 checkcast 143 com/android/tools/r8/graph/DebugLocalInfo
 1014 invokevirtual 125 com/android/tools/r8/n/a/a/a/g/B0.a(ILjava/lang/Object;)Ljava/lang/Object;
 1017 pop 
 1018 goto 952
 1021 aload 12
 1023 invokevirtual 135 com/android/tools/r8/n/a/a/a/g/B0.d()Lcom/android/tools/r8/n/a/a/a/h/q0;
 1026 invokeinterface2 
 1028 invokeinterface 137 com/android/tools/r8/n/a/a/a/h/q0.iterator()Lcom/android/tools/r8/n/a/a/a/h/l0;
 1031 astore 15
 1033 aload 15
 1035 invokeinterface2 
 1037 invokeinterface 53 java/util/Iterator.hasNext()Z
 1040 ifeq 1102
 1043 aload 11
 1045 aload 15
 1047 invokeinterface2 
 1049 invokeinterface 54 java/util/Iterator.next()Ljava/lang/Object;
 1052 checkcast 9 com/android/tools/r8/n/a/a/a/g/w0$a
 1055 dup 
 1056 astore 16
 1058 invokeinterface2 
 1060 invokeinterface 139 com/android/tools/r8/n/a/a/a/g/w0$a.d()I
 1063 invokevirtual 140 com/android/tools/r8/n/a/a/a/g/B0.get(I)Ljava/lang/Object;
 1066 aload 16
 1068 invokeinterface2 
 1070 invokeinterface 142 java/util/Map$Entry.getValue()Ljava/lang/Object;
 1073 ifacmpeq 1033
 1076 aload 14
 1078 aload 16
 1080 invokeinterface2 
 1082 invokeinterface 139 com/android/tools/r8/n/a/a/a/g/w0$a.d()I
 1085 aload 16
 1087 invokeinterface2 
 1089 invokeinterface 142 java/util/Map$Entry.getValue()Ljava/lang/Object;
 1092 checkcast 143 com/android/tools/r8/graph/DebugLocalInfo
 1095 invokevirtual 125 com/android/tools/r8/n/a/a/a/g/B0.a(ILjava/lang/Object;)Ljava/lang/Object;
 1098 pop 
 1099 goto 1033
 1102 aload 13
 1104 aload 14
 1106 aload 9
 1108 invokevirtual 144 com/android/tools/r8/ir/code/BasicBlock.s()Lcom/android/tools/r8/ir/code/Position;
 1111 invokestatic 145 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator.a(Lcom/android/tools/r8/n/a/a/a/g/w0;Lcom/android/tools/r8/n/a/a/a/g/w0;Lcom/android/tools/r8/ir/code/Position;)Lcom/android/tools/r8/ir/code/r;
 1114 dup 
 1115 astore 9
 1117 ifnull 1202
 1120 aload 10
 1122 aload 9
 1124 invokeinterface2 
 1126 invokeinterface 146 java/util/ListIterator.add(Ljava/lang/Object;)V
 1129 goto 1202
 1132 getstatic 19 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator.p Z
 1135 ifne 1160
 1138 aload 9
 1140 invokevirtual 127 com/android/tools/r8/ir/code/BasicBlock.j()Lcom/android/tools/r8/ir/code/Instruction;
 1143 invokevirtual 130 com/android/tools/r8/ir/code/Instruction.l1()Z
 1146 ifne 1152
 1149 goto 1160
 1152 newdup 21 java/lang/AssertionError
 1155 dup 
 1156 invokespecial 22 java/lang/AssertionError.<init>()V
 1159 athrow 
 1160 getstatic 19 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator.p Z
 1163 ifne 1188
 1166 aload 9
 1168 invokevirtual 127 com/android/tools/r8/ir/code/BasicBlock.j()Lcom/android/tools/r8/ir/code/Instruction;
 1171 invokestatic 147 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator.a(Lcom/android/tools/r8/ir/code/Instruction;)Z
 1174 ifne 1180
 1177 goto 1188
 1180 newdup 21 java/lang/AssertionError
 1183 dup 
 1184 invokespecial 22 java/lang/AssertionError.<init>()V
 1187 athrow 
 1188 aload 9
 1190 newdup 87 com/android/tools/r8/n/a/a/a/g/B0
 1193 dup 
 1194 aload 12
 1196 invokespecial 148 com/android/tools/r8/n/a/a/a/g/B0.<init>(Lcom/android/tools/r8/n/a/a/a/g/w0;)V
 1199 invokevirtual 134 com/android/tools/r8/ir/code/BasicBlock.a(Lcom/android/tools/r8/n/a/a/a/g/w0;)V
 1202 aload 10
 1204 invokeinterface2 
 1206 invokeinterface 99 java/util/ListIterator.hasNext()Z
 1209 ifeq 349
 1212 aload 10
 1214 dup 
 1215 invokeinterface2 
 1217 invokeinterface 100 java/util/ListIterator.next()Ljava/lang/Object;
 1220 checkcast 55 com/android/tools/r8/ir/code/Instruction
 1223 astore 9
 1225 invokeinterface2 
 1227 invokeinterface 99 java/util/ListIterator.hasNext()Z
 1230 ifne 1236
 1233 goto 349
 1236 aload 9
 1238 invokevirtual 149 com/android/tools/r8/ir/code/Instruction.j0()Ljava/util/Set;
 1241 invokeinterface2 
 1243 invokeinterface 150 java/util/Set.isEmpty()Z
 1246 ifne 1390
 1249 aload 9
 1251 invokevirtual 149 com/android/tools/r8/ir/code/Instruction.j0()Ljava/util/Set;
 1254 invokeinterface2 
 1256 invokeinterface 151 java/util/Set.iterator()Ljava/util/Iterator;
 1259 astore 11
 1261 aload 11
 1263 invokeinterface2 
 1265 invokeinterface 53 java/util/Iterator.hasNext()Z
 1268 ifeq 1385
 1271 aload0 
 1272 aload 11
 1274 invokeinterface2 
 1276 invokeinterface 54 java/util/Iterator.next()Ljava/lang/Object;
 1279 checkcast 58 com/android/tools/r8/ir/code/Value
 1282 astore 13
 1284 invokevirtual 152 java/util/LinkedList.listIterator()Ljava/util/ListIterator;
 1287 astore 14
 1289 aload 14
 1291 invokeinterface2 
 1293 invokeinterface 99 java/util/ListIterator.hasNext()Z
 1296 ifeq 1261
 1299 aload 14
 1301 invokeinterface2 
 1303 invokeinterface 100 java/util/ListIterator.next()Ljava/lang/Object;
 1306 checkcast 5 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator$b
 1309 dup 
 1310 astore 15
 1312 getfield 117 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator$b.a Lcom/android/tools/r8/ir/code/Value;
 1315 aload 13
 1317 ifacmpne 1289
 1320 getstatic 19 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator.p Z
 1323 ifne 1355
 1326 aload 12
 1328 aload 15
 1330 getfield 123 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator$b.c I
 1333 invokevirtual 140 com/android/tools/r8/n/a/a/a/g/B0.get(I)Ljava/lang/Object;
 1336 aload 15
 1338 getfield 124 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator$b.b Lcom/android/tools/r8/graph/DebugLocalInfo;
 1341 ifacmpne 1347
 1344 goto 1355
 1347 newdup 21 java/lang/AssertionError
 1350 dup 
 1351 invokespecial 22 java/lang/AssertionError.<init>()V
 1354 athrow 
 1355 aload 5
 1357 aload 15
 1359 aload 12
 1361 aload 15
 1363 getfield 123 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator$b.c I
 1366 invokevirtual 153 com/android/tools/r8/n/a/a/a/g/B0.remove(I)Ljava/lang/Object;
 1369 pop 
 1370 getfield 123 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator$b.c I
 1373 aload 15
 1375 getfield 124 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator$b.b Lcom/android/tools/r8/graph/DebugLocalInfo;
 1378 invokevirtual 125 com/android/tools/r8/n/a/a/a/g/B0.a(ILjava/lang/Object;)Ljava/lang/Object;
 1381 pop 
 1382 goto 1261
 1385 aload 9
 1387 invokevirtual 154 com/android/tools/r8/ir/code/Instruction.g0()V
 1390 aload 9
 1392 invokevirtual 155 com/android/tools/r8/ir/code/Instruction.M0()Z
 1395 ifeq 1441
 1398 aload 10
 1400 invokeinterface2 
 1402 invokeinterface 103 java/util/ListIterator.previous()Ljava/lang/Object;
 1405 checkcast 55 com/android/tools/r8/ir/code/Instruction
 1408 astore 11
 1410 getstatic 19 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator.p Z
 1413 ifne 1434
 1416 aload 11
 1418 aload 9
 1420 ifacmpne 1426
 1423 goto 1434
 1426 newdup 21 java/lang/AssertionError
 1429 dup 
 1430 invokespecial 22 java/lang/AssertionError.<init>()V
 1433 athrow 
 1434 aload 10
 1436 invokeinterface2 
 1438 invokeinterface 156 java/util/ListIterator.remove()V
 1441 aload 10
 1443 invokeinterface2 
 1445 invokeinterface 128 com/android/tools/r8/ir/code/InstructionListIterator.a()Lcom/android/tools/r8/ir/code/Instruction;
 1448 dup 
 1449 astore 11
 1451 invokestatic 147 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator.a(Lcom/android/tools/r8/ir/code/Instruction;)Z
 1454 ifeq 1460
 1457 goto 1202
 1460 aload0 
 1461 aload 11
 1463 invokevirtual 111 com/android/tools/r8/ir/code/Instruction.n0()I
 1466 istore 13
 1468 invokevirtual 152 java/util/LinkedList.listIterator()Ljava/util/ListIterator;
 1471 astore 14
 1473 aload 14
 1475 invokeinterface2 
 1477 invokeinterface 99 java/util/ListIterator.hasNext()Z
 1480 ifeq 1543
 1483 aload 11
 1485 aload 14
 1487 invokeinterface2 
 1489 invokeinterface 100 java/util/ListIterator.next()Ljava/lang/Object;
 1492 checkcast 5 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator$b
 1495 dup 
 1496 astore 15
 1498 invokestatic 119 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator.a(Lcom/android/tools/r8/ir/code/Instruction;Lcom/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator$b;)Z
 1501 ifne 1473
 1504 aload 12
 1506 aload 15
 1508 aload 14
 1510 invokeinterface2 
 1512 invokeinterface 156 java/util/ListIterator.remove()V
 1515 getfield 123 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator$b.c I
 1518 invokevirtual 153 com/android/tools/r8/n/a/a/a/g/B0.remove(I)Ljava/lang/Object;
 1521 ifnull 1473
 1524 aload 5
 1526 aload 15
 1528 getfield 123 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator$b.c I
 1531 aload 15
 1533 getfield 124 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator$b.b Lcom/android/tools/r8/graph/DebugLocalInfo;
 1536 invokevirtual 125 com/android/tools/r8/n/a/a/a/g/B0.a(ILjava/lang/Object;)Ljava/lang/Object;
 1539 pop 
 1540 goto 1473
 1543 aload 4
 1545 ifnull 1666
 1548 aload 4
 1550 getfield 116 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator$b.d I
 1553 iload 13
 1555 ificmpge 1666
 1558 aload 11
 1560 aload 4
 1562 invokestatic 119 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator.a(Lcom/android/tools/r8/ir/code/Instruction;Lcom/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator$b;)Z
 1565 ifeq 1637
 1568 aload0 
 1569 aload 4
 1571 invokevirtual 120 java/util/LinkedList.add(Ljava/lang/Object;)Z
 1574 pop 
 1575 getstatic 19 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator.p Z
 1578 ifne 1605
 1581 aload 12
 1583 aload 4
 1585 getfield 123 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator$b.c I
 1588 invokevirtual 157 com/android/tools/r8/n/a/a/a/g/B0.c(I)Z
 1591 ifne 1597
 1594 goto 1605
 1597 newdup 21 java/lang/AssertionError
 1600 dup 
 1601 invokespecial 22 java/lang/AssertionError.<init>()V
 1604 athrow 
 1605 aload 6
 1607 aload 4
 1609 aload 12
 1611 aload 4
 1613 getfield 123 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator$b.c I
 1616 aload 4
 1618 getfield 124 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator$b.b Lcom/android/tools/r8/graph/DebugLocalInfo;
 1621 invokevirtual 125 com/android/tools/r8/n/a/a/a/g/B0.a(ILjava/lang/Object;)Ljava/lang/Object;
 1624 pop 
 1625 getfield 123 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator$b.c I
 1628 aload 4
 1630 getfield 124 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator$b.b Lcom/android/tools/r8/graph/DebugLocalInfo;
 1633 invokevirtual 125 com/android/tools/r8/n/a/a/a/g/B0.a(ILjava/lang/Object;)Ljava/lang/Object;
 1636 pop 
 1637 aload1 
 1638 invokeinterface2 
 1640 invokeinterface 53 java/util/Iterator.hasNext()Z
 1643 ifeq 1660
 1646 aload1 
 1647 invokeinterface2 
 1649 invokeinterface 54 java/util/Iterator.next()Ljava/lang/Object;
 1652 checkcast 5 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator$b
 1655 astore 4
 1657 goto 1543
 1660 aconstnull 
 1661 astore 4
 1663 goto 1543
 1666 aload 5
 1668 invokeinterface2 
 1670 invokeinterface 158 java/util/Map.isEmpty()Z
 1673 ifeq 1693
 1676 aload 6
 1678 invokeinterface2 
 1680 invokeinterface 158 java/util/Map.isEmpty()Z
 1683 ifne 1689
 1686 goto 1693
 1689 iconst0 
 1690 goto 1694
 1693 iconst1 
 1694 ifeq 1202
 1697 aload 5
 1699 aload 6
 1701 aload 9
 1703 invokevirtual 159 com/android/tools/r8/ir/code/Instruction.p0()Lcom/android/tools/r8/ir/code/Position;
 1706 invokestatic 145 com/android/tools/r8/ir/regalloc/LinearScanRegisterAllocator.a(Lcom/android/tools/r8/n/a/a/a/g/w0;Lcom/android/tools/r8/n/a/a/a/g/w0;Lcom/android/tools/r8/ir/code/Position;)Lcom/android/tools/r8/ir/code/r;
 1709 dup 
 1710 astore 5
 1712 ifnull 1724
 1715 aload 10
 1717 aload 5
 1719 invokeinterface2 
 1721 invokeinterface 146 java/util/ListIterator.add(Ljava/lang/Object;)V
 1724 newdup 87 com/android/tools/r8/n/a/a/a/g/B0
 1727 dup 
 1728 astore 5
 1730 invokespecial 88 com/android/tools/r8/n/a/a/a/g/B0.<init>()V
 1733 newdup 87 com/android/tools/r8/n/a/a/a/g/B0
 1736 dup 
 1737 astore 6

I can confirm the 0th slot is a LinkedList:

  294 newdup 34 java/util/LinkedList
  297 dup 
  298 astore0 

and on the stack:

<1803e00>       O-Slot: : a0[0x000000000182D618] = 0x00000000FF0A9D00

which is this object:

> !j9object 0x00000000FF0A9D00
!J9Object 0x00000000FF0A9D00 {
      struct J9Class* clazz = !j9class 0x22D000   // java/util/LinkedList
      Object flags = 0x00000000;
      I lockword = 0x00000000 (offset=0) (java/lang/Object) <hidden>
      I modCount = 0x00000000 (offset=4) (java/util/AbstractList)
      I size = 0x00000000 (offset=8) (java/util/LinkedList)
      Ljava/util/LinkedList$Node; first = !fj9object 0x0 (offset=12) (java/util/LinkedList)
      Ljava/util/LinkedList$Node; last = !fj9object 0x0 (offset=16) (java/util/LinkedList)
}

Looking further at the removeIf call, we must be at

  558 aload0 [LL]
  559 aload 11 [LL 11]
  561 aload 10 [LL 11 10]
  563 dup  [LL 11 10 10]
  564 invokedynamic 2 bsm #2:test()Ljava/util/function/Predicate; [LL 11 10 10 Predicate]
  569 nop 
  570 nop 
  571 invokeinterface2 [LL 11 10 10 Predicate]
  573 invokeinterface 110 com/android/tools/r8/ir/code/NextUntilIterator.nextUntil(Ljava/util/function/Predicate;)Ljava/lang/Object;  [LL 11 10 Object]
  576 pop [LL 11 10]
  577 invokeinterface2 
  579 invokeinterface 103 java/util/ListIterator.previous()Ljava/lang/Object;[LL 11 Object]
  582 checkcast 55 com/android/tools/r8/ir/code/Instruction [LL 11 Instruction]
  585 dup [LL 11 Instruction Instruction]
  586 dup [LL 11 Instruction Instruction Instruction]
  587 astore 12 [LL 11 Instruction Instruction]
  589 invokevirtual 111 com/android/tools/r8/ir/code/Instruction.n0()I  [LL 11 Instruction I]
  592 istore 13 [LL 11 Instruction]
  594 invokedynamic 3 bsm #3:test(Ljava/util/Set;Lcom/android/tools/r8/ir/code/Instruction;)Ljava/util/function/Predicate;  [LL Predicate]
  599 nop 
  600 nop 
  601 invokevirtual 115 java/util/LinkedList.removeIf(Ljava/util/function/Predicate;)Z

One oddity, the stackwalker says we're at Bytecode index = 593 but we have to be at 601 for it to match the stack.

So the bytecodes and the stack look fine - which is what we'd expect as the verifier is enabled.

Back to the stack:

<1803e00> JIT inline frame: bp = 0x000000000182D5F8, pc = 0x00007FCF76504D3D, unwindSP = 0x000000000182D510, cp = 0x00000000019516A0, arg0EA = 0x0000000000000000, jitInfo = 0x00007FCF4DEC3378
<1803e00>   Method: com/android/tools/r8/m/a/a/b/Y.removeIf(Ljava/util/function/Predicate;)Z !j9method 0x00000000019515E0
<1803e00>   Bytecode index = 7, inlineDepth = 1, PC offset = 0x00007FCF76503D9C

it shows the removeIf method is inlined into the caller. It feels like we've inlined the wrong removeIf method

I'm not sure yet why the bytecode is incorrect. @DanHeidinga Do you have any ideas?

@Leonardo2718 the bytecode looks fine. It has an uncommon pattern - writing back to the 0th arg which normally holds the receiver object for a virtual call - but nothing illegal or incorrect. Note, the method with the bad inline is static so the receiver in a0 convention doesn't apply.

Even assuming the wrong type - that of a0 - doesn't explain in the bad inlining choice as the target is of a different type.

Alright, I think I've wrapped my head around the problem.

Essentially, the bytecodes of the method result in Trees that look like:

n236n     astore  <pending push temp 0>[#364  Auto] [flags 0x7 0x800 ]                        [0x7f3ea7083980] bci=[-1,280,28] rc=0 vc=0 vn=- li=- udi=- nc=1
n230n       aload  <parm 0 Lcom/android/tools/r8/m/a/a/b/d0;>[#357  Parm] [flags 0x40000107 0x0 ]  [0x7f3ea70837a0] bci=[-1,277,25] rc=3 vc=0 vn=- li=- udi=- nc=0
...
n249n     treetop                                                                             [0x7f3ea7083d90] bci=[-1,290,31] rc=0 vc=0 vn=- li=- udi=- nc=1
n248n       new  jitNewObject[#90  helper Method] [flags 0x400 0x0 ]                          [0x7f3ea7083d40] bci=[-1,290,31] rc=3 vc=0 vn=- li=- udi=- nc=1
n247n         loadaddr  java/util/LinkedList[#395  Static] [flags 0x18307 0x0 ]               [0x7f3ea7083cf0] bci=[-1,290,31] rc=1 vc=0 vn=- li=- udi=- nc=0
n250n     astore  <parm 0 Lcom/android/tools/r8/m/a/a/b/d0;>[#357  Parm] [flags 0x40000107 0x0 ]  [0x7f3ea7083de0] bci=[-1,294,31] rc=0 vc=0 vn=- li=- udi=- nc=1                                                                                                               
n248n       ==>new
...
n35n      BBStart <block_40>                                                                  [0x7f3ea7008bd0] bci=[-1,554,58] rc=0 vc=0 vn=- li=- udi=- nc=0
n662n     astore  <pending push temp 0>[#364  Auto] [flags 0x7 0x800 ]                        [0x7f3ea708bea0] bci=[-1,560,63] rc=0 vc=0 vn=- li=- udi=- nc=1
n655n       aload  <parm 0 Lcom/android/tools/r8/m/a/a/b/d0;>[#357  Parm] [flags 0x40000107 0x0 ]  [0x7f3ea708bc70] bci=[-1,554,58] rc=3 vc=0 vn=- li=- udi=- nc=0
...
n700n     NULLCHK on n655n [#32]                                                              [0x7f3ea708ca80] bci=[-1,593,71] rc=0 vc=4 vn=- li=- udi=- nc=1
n699n       icalli  java/util/Collection.removeIf(Ljava/util/function/Predicate;)Z[#474  virtual Method -176] (Interface class) [flags 0x500 0x0 ] ()  [0x7f3ea708ca30] bci=[-1,593,71] rc=2 vc=4 vn=- li=- udi=- nc=3 flg=0x20                                                 
n698n         aloadi  <vft-symbol>[#294  Shadow] [flags 0x18607 0x0 ]                         [0x7f3ea708c9e0] bci=[-1,593,71] rc=1 vc=4 vn=- li=- udi=- nc=1
n655n           ==>aload
n655n         ==>aload
n693n         ==>acalli

When the inliner tries to inline the indirect call at n699n, it tries to figure out the receiving class by looking at the symref of the receiving object n655n (https://github.com/eclipse/omr/blob/ef64925e9da9feb322b70a1a18061ef005cd0e08/compiler/optimizer/Inliner.cpp#L3978). However, because a value of a different type was previously stored to the parameter slot (n247n and n250n), the type of the symref cannot be relied on. The type of the receiver needs to come from somewhere else.

I'm still working on a fix, but I should have something ready pretty soon.

Thanks @liqunl, @DanHeidinga, and @andrewcraik for your help!

@Leonardo2718 what is the outlook for a fix for this? The window is closing for inclusion in 0.21 and we need to figure out if we have to push this out or not.

The fix is turning out to be less straight forward than I thought. Still working on it.

Re the Fixes eclipse/openj9#8823 in eclipse/omr#5337, which will auto-close this issue if the merger has the auth. This issue is tagged against the 0.21 release, and in order to fix the 0.21 release, the change needs to be double delivered to the v0.21.0-release branch of https://github.com/eclipse/openj9-omr.

I will handle the merge and will comment to request the backport to the release branch once the change is approved - thanks for the flag to make sure this happens.

Was this page helpful?
0 / 5 - 0 ratings