From 277f0c24a2e186166bfe70fc93ba79aec10585aa Mon Sep 17 00:00:00 2001 From: Olga Mikhaltsova Date: Mon, 14 Nov 2022 08:40:11 +0000 Subject: [PATCH] 8296821: compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/NativeCallTest.java fails after JDK-8262901 Reviewed-by: kvn, thartmann --- test/hotspot/jtreg/ProblemList.txt | 1 - .../src/jdk/vm/ci/code/test/NativeCallTest.java | 8 +++++++- .../src/jdk/vm/ci/code/test/amd64/AMD64TestAssembler.java | 6 ++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index 0708157c11a6c..ecefd0109050f 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -46,7 +46,6 @@ compiler/ciReplay/TestSAServer.java 8029528 generic-all compiler/compilercontrol/jcmd/ClearDirectivesFileStackTest.java 8225370 generic-all compiler/jvmci/compilerToVM/GetFlagValueTest.java 8204459 generic-all -compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/NativeCallTest.java 8296821 generic-all compiler/tiered/LevelTransitionTest.java 8067651 generic-all compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java 8190680 generic-all diff --git a/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/NativeCallTest.java b/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/NativeCallTest.java index cfe50187e79b6..ebd57b6faaff1 100644 --- a/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/NativeCallTest.java +++ b/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/NativeCallTest.java @@ -159,7 +159,13 @@ public void test(String name, long addr, Class returnClazz, Class[] types, asm.emitCallPrologue(cc, values); asm.emitCall(addr); asm.emitCallEpilogue(cc); - asm.emitFloatRet(((RegisterValue) cc.getReturn()).getRegister()); + if (returnClazz == float.class) { + asm.emitFloatRet(((RegisterValue) cc.getReturn()).getRegister()); + } else if (returnClazz == int.class) { + asm.emitIntRet(((RegisterValue) cc.getReturn()).getRegister()); + } else { + assert false : "Unimplemented return type: " + returnClazz; + } }, getMethod(name, types), values); } catch (Throwable e) { e.printStackTrace(); diff --git a/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/amd64/AMD64TestAssembler.java b/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/amd64/AMD64TestAssembler.java index fd1eff615f258..a0fcdd2b0a988 100644 --- a/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/amd64/AMD64TestAssembler.java +++ b/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/amd64/AMD64TestAssembler.java @@ -403,8 +403,7 @@ public void emitLoad(AllocatableValue av, Object prim) { @Override public void emitCallPrologue(CallingConvention cc, Object... prim) { - emitGrowStack(cc.getStackSize()); - frameSize += cc.getStackSize(); + growFrame(cc.getStackSize()); AllocatableValue[] args = cc.getArguments(); // Do the emission in reverse, this avoids register collisons of xmm0 - which is used a // scratch register when putting arguments on the stack. @@ -427,7 +426,6 @@ public void emitCall(long addr) { @Override public void emitCallEpilogue(CallingConvention cc) { - emitGrowStack(-cc.getStackSize()); - frameSize -= cc.getStackSize(); + growFrame(-cc.getStackSize()); } }