/hg/icedtea6: ARM: Fix safepoints in backward branches.
aph at icedtea.classpath.org
aph at icedtea.classpath.org
Thu Jan 26 07:20:33 PST 2012
changeset 80c34531aba3 in /hg/icedtea6
details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=80c34531aba3
author: aph
date: Thu Jan 26 07:27:15 2012 -0500
ARM: Fix safepoints in backward branches. 2012-01-25 Andrew Haley
<aph at redhat.com>
* openjdk-ecj/hotspot/src/cpu/zero/vm/thumb2.cpp
(Thumb2_Branch): Remove safepoint code.
(Thumb2_Cond_Safepoint): New function. (Thumb2_codegen):
Call Thumb2_Cond_Safepoint() from two places.
diffstat:
ChangeLog | 7 +++++++
arm_port/hotspot/src/cpu/zero/vm/thumb2.cpp | 23 ++++++++++++++++-------
2 files changed, 23 insertions(+), 7 deletions(-)
diffs (79 lines):
diff -r 6179ebaffe6b -r 80c34531aba3 ChangeLog
--- a/ChangeLog Mon Jan 23 16:43:01 2012 +0000
+++ b/ChangeLog Thu Jan 26 07:27:15 2012 -0500
@@ -1,3 +1,10 @@
+2012-01-25 Andrew Haley <aph at redhat.com>
+
+ * openjdk-ecj/hotspot/src/cpu/zero/vm/thumb2.cpp (Thumb2_Branch):
+ Remove safepoint code.
+ (Thumb2_Cond_Safepoint): New function.
+ (Thumb2_codegen): Call Thumb2_Cond_Safepoint() from two places.
+
2012-01-23 Andrew Haley <aph at redhat.com>
* arm_port/hotspot/src/cpu/zero/vm/thumb2.cpp (print_address): Add
diff -r 6179ebaffe6b -r 80c34531aba3 arm_port/hotspot/src/cpu/zero/vm/thumb2.cpp
--- a/arm_port/hotspot/src/cpu/zero/vm/thumb2.cpp Mon Jan 23 16:43:01 2012 +0000
+++ b/arm_port/hotspot/src/cpu/zero/vm/thumb2.cpp Thu Jan 26 07:27:15 2012 -0500
@@ -4365,7 +4365,17 @@
}
}
-int Thumb2_Branch(Thumb2_Info *jinfo, unsigned bci, unsigned cond, int stackdepth)
+// If this is a backward branch, compile a safepoint check
+void Thumb2_Cond_Safepoint(Thumb2_Info *jinfo, int stackdepth, int bci) {
+ int offset = GET_JAVA_S2(jinfo->code_base + bci + 1);
+ unsigned dest_taken = bci + offset;
+
+ if (jinfo->bc_stackinfo[dest_taken] & BC_COMPILED) {
+ Thumb2_Safepoint(jinfo, stackdepth, bci);
+ }
+}
+
+int Thumb2_Branch(Thumb2_Info *jinfo, unsigned bci, unsigned cond)
{
int offset = GET_JAVA_S2(jinfo->code_base + bci + 1);
unsigned dest_taken = bci + offset;
@@ -4373,10 +4383,7 @@
unsigned loc;
if (jinfo->bc_stackinfo[dest_taken] & BC_COMPILED) {
- loc = forward_16(jinfo->codebuf);
- Thumb2_Safepoint(jinfo, stackdepth, bci);
- branch_uncond(jinfo->codebuf, jinfo->bc_stackinfo[dest_taken] & ~BC_FLAGS_MASK);
- bcc_patch(jinfo->codebuf, NEG_COND(cond), loc);
+ branch(jinfo->codebuf, cond, jinfo->bc_stackinfo[dest_taken] & ~BC_FLAGS_MASK);
return dest_not_taken;
}
loc = forward_32(jinfo->codebuf);
@@ -6323,12 +6330,13 @@
case opc_ifnonnull: {
Reg r;
unsigned cond = opcode - opc_ifeq;
+ Thumb2_Cond_Safepoint(jinfo, stackdepth, bci);
if (opcode >= opc_ifnull) cond = opcode - opc_ifnull;
Thumb2_Fill(jinfo, 1);
r = POP(jstack);
Thumb2_Flush(jinfo);
cmp_imm(jinfo->codebuf, r, 0);
- bci = Thumb2_Branch(jinfo, bci, cond, stackdepth-1);
+ bci = Thumb2_Branch(jinfo, bci, cond);
len = 0;
break;
}
@@ -6343,13 +6351,14 @@
case opc_if_acmpne: {
Reg r_lho, r_rho;
unsigned cond = opcode - opc_if_icmpeq;
+ Thumb2_Cond_Safepoint(jinfo, stackdepth, bci);
if (opcode >= opc_if_acmpeq) cond = opcode - opc_if_acmpeq;
Thumb2_Fill(jinfo, 2);
r_rho = POP(jstack);
r_lho = POP(jstack);
Thumb2_Flush(jinfo);
cmp_reg(jinfo->codebuf, r_lho, r_rho);
- bci = Thumb2_Branch(jinfo, bci, cond, stackdepth-2);
+ bci = Thumb2_Branch(jinfo, bci, cond);
len = 0;
break;
}
More information about the distro-pkg-dev
mailing list