diff -r 8213b0f5c92d -r 3b2dea75431e src/cpu/x86/vm/templateTable_x86_64.cpp --- a/src/cpu/x86/vm/templateTable_x86_64.cpp Sat Oct 30 12:19:07 2010 -0700 +++ b/src/cpu/x86/vm/templateTable_x86_64.cpp Sat Oct 30 13:08:23 2010 -0700 @@ -413,6 +413,25 @@ if (VerifyOops) { __ verify_oop(rax); } + + Label L_done, L_throw_exception; + const Register con_klass_temp = rcx; // same as cache + const Register array_klass_temp = rdx; // same as index + __ movptr(con_klass_temp, Address(rax, oopDesc::klass_offset_in_bytes())); + __ lea(array_klass_temp, ExternalAddress((address)Universe::systemObjArrayKlassObj_addr())); + __ cmpptr(con_klass_temp, Address(array_klass_temp, 0)); + __ jcc(Assembler::notEqual, L_done); + __ cmpl(Address(rax, arrayOopDesc::length_offset_in_bytes()), 0); + __ jcc(Assembler::notEqual, L_throw_exception); + __ xorptr(rax, rax); + __ jmp(L_done); + + // Load the exception from the system-array which wraps it: + __ bind(L_throw_exception); + __ movptr(rax, Address(rax, arrayOopDesc::base_offset_in_bytes(T_OBJECT))); + __ jump(ExternalAddress(Interpreter::throw_exception_entry())); + + __ bind(L_done); } void TemplateTable::ldc2_w() {