From 85e61f9975dfb08bd6b0e707b7c2fe0d8bc3debc Mon Sep 17 00:00:00 2001 From: simonis Date: Tue, 19 Nov 2013 11:53:58 -0800 Subject: [PATCH] 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 --- hotspot/src/cpu/ppc/vm/bytecodeInterpreter_ppc.hpp | 2 +- hotspot/src/cpu/ppc/vm/frame_ppc.cpp | 2 +- hotspot/src/cpu/ppc/vm/nativeInst_ppc.cpp | 4 ++-- .../src/cpu/sparc/vm/bytecodeInterpreter_sparc.hpp | 2 +- hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.hpp | 2 +- hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.hpp | 2 +- .../src/share/vm/interpreter/bytecodeInterpreter.cpp | 12 ++++++------ hotspot/src/share/vm/oops/methodData.hpp | 6 +++--- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/hotspot/src/cpu/ppc/vm/bytecodeInterpreter_ppc.hpp b/hotspot/src/cpu/ppc/vm/bytecodeInterpreter_ppc.hpp index 3706c984b3..038854f6d2 100644 --- a/hotspot/src/cpu/ppc/vm/bytecodeInterpreter_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/bytecodeInterpreter_ppc.hpp @@ -91,7 +91,7 @@ public: #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)])) diff --git a/hotspot/src/cpu/ppc/vm/frame_ppc.cpp b/hotspot/src/cpu/ppc/vm/frame_ppc.cpp index 03d525db4e..2800635adf 100644 --- a/hotspot/src/cpu/ppc/vm/frame_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/frame_ppc.cpp @@ -188,7 +188,7 @@ BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result) 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; diff --git a/hotspot/src/cpu/ppc/vm/nativeInst_ppc.cpp b/hotspot/src/cpu/ppc/vm/nativeInst_ppc.cpp index 5b88284b2d..fecb581338 100644 --- a/hotspot/src/cpu/ppc/vm/nativeInst_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/nativeInst_ppc.cpp @@ -188,7 +188,7 @@ intptr_t NativeMovConstReg::data() const { 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(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 @@ void NativeMovConstReg::set_data(intptr_t data) { 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") ; } diff --git a/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.hpp b/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.hpp index aad5bc7162..dd417a30eb 100644 --- a/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.hpp @@ -83,7 +83,7 @@ public: #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)])) diff --git a/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.hpp b/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.hpp index e4eaa75128..2538b4ef45 100644 --- a/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.hpp +++ b/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.hpp @@ -94,7 +94,7 @@ inline intptr_t* sender_sp() { #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)])) diff --git a/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.hpp b/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.hpp index 0b355b5c5b..f7bcb91e54 100644 --- a/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.hpp +++ b/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.hpp @@ -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)])) diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp index 6008fdd6e1..6b9dd574b3 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp @@ -1810,7 +1810,7 @@ run: // 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 @@ run: 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 @@ run: 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 @@ jfloat BytecodeInterpreter::stack_float(intptr_t *tos, int offset) { } 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 @@ jfloat BytecodeInterpreter::locals_float(intptr_t* locals, int offset) { 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 @@ BytecodeInterpreter::print() { 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); diff --git a/hotspot/src/share/vm/oops/methodData.hpp b/hotspot/src/share/vm/oops/methodData.hpp index 8846ef7406..03c96f24d8 100644 --- a/hotspot/src/share/vm/oops/methodData.hpp +++ b/hotspot/src/share/vm/oops/methodData.hpp @@ -395,7 +395,7 @@ protected: } 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 @@ public: } 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) { -- GitLab