Mercurial > hg > truffle
diff src/cpu/sparc/vm/templateTable_sparc.cpp @ 1926:a1e319b5b13a
Merge
author | trims |
---|---|
date | Thu, 11 Nov 2010 23:29:32 -0800 |
parents | 3b2dea75431e |
children | f95d63e2154a |
line wrap: on
line diff
--- a/src/cpu/sparc/vm/templateTable_sparc.cpp Thu Nov 11 23:17:26 2010 -0800 +++ b/src/cpu/sparc/vm/templateTable_sparc.cpp Thu Nov 11 23:29:32 2010 -0800 @@ -341,6 +341,26 @@ resolve_cache_and_index(f1_oop, Otos_i, Rcache, Rscratch, wide ? sizeof(u2) : sizeof(u1)); __ verify_oop(Otos_i); + + Label L_done; + const Register Rcon_klass = G3_scratch; // same as Rcache + const Register Rarray_klass = G4_scratch; // same as Rscratch + __ load_klass(Otos_i, Rcon_klass); + AddressLiteral array_klass_addr((address)Universe::systemObjArrayKlassObj_addr()); + __ load_contents(array_klass_addr, Rarray_klass); + __ cmp(Rarray_klass, Rcon_klass); + __ brx(Assembler::notEqual, false, Assembler::pt, L_done); + __ delayed()->nop(); + __ ld(Address(Otos_i, arrayOopDesc::length_offset_in_bytes()), Rcon_klass); + __ tst(Rcon_klass); + __ brx(Assembler::zero, true, Assembler::pt, L_done); + __ delayed()->clr(Otos_i); // executed only if branch is taken + + // Load the exception from the system-array which wraps it: + __ load_heap_oop(Otos_i, arrayOopDesc::base_offset_in_bytes(T_OBJECT), Otos_i); + __ throw_if_not_x(Assembler::never, Interpreter::throw_exception_entry(), G3_scratch); + + __ bind(L_done); } void TemplateTable::ldc2_w() {