/hg/openjdk6-mips: Fix bug related to the unsafe ops.
liuqi at icedtea.classpath.org
liuqi at icedtea.classpath.org
Mon Nov 8 04:35:05 PST 2010
changeset 8ef762f87d0e in /hg/openjdk6-mips
details: http://icedtea.classpath.org/hg/openjdk6-mips?cmd=changeset;node=8ef762f87d0e
author: YANG Yongqiang <yangyongqiang at loongson.cn>
date: Mon Nov 08 19:53:05 2010 +0800
Fix bug related to the unsafe ops.
diffstat:
2 files changed, 17 insertions(+), 12 deletions(-)
hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp | 17 +++++++++++------
hotspot/src/cpu/mips/vm/c1_LIRGenerator_mips.cpp | 12 ++++++------
diffs (117 lines):
diff -r da31f361800f -r 8ef762f87d0e hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp
--- a/hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp Fri Nov 05 17:36:30 2010 +0800
+++ b/hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp Mon Nov 08 19:53:05 2010 +0800
@@ -2371,6 +2371,7 @@ void LIR_Assembler::emit_opTypeCheck(LIR
Register array = op->array()->as_register();
Register k_RInfo = op->tmp1()->as_register();
Register klass_RInfo = op->tmp2()->as_register();
+ Register tmp = op->tmp3()->as_register();
CodeStub* stub = op->stub();
Label done;
@@ -2387,27 +2388,29 @@ void LIR_Assembler::emit_opTypeCheck(LIR
//for SIGBUS, FIXME, Jerome
__ nop();
__ nop();
- __ lw(T9, k_RInfo, sizeof(oopDesc) + Klass::super_check_offset_offset_in_bytes());
+ __ lw(tmp, k_RInfo, sizeof(oopDesc) + Klass::super_check_offset_offset_in_bytes());
// See if we get an immediate positive hit
- __ add(AT, klass_RInfo, T9);
+ __ add(AT, klass_RInfo, tmp);
+
__ lw(AT, AT, 0);
__ beq(k_RInfo, AT, done);
__ delayed()->nop();
// check for immediate negative hit
__ move(AT, sizeof(oopDesc) + Klass::secondary_super_cache_offset_in_bytes());
- __ bne(T9, AT, *stub->entry()); // fail
+ __ bne(tmp, AT, *stub->entry()); // fail
__ delayed()->nop();
// check for self
__ beq(klass_RInfo, k_RInfo, done);
__ delayed()->nop();
+ __ push(T8);
// super type array
__ lw(T8, klass_RInfo, sizeof(oopDesc) + Klass::secondary_supers_offset_in_bytes());
// length
- __ lw(T9, T8, arrayOopDesc::length_offset_in_bytes());
+ __ lw(tmp, T8, arrayOopDesc::length_offset_in_bytes());
// base
__ addi(T8, T8, arrayOopDesc::base_offset_in_bytes(T_OBJECT));
@@ -2415,22 +2418,24 @@ void LIR_Assembler::emit_opTypeCheck(LIR
Label miss, hit, loop;
// T9:count, T8:base, k_RInfo: super klass
__ bind(loop);
- __ beq(T9, ZERO, miss);
+ __ beq(tmp, ZERO, miss);
__ delayed()->lw(AT, T8, 0);
__ beq(AT, k_RInfo, hit);
__ delayed();
- __ addiu(T9, T9, -1);
+ __ addiu(tmp, tmp, -1);
__ b(loop);
__ delayed();
__ addi(T8, T8, 1 * wordSize);
__ bind(miss);
+ __ pop(T8);
__ b(*stub->entry());
__ delayed()->nop();
__ bind(hit);
__ sw(k_RInfo, klass_RInfo, sizeof(oopDesc)
+ Klass::secondary_super_cache_offset_in_bytes());
+ __ pop(T8);
__ bind(done);
} else if (op->code() == lir_checkcast) {
diff -r da31f361800f -r 8ef762f87d0e hotspot/src/cpu/mips/vm/c1_LIRGenerator_mips.cpp
--- a/hotspot/src/cpu/mips/vm/c1_LIRGenerator_mips.cpp Fri Nov 05 17:36:30 2010 +0800
+++ b/hotspot/src/cpu/mips/vm/c1_LIRGenerator_mips.cpp Mon Nov 08 19:53:05 2010 +0800
@@ -1269,9 +1269,9 @@ void LIRGenerator::volatile_field_load(L
void LIRGenerator::get_Object_unsafe(LIR_Opr dst, LIR_Opr src, LIR_Opr offset,
BasicType type, bool is_volatile) {
- __ add(src, src, offset);
+ __ add(src, offset, offset);
if (is_volatile && type == T_LONG) {
- LIR_Address* addr = new LIR_Address(src, 0, T_DOUBLE);
+ LIR_Address* addr = new LIR_Address(offset, 0, T_DOUBLE);
LIR_Opr tmp = new_register(T_DOUBLE);
__ load(addr, tmp);
LIR_Opr spill = new_register(T_LONG);
@@ -1279,7 +1279,7 @@ void LIRGenerator::get_Object_unsafe(LIR
__ move(tmp, spill);
__ move(spill, dst);
} else {
- LIR_Address* addr = new LIR_Address(src, 0, type);
+ LIR_Address* addr = new LIR_Address(offset, 0, type);
__ load(addr, dst);
}
}
@@ -1287,9 +1287,9 @@ void LIRGenerator::get_Object_unsafe(LIR
void LIRGenerator::put_Object_unsafe(LIR_Opr src, LIR_Opr offset, LIR_Opr data,
BasicType type, bool is_volatile) {
- __ add(src, src, offset);
+ __ add(src, offset, offset);
if (is_volatile && type == T_LONG) {
- LIR_Address* addr = new LIR_Address(src, 0, T_DOUBLE);
+ LIR_Address* addr = new LIR_Address(offset, 0, T_DOUBLE);
LIR_Opr tmp = new_register(T_DOUBLE);
LIR_Opr spill = new_register(T_DOUBLE);
set_vreg_flag(spill, must_start_in_memory);
@@ -1298,7 +1298,7 @@ void LIRGenerator::put_Object_unsafe(LIR
__ move(tmp, addr);
} else {
- LIR_Address* addr = new LIR_Address(src, 0, type);
+ LIR_Address* addr = new LIR_Address(offset, 0, type);
bool is_obj = (type == T_ARRAY || type == T_OBJECT);
if (is_obj) {
// Do the pre-write barrier, if any.
More information about the distro-pkg-dev
mailing list