Mercurial > hg > truffle
diff src/cpu/sparc/vm/interp_masm_sparc.cpp @ 1565:ab102d5d923e
6939207: refactor constant pool index processing
Summary: Factored cleanup of instruction decode which prepares for enhanced ldc semantics.
Reviewed-by: twisti
author | jrose |
---|---|
date | Sun, 23 May 2010 01:38:26 -0700 |
parents | 2338d41fbd81 |
children | e9ff18c4ace7 |
line wrap: on
line diff
--- a/src/cpu/sparc/vm/interp_masm_sparc.cpp Fri May 21 02:59:24 2010 -0700 +++ b/src/cpu/sparc/vm/interp_masm_sparc.cpp Sun May 23 01:38:26 2010 -0700 @@ -720,25 +720,30 @@ void InterpreterMacroAssembler::get_cache_index_at_bcp(Register cache, Register tmp, - int bcp_offset, bool giant_index) { + int bcp_offset, size_t index_size) { assert(bcp_offset > 0, "bcp is still pointing to start of bytecode"); - if (!giant_index) { + if (index_size == sizeof(u2)) { get_2_byte_integer_at_bcp(bcp_offset, cache, tmp, Unsigned); - } else { + } else if (index_size == sizeof(u4)) { assert(EnableInvokeDynamic, "giant index used only for EnableInvokeDynamic"); get_4_byte_integer_at_bcp(bcp_offset, cache, tmp); assert(constantPoolCacheOopDesc::decode_secondary_index(~123) == 123, "else change next line"); xor3(tmp, -1, tmp); // convert to plain index + } else if (index_size == sizeof(u1)) { + assert(EnableMethodHandles, "tiny index used only for EnableMethodHandles"); + ldub(Lbcp, bcp_offset, tmp); + } else { + ShouldNotReachHere(); } } void InterpreterMacroAssembler::get_cache_and_index_at_bcp(Register cache, Register tmp, - int bcp_offset, bool giant_index) { + int bcp_offset, size_t index_size) { assert(bcp_offset > 0, "bcp is still pointing to start of bytecode"); assert_different_registers(cache, tmp); assert_not_delayed(); - get_cache_index_at_bcp(cache, tmp, bcp_offset, giant_index); + get_cache_index_at_bcp(cache, tmp, bcp_offset, index_size); // convert from field index to ConstantPoolCacheEntry index and from // word index to byte offset sll(tmp, exact_log2(in_words(ConstantPoolCacheEntry::size()) * BytesPerWord), tmp); @@ -747,12 +752,15 @@ void InterpreterMacroAssembler::get_cache_entry_pointer_at_bcp(Register cache, Register tmp, - int bcp_offset, bool giant_index) { + int bcp_offset, size_t index_size) { assert(bcp_offset > 0, "bcp is still pointing to start of bytecode"); assert_different_registers(cache, tmp); assert_not_delayed(); - assert(!giant_index,"NYI"); - get_2_byte_integer_at_bcp(bcp_offset, cache, tmp, Unsigned); + if (index_size == sizeof(u2)) { + get_2_byte_integer_at_bcp(bcp_offset, cache, tmp, Unsigned); + } else { + ShouldNotReachHere(); // other sizes not supported here + } // convert from field index to ConstantPoolCacheEntry index // and from word index to byte offset sll(tmp, exact_log2(in_words(ConstantPoolCacheEntry::size()) * BytesPerWord), tmp);