< prev index next >

src/hotspot/cpu/s390/templateTable_s390.cpp

Print this page
rev 51881 : 8211145: [ppc] [s390]: Build fails due to -Werror=switch (introduced with JDK-8211029)
Reviewed-by:


2400   __ z_br(Z_R14);
2401 }
2402 
2403 // ----------------------------------------------------------------------------
2404 // NOTE: Cpe_offset is already computed as byte offset, so we must not
2405 // shift it afterwards!
2406 void TemplateTable::resolve_cache_and_index(int byte_no,
2407                                             Register Rcache,
2408                                             Register cpe_offset,
2409                                             size_t index_size) {
2410   BLOCK_COMMENT("resolve_cache_and_index {");
2411   NearLabel      resolved;
2412   const Register bytecode_in_cpcache = Z_R1_scratch;
2413   const int      total_f1_offset = in_bytes(ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::f1_offset());
2414   assert_different_registers(Rcache, cpe_offset, bytecode_in_cpcache);
2415 
2416   Bytecodes::Code code = bytecode();
2417   switch (code) {
2418     case Bytecodes::_nofast_getfield: code = Bytecodes::_getfield; break;
2419     case Bytecodes::_nofast_putfield: code = Bytecodes::_putfield; break;

2420   }
2421 
2422   {
2423     assert(byte_no == f1_byte || byte_no == f2_byte, "byte_no out of range");
2424     __ get_cache_and_index_and_bytecode_at_bcp(Rcache, cpe_offset, bytecode_in_cpcache, byte_no, 1, index_size);
2425     // Have we resolved this bytecode?
2426     __ compare32_and_branch(bytecode_in_cpcache, (int)code, Assembler::bcondEqual, resolved);
2427   }
2428 
2429   // Resolve first time through.
2430   address entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_from_cache);
2431   __ load_const_optimized(Z_ARG2, (int) code);
2432   __ call_VM(noreg, entry, Z_ARG2);
2433 
2434   // Update registers with resolved info.
2435   __ get_cache_and_index_at_bcp(Rcache, cpe_offset, 1, index_size);
2436   __ bind(resolved);
2437   BLOCK_COMMENT("} resolve_cache_and_index");
2438 }
2439 


3196   switch (bytecode()) {             // Restore tos values.
3197     case Bytecodes::_fast_aputfield:
3198       __ pop_ptr(Z_tos);
3199       break;
3200     case Bytecodes::_fast_bputfield:
3201     case Bytecodes::_fast_zputfield:
3202     case Bytecodes::_fast_sputfield:
3203     case Bytecodes::_fast_cputfield:
3204     case Bytecodes::_fast_iputfield:
3205       __ pop_i(Z_tos);
3206       break;
3207     case Bytecodes::_fast_dputfield:
3208       __ pop_d(Z_ftos);
3209       break;
3210     case Bytecodes::_fast_fputfield:
3211       __ pop_f(Z_ftos);
3212       break;
3213     case Bytecodes::_fast_lputfield:
3214       __ pop_l(Z_tos);
3215       break;

3216   }
3217 
3218   __ bind(exit);
3219   BLOCK_COMMENT("} jvmti_post_fast_field_mod");
3220 }
3221 
3222 void TemplateTable::fast_storefield(TosState state) {
3223   transition(state, vtos);
3224 
3225   ByteSize base = ConstantPoolCache::base_offset();
3226   jvmti_post_fast_field_mod();
3227 
3228   // Access constant pool cache.
3229   Register cache = Z_tmp_1;
3230   Register index = Z_tmp_2;
3231   Register flags = Z_ARG5;
3232 
3233   // Index comes in bytes, don't shift afterwards!
3234   __ get_cache_and_index_at_bcp(cache, index, 1);
3235 




2400   __ z_br(Z_R14);
2401 }
2402 
2403 // ----------------------------------------------------------------------------
2404 // NOTE: Cpe_offset is already computed as byte offset, so we must not
2405 // shift it afterwards!
2406 void TemplateTable::resolve_cache_and_index(int byte_no,
2407                                             Register Rcache,
2408                                             Register cpe_offset,
2409                                             size_t index_size) {
2410   BLOCK_COMMENT("resolve_cache_and_index {");
2411   NearLabel      resolved;
2412   const Register bytecode_in_cpcache = Z_R1_scratch;
2413   const int      total_f1_offset = in_bytes(ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::f1_offset());
2414   assert_different_registers(Rcache, cpe_offset, bytecode_in_cpcache);
2415 
2416   Bytecodes::Code code = bytecode();
2417   switch (code) {
2418     case Bytecodes::_nofast_getfield: code = Bytecodes::_getfield; break;
2419     case Bytecodes::_nofast_putfield: code = Bytecodes::_putfield; break;
2420     default: break;
2421   }
2422 
2423   {
2424     assert(byte_no == f1_byte || byte_no == f2_byte, "byte_no out of range");
2425     __ get_cache_and_index_and_bytecode_at_bcp(Rcache, cpe_offset, bytecode_in_cpcache, byte_no, 1, index_size);
2426     // Have we resolved this bytecode?
2427     __ compare32_and_branch(bytecode_in_cpcache, (int)code, Assembler::bcondEqual, resolved);
2428   }
2429 
2430   // Resolve first time through.
2431   address entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_from_cache);
2432   __ load_const_optimized(Z_ARG2, (int) code);
2433   __ call_VM(noreg, entry, Z_ARG2);
2434 
2435   // Update registers with resolved info.
2436   __ get_cache_and_index_at_bcp(Rcache, cpe_offset, 1, index_size);
2437   __ bind(resolved);
2438   BLOCK_COMMENT("} resolve_cache_and_index");
2439 }
2440 


3197   switch (bytecode()) {             // Restore tos values.
3198     case Bytecodes::_fast_aputfield:
3199       __ pop_ptr(Z_tos);
3200       break;
3201     case Bytecodes::_fast_bputfield:
3202     case Bytecodes::_fast_zputfield:
3203     case Bytecodes::_fast_sputfield:
3204     case Bytecodes::_fast_cputfield:
3205     case Bytecodes::_fast_iputfield:
3206       __ pop_i(Z_tos);
3207       break;
3208     case Bytecodes::_fast_dputfield:
3209       __ pop_d(Z_ftos);
3210       break;
3211     case Bytecodes::_fast_fputfield:
3212       __ pop_f(Z_ftos);
3213       break;
3214     case Bytecodes::_fast_lputfield:
3215       __ pop_l(Z_tos);
3216       break;
3217     default: break;
3218   }
3219 
3220   __ bind(exit);
3221   BLOCK_COMMENT("} jvmti_post_fast_field_mod");
3222 }
3223 
3224 void TemplateTable::fast_storefield(TosState state) {
3225   transition(state, vtos);
3226 
3227   ByteSize base = ConstantPoolCache::base_offset();
3228   jvmti_post_fast_field_mod();
3229 
3230   // Access constant pool cache.
3231   Register cache = Z_tmp_1;
3232   Register index = Z_tmp_2;
3233   Register flags = Z_ARG5;
3234 
3235   // Index comes in bytes, don't shift afterwards!
3236   __ get_cache_and_index_at_bcp(cache, index, 1);
3237 


< prev index next >