8028514: PPC64: Fix C++ Interpreter after '7195622: CheckUnhandledOops has limited usefulness now'
Summary: fix CPP-interpreter after CheckUnhandledOops was re-enabled in the fastdebug build
Reviewed-by: kvn, dholmes, lfoltan
--- a/hotspot/src/cpu/ppc/vm/bytecodeInterpreter_ppc.hpp Sat Nov 16 01:42:55 2013 +0100
+++ b/hotspot/src/cpu/ppc/vm/bytecodeInterpreter_ppc.hpp Tue Nov 19 11:53:58 2013 -0800
@@ -91,7 +91,7 @@
#define LOCALS_SLOT(offset) ((intptr_t*)&locals[-(offset)])
#define LOCALS_ADDR(offset) ((address)locals[-(offset)])
#define LOCALS_INT(offset) (*(jint*)&(locals[-(offset)]))
-#define LOCALS_OBJECT(offset) ((oop)locals[-(offset)])
+#define LOCALS_OBJECT(offset) (cast_to_oop(locals[-(offset)]))
#define LOCALS_LONG_AT(offset) (((address)&locals[-((offset) + 1)]))
#define LOCALS_DOUBLE_AT(offset) (((address)&locals[-((offset) + 1)]))
--- a/hotspot/src/cpu/ppc/vm/frame_ppc.cpp Sat Nov 16 01:42:55 2013 +0100
+++ b/hotspot/src/cpu/ppc/vm/frame_ppc.cpp Tue Nov 19 11:53:58 2013 -0800
@@ -188,7 +188,7 @@
case T_OBJECT:
case T_ARRAY: {
oop* obj_p = *(oop**)lresult;
- oop obj = (obj_p == NULL) ? NULL : *obj_p;
+ oop obj = (obj_p == NULL) ? (oop)NULL : *obj_p;
assert(obj == NULL || Universe::heap()->is_in(obj), "sanity check");
*oop_result = obj;
break;
--- a/hotspot/src/cpu/ppc/vm/nativeInst_ppc.cpp Sat Nov 16 01:42:55 2013 +0100
+++ b/hotspot/src/cpu/ppc/vm/nativeInst_ppc.cpp Tue Nov 19 11:53:58 2013 -0800
@@ -188,7 +188,7 @@
return MacroAssembler::get_const(addr);
} else if (MacroAssembler::is_set_narrow_oop(addr, cb->content_begin())) {
narrowOop no = (narrowOop)MacroAssembler::get_narrow_oop(addr, cb->content_begin());
- return (intptr_t)oopDesc::decode_heap_oop(no);
+ return cast_from_oop<intptr_t>(oopDesc::decode_heap_oop(no));
} else {
assert(MacroAssembler::is_load_const_from_method_toc_at(addr), "must be load_const_from_pool");
@@ -258,7 +258,7 @@
oop_Relocation *r = iter.oop_reloc();
if (oop_addr == NULL) {
oop_addr = r->oop_addr();
- *oop_addr = (oop)data;
+ *oop_addr = cast_to_oop(data);
} else {
assert(oop_addr == r->oop_addr(), "must be only one set-oop here") ;
}
--- a/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.hpp Sat Nov 16 01:42:55 2013 +0100
+++ b/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.hpp Tue Nov 19 11:53:58 2013 -0800
@@ -83,7 +83,7 @@
#define LOCALS_ADDR(offset) ((address)locals[-(offset)])
#define LOCALS_INT(offset) (*((jint*)&locals[-(offset)]))
#define LOCALS_FLOAT(offset) (*((jfloat*)&locals[-(offset)]))
-#define LOCALS_OBJECT(offset) ((oop)locals[-(offset)])
+#define LOCALS_OBJECT(offset) (cast_to_oop(locals[-(offset)]))
#define LOCALS_DOUBLE(offset) (((VMJavaVal64*)&locals[-((offset) + 1)])->d)
#define LOCALS_LONG(offset) (((VMJavaVal64*)&locals[-((offset) + 1)])->l)
#define LOCALS_LONG_AT(offset) (((address)&locals[-((offset) + 1)]))
--- a/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.hpp Sat Nov 16 01:42:55 2013 +0100
+++ b/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.hpp Tue Nov 19 11:53:58 2013 -0800
@@ -94,7 +94,7 @@
#define LOCALS_ADDR(offset) ((address)locals[-(offset)])
#define LOCALS_INT(offset) ((jint)(locals[-(offset)]))
#define LOCALS_FLOAT(offset) (*((jfloat*)&locals[-(offset)]))
-#define LOCALS_OBJECT(offset) ((oop)locals[-(offset)])
+#define LOCALS_OBJECT(offset) (cast_to_oop(locals[-(offset)]))
#define LOCALS_DOUBLE(offset) (((VMJavaVal64*)&locals[-((offset) + 1)])->d)
#define LOCALS_LONG(offset) (((VMJavaVal64*)&locals[-((offset) + 1)])->l)
#define LOCALS_LONG_AT(offset) (((address)&locals[-((offset) + 1)]))
--- a/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.hpp Sat Nov 16 01:42:55 2013 +0100
+++ b/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.hpp Tue Nov 19 11:53:58 2013 -0800
@@ -132,7 +132,7 @@
#define LOCALS_ADDR(offset) ((address)locals[-(offset)])
#define LOCALS_INT(offset) (*((jint*)&locals[-(offset)]))
#define LOCALS_FLOAT(offset) (*((jfloat*)&locals[-(offset)]))
-#define LOCALS_OBJECT(offset) ((oop)locals[-(offset)])
+#define LOCALS_OBJECT(offset) (cast_to_oop(locals[-(offset)]))
#define LOCALS_DOUBLE(offset) (((VMJavaVal64*)&locals[-((offset) + 1)])->d)
#define LOCALS_LONG(offset) (((VMJavaVal64*)&locals[-((offset) + 1)])->l)
#define LOCALS_LONG_AT(offset) (((address)&locals[-((offset) + 1)]))
--- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp Sat Nov 16 01:42:55 2013 +0100
+++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp Tue Nov 19 11:53:58 2013 -0800
@@ -1810,7 +1810,7 @@
// Profile checkcast with null_seen and receiver.
BI_PROFILE_UPDATE_CHECKCAST(/*null_seen=*/true, NULL);
}
- ((objArrayOopDesc *) arrObj)->obj_at_put(index, rhsObject);
+ ((objArrayOop) arrObj)->obj_at_put(index, rhsObject);
UPDATE_PC_AND_TOS_AND_CONTINUE(1, -3);
}
CASE(_bastore):
@@ -2828,7 +2828,7 @@
if (TraceExceptions) {
ttyLocker ttyl;
ResourceMark rm;
- tty->print_cr("Exception <%s> (" INTPTR_FORMAT ")", except_oop->print_value_string(), except_oop());
+ tty->print_cr("Exception <%s> (" INTPTR_FORMAT ")", except_oop->print_value_string(), (void*)except_oop());
tty->print_cr(" thrown in interpreter method <%s>", METHOD->print_value_string());
tty->print_cr(" at bci %d, continuing at %d for thread " INTPTR_FORMAT,
istate->bcp() - (intptr_t)METHOD->code_base(),
@@ -2844,7 +2844,7 @@
if (TraceExceptions) {
ttyLocker ttyl;
ResourceMark rm;
- tty->print_cr("Exception <%s> (" INTPTR_FORMAT ")", except_oop->print_value_string(), except_oop());
+ tty->print_cr("Exception <%s> (" INTPTR_FORMAT ")", except_oop->print_value_string(), (void*)except_oop());
tty->print_cr(" thrown in interpreter method <%s>", METHOD->print_value_string());
tty->print_cr(" at bci %d, unwinding for thread " INTPTR_FORMAT,
istate->bcp() - (intptr_t)METHOD->code_base(),
@@ -3213,7 +3213,7 @@
}
oop BytecodeInterpreter::stack_object(intptr_t *tos, int offset) {
- return (oop)tos [Interpreter::expr_index_at(-offset)];
+ return cast_to_oop(tos [Interpreter::expr_index_at(-offset)]);
}
jdouble BytecodeInterpreter::stack_double(intptr_t *tos, int offset) {
@@ -3282,7 +3282,7 @@
return (jfloat)locals[Interpreter::local_index_at(-offset)];
}
oop BytecodeInterpreter::locals_object(intptr_t* locals, int offset) {
- return (oop)locals[Interpreter::local_index_at(-offset)];
+ return cast_to_oop(locals[Interpreter::local_index_at(-offset)]);
}
jdouble BytecodeInterpreter::locals_double(intptr_t* locals, int offset) {
return ((VMJavaVal64*)&locals[Interpreter::local_index_at(-(offset+1))])->d;
@@ -3441,7 +3441,7 @@
tty->print_cr("osr._osr_buf: " INTPTR_FORMAT, (uintptr_t) this->_result._osr._osr_buf);
tty->print_cr("osr._osr_entry: " INTPTR_FORMAT, (uintptr_t) this->_result._osr._osr_entry);
tty->print_cr("prev_link: " INTPTR_FORMAT, (uintptr_t) this->_prev_link);
- tty->print_cr("native_mirror: " INTPTR_FORMAT, (uintptr_t) this->_oop_temp);
+ tty->print_cr("native_mirror: " INTPTR_FORMAT, (void*) this->_oop_temp);
tty->print_cr("stack_base: " INTPTR_FORMAT, (uintptr_t) this->_stack_base);
tty->print_cr("stack_limit: " INTPTR_FORMAT, (uintptr_t) this->_stack_limit);
tty->print_cr("monitor_base: " INTPTR_FORMAT, (uintptr_t) this->_monitor_base);
--- a/hotspot/src/share/vm/oops/methodData.hpp Sat Nov 16 01:42:55 2013 +0100
+++ b/hotspot/src/share/vm/oops/methodData.hpp Tue Nov 19 11:53:58 2013 -0800
@@ -395,7 +395,7 @@
}
static oop oop_at(DataLayout* layout, int index) {
- return (oop)layout->cell_at(index);
+ return cast_to_oop(layout->cell_at(index));
}
static void set_intptr_at(DataLayout* layout, int index, intptr_t value) {
@@ -1248,8 +1248,8 @@
}
static Klass *receiver_unchecked(DataLayout* layout, uint row) {
- oop recv = oop_at(layout, receiver_cell_index(row));
- return (Klass *)recv;
+ Klass* recv = (Klass*)layout->cell_at(receiver_cell_index(row));
+ return recv;
}
static void increment_receiver_count_no_overflow(DataLayout* layout, Klass *rcvr) {