2221 // Call into the VM if call site is not yet resolved
2222 //
2223 // Input regs:
2224 // - None, all passed regs are outputs.
2225 //
2226 // Returns:
2227 // - Rcache: The const pool cache entry that contains the resolved result.
2228 // - Rresult: Either noreg or output for f1/f2.
2229 //
2230 // Kills:
2231 // - Rscratch
2232 void TemplateTable::resolve_cache_and_index(int byte_no, Register Rcache, Register Rscratch, size_t index_size) {
2233
2234 __ get_cache_and_index_at_bcp(Rcache, 1, index_size);
2235 Label Lresolved, Ldone;
2236
2237 Bytecodes::Code code = bytecode();
2238 switch (code) {
2239 case Bytecodes::_nofast_getfield: code = Bytecodes::_getfield; break;
2240 case Bytecodes::_nofast_putfield: code = Bytecodes::_putfield; break;
2241 }
2242
2243 assert(byte_no == f1_byte || byte_no == f2_byte, "byte_no out of range");
2244 // We are resolved if the indices offset contains the current bytecode.
2245 #if defined(VM_LITTLE_ENDIAN)
2246 __ lbz(Rscratch, in_bytes(ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::indices_offset()) + byte_no + 1, Rcache);
2247 #else
2248 __ lbz(Rscratch, in_bytes(ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::indices_offset()) + 7 - (byte_no + 1), Rcache);
2249 #endif
2250 // Acquire by cmp-br-isync (see below).
2251 __ cmpdi(CCR0, Rscratch, (int)code);
2252 __ beq(CCR0, Lresolved);
2253
2254 address entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_from_cache);
2255 __ li(R4_ARG2, code);
2256 __ call_VM(noreg, entry, R4_ARG2, true);
2257
2258 // Update registers with resolved info.
2259 __ get_cache_and_index_at_bcp(Rcache, 1, index_size);
2260 __ b(Ldone);
|
2221 // Call into the VM if call site is not yet resolved
2222 //
2223 // Input regs:
2224 // - None, all passed regs are outputs.
2225 //
2226 // Returns:
2227 // - Rcache: The const pool cache entry that contains the resolved result.
2228 // - Rresult: Either noreg or output for f1/f2.
2229 //
2230 // Kills:
2231 // - Rscratch
2232 void TemplateTable::resolve_cache_and_index(int byte_no, Register Rcache, Register Rscratch, size_t index_size) {
2233
2234 __ get_cache_and_index_at_bcp(Rcache, 1, index_size);
2235 Label Lresolved, Ldone;
2236
2237 Bytecodes::Code code = bytecode();
2238 switch (code) {
2239 case Bytecodes::_nofast_getfield: code = Bytecodes::_getfield; break;
2240 case Bytecodes::_nofast_putfield: code = Bytecodes::_putfield; break;
2241 default:
2242 break;
2243 }
2244
2245 assert(byte_no == f1_byte || byte_no == f2_byte, "byte_no out of range");
2246 // We are resolved if the indices offset contains the current bytecode.
2247 #if defined(VM_LITTLE_ENDIAN)
2248 __ lbz(Rscratch, in_bytes(ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::indices_offset()) + byte_no + 1, Rcache);
2249 #else
2250 __ lbz(Rscratch, in_bytes(ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::indices_offset()) + 7 - (byte_no + 1), Rcache);
2251 #endif
2252 // Acquire by cmp-br-isync (see below).
2253 __ cmpdi(CCR0, Rscratch, (int)code);
2254 __ beq(CCR0, Lresolved);
2255
2256 address entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_from_cache);
2257 __ li(R4_ARG2, code);
2258 __ call_VM(noreg, entry, R4_ARG2, true);
2259
2260 // Update registers with resolved info.
2261 __ get_cache_and_index_at_bcp(Rcache, 1, index_size);
2262 __ b(Ldone);
|