< prev index next >

src/share/vm/interpreter/interpreter.cpp

Print this page




 215 
 216   // Method handle primitive?
 217   if (m->is_method_handle_intrinsic()) {
 218     vmIntrinsics::ID id = m->intrinsic_id();
 219     assert(MethodHandles::is_signature_polymorphic(id), "must match an intrinsic");
 220     MethodKind kind = (MethodKind)( method_handle_invoke_FIRST +
 221                                     ((int)id - vmIntrinsics::FIRST_MH_SIG_POLY) );
 222     assert(kind <= method_handle_invoke_LAST, "parallel enum ranges");
 223     return kind;
 224   }
 225 
 226 #ifndef CC_INTERP
 227   if (UseCRC32Intrinsics && m->is_native()) {
 228     // Use optimized stub code for CRC32 native methods.
 229     switch (m->intrinsic_id()) {
 230       case vmIntrinsics::_updateCRC32            : return java_util_zip_CRC32_update;
 231       case vmIntrinsics::_updateBytesCRC32       : return java_util_zip_CRC32_updateBytes;
 232       case vmIntrinsics::_updateByteBufferCRC32  : return java_util_zip_CRC32_updateByteBuffer;
 233     }
 234   }







 235 #endif
 236 
 237   // Native method?
 238   // Note: This test must come _before_ the test for intrinsic
 239   //       methods. See also comments below.
 240   if (m->is_native()) {
 241     assert(!m->is_method_handle_intrinsic(), "overlapping bits here, watch out");
 242     return m->is_synchronized() ? native_synchronized : native;
 243   }
 244 
 245   // Synchronized?
 246   if (m->is_synchronized()) {
 247     return zerolocals_synchronized;
 248   }
 249 
 250   if (RegisterFinalizersAtInit && m->code_size() == 1 &&
 251       m->intrinsic_id() == vmIntrinsics::_Object_init) {
 252     // We need to execute the special return bytecode to check for
 253     // finalizer registration so create a normal frame.
 254     return zerolocals;


 322 #ifndef PRODUCT
 323 void AbstractInterpreter::print_method_kind(MethodKind kind) {
 324   switch (kind) {
 325     case zerolocals             : tty->print("zerolocals"             ); break;
 326     case zerolocals_synchronized: tty->print("zerolocals_synchronized"); break;
 327     case native                 : tty->print("native"                 ); break;
 328     case native_synchronized    : tty->print("native_synchronized"    ); break;
 329     case empty                  : tty->print("empty"                  ); break;
 330     case accessor               : tty->print("accessor"               ); break;
 331     case abstract               : tty->print("abstract"               ); break;
 332     case java_lang_math_sin     : tty->print("java_lang_math_sin"     ); break;
 333     case java_lang_math_cos     : tty->print("java_lang_math_cos"     ); break;
 334     case java_lang_math_tan     : tty->print("java_lang_math_tan"     ); break;
 335     case java_lang_math_abs     : tty->print("java_lang_math_abs"     ); break;
 336     case java_lang_math_sqrt    : tty->print("java_lang_math_sqrt"    ); break;
 337     case java_lang_math_log     : tty->print("java_lang_math_log"     ); break;
 338     case java_lang_math_log10   : tty->print("java_lang_math_log10"   ); break;
 339     case java_util_zip_CRC32_update           : tty->print("java_util_zip_CRC32_update"); break;
 340     case java_util_zip_CRC32_updateBytes      : tty->print("java_util_zip_CRC32_updateBytes"); break;
 341     case java_util_zip_CRC32_updateByteBuffer : tty->print("java_util_zip_CRC32_updateByteBuffer"); break;


 342     default:
 343       if (kind >= method_handle_invoke_FIRST &&
 344           kind <= method_handle_invoke_LAST) {
 345         const char* kind_name = vmIntrinsics::name_at(method_handle_intrinsic(kind));
 346         if (kind_name[0] == '_')  kind_name = &kind_name[1];  // '_invokeExact' => 'invokeExact'
 347         tty->print("method_handle_%s", kind_name);
 348         break;
 349       }
 350       ShouldNotReachHere();
 351       break;
 352   }
 353 }
 354 #endif // PRODUCT
 355 
 356 
 357 //------------------------------------------------------------------------------------------------------------------------
 358 // Deoptimization support
 359 
 360 /**
 361  * If a deoptimization happens, this function returns the point of next bytecode to continue execution.


 540   case Interpreter::abstract               : entry_point = generate_abstract_entry();    break;
 541 
 542   case Interpreter::java_lang_math_sin     : // fall thru
 543   case Interpreter::java_lang_math_cos     : // fall thru
 544   case Interpreter::java_lang_math_tan     : // fall thru
 545   case Interpreter::java_lang_math_abs     : // fall thru
 546   case Interpreter::java_lang_math_log     : // fall thru
 547   case Interpreter::java_lang_math_log10   : // fall thru
 548   case Interpreter::java_lang_math_sqrt    : // fall thru
 549   case Interpreter::java_lang_math_pow     : // fall thru
 550   case Interpreter::java_lang_math_exp     : entry_point = generate_math_entry(kind);      break;
 551   case Interpreter::java_lang_ref_reference_get
 552                                            : entry_point = generate_Reference_get_entry(); break;
 553 #ifndef CC_INTERP
 554   case Interpreter::java_util_zip_CRC32_update
 555                                            : entry_point = generate_CRC32_update_entry();  break;
 556   case Interpreter::java_util_zip_CRC32_updateBytes
 557                                            : // fall thru
 558   case Interpreter::java_util_zip_CRC32_updateByteBuffer
 559                                            : entry_point = generate_CRC32_updateBytes_entry(kind); break;





 560 #endif // CC_INTERP
 561   default:
 562     fatal(err_msg("unexpected method kind: %d", kind));
 563     break;
 564   }
 565 
 566   if (entry_point) {
 567     return entry_point;
 568   }
 569 
 570   return generate_normal_entry(synchronized);
 571 }


 215 
 216   // Method handle primitive?
 217   if (m->is_method_handle_intrinsic()) {
 218     vmIntrinsics::ID id = m->intrinsic_id();
 219     assert(MethodHandles::is_signature_polymorphic(id), "must match an intrinsic");
 220     MethodKind kind = (MethodKind)( method_handle_invoke_FIRST +
 221                                     ((int)id - vmIntrinsics::FIRST_MH_SIG_POLY) );
 222     assert(kind <= method_handle_invoke_LAST, "parallel enum ranges");
 223     return kind;
 224   }
 225 
 226 #ifndef CC_INTERP
 227   if (UseCRC32Intrinsics && m->is_native()) {
 228     // Use optimized stub code for CRC32 native methods.
 229     switch (m->intrinsic_id()) {
 230       case vmIntrinsics::_updateCRC32            : return java_util_zip_CRC32_update;
 231       case vmIntrinsics::_updateBytesCRC32       : return java_util_zip_CRC32_updateBytes;
 232       case vmIntrinsics::_updateByteBufferCRC32  : return java_util_zip_CRC32_updateByteBuffer;
 233     }
 234   }
 235   if (UseCRC32CIntrinsics) {
 236     // Use optimized stub code for CRC32C methods.
 237     switch (m->intrinsic_id()) {
 238       case vmIntrinsics::_updateBytesCRC32C             : return java_util_zip_CRC32C_updateBytes;
 239       case vmIntrinsics::_updateDirectByteBufferCRC32C  : return java_util_zip_CRC32C_updateDirectByteBuffer;
 240     }
 241   }
 242 #endif
 243 
 244   // Native method?
 245   // Note: This test must come _before_ the test for intrinsic
 246   //       methods. See also comments below.
 247   if (m->is_native()) {
 248     assert(!m->is_method_handle_intrinsic(), "overlapping bits here, watch out");
 249     return m->is_synchronized() ? native_synchronized : native;
 250   }
 251 
 252   // Synchronized?
 253   if (m->is_synchronized()) {
 254     return zerolocals_synchronized;
 255   }
 256 
 257   if (RegisterFinalizersAtInit && m->code_size() == 1 &&
 258       m->intrinsic_id() == vmIntrinsics::_Object_init) {
 259     // We need to execute the special return bytecode to check for
 260     // finalizer registration so create a normal frame.
 261     return zerolocals;


 329 #ifndef PRODUCT
 330 void AbstractInterpreter::print_method_kind(MethodKind kind) {
 331   switch (kind) {
 332     case zerolocals             : tty->print("zerolocals"             ); break;
 333     case zerolocals_synchronized: tty->print("zerolocals_synchronized"); break;
 334     case native                 : tty->print("native"                 ); break;
 335     case native_synchronized    : tty->print("native_synchronized"    ); break;
 336     case empty                  : tty->print("empty"                  ); break;
 337     case accessor               : tty->print("accessor"               ); break;
 338     case abstract               : tty->print("abstract"               ); break;
 339     case java_lang_math_sin     : tty->print("java_lang_math_sin"     ); break;
 340     case java_lang_math_cos     : tty->print("java_lang_math_cos"     ); break;
 341     case java_lang_math_tan     : tty->print("java_lang_math_tan"     ); break;
 342     case java_lang_math_abs     : tty->print("java_lang_math_abs"     ); break;
 343     case java_lang_math_sqrt    : tty->print("java_lang_math_sqrt"    ); break;
 344     case java_lang_math_log     : tty->print("java_lang_math_log"     ); break;
 345     case java_lang_math_log10   : tty->print("java_lang_math_log10"   ); break;
 346     case java_util_zip_CRC32_update           : tty->print("java_util_zip_CRC32_update"); break;
 347     case java_util_zip_CRC32_updateBytes      : tty->print("java_util_zip_CRC32_updateBytes"); break;
 348     case java_util_zip_CRC32_updateByteBuffer : tty->print("java_util_zip_CRC32_updateByteBuffer"); break;
 349     case java_util_zip_CRC32C_updateBytes     : tty->print("java_util_zip_CRC32C_updateBytes"); break;
 350     case java_util_zip_CRC32C_updateDirectByteBuffer: tty->print("java_util_zip_CRC32C_updateDirectByteByffer"); break;
 351     default:
 352       if (kind >= method_handle_invoke_FIRST &&
 353           kind <= method_handle_invoke_LAST) {
 354         const char* kind_name = vmIntrinsics::name_at(method_handle_intrinsic(kind));
 355         if (kind_name[0] == '_')  kind_name = &kind_name[1];  // '_invokeExact' => 'invokeExact'
 356         tty->print("method_handle_%s", kind_name);
 357         break;
 358       }
 359       ShouldNotReachHere();
 360       break;
 361   }
 362 }
 363 #endif // PRODUCT
 364 
 365 
 366 //------------------------------------------------------------------------------------------------------------------------
 367 // Deoptimization support
 368 
 369 /**
 370  * If a deoptimization happens, this function returns the point of next bytecode to continue execution.


 549   case Interpreter::abstract               : entry_point = generate_abstract_entry();    break;
 550 
 551   case Interpreter::java_lang_math_sin     : // fall thru
 552   case Interpreter::java_lang_math_cos     : // fall thru
 553   case Interpreter::java_lang_math_tan     : // fall thru
 554   case Interpreter::java_lang_math_abs     : // fall thru
 555   case Interpreter::java_lang_math_log     : // fall thru
 556   case Interpreter::java_lang_math_log10   : // fall thru
 557   case Interpreter::java_lang_math_sqrt    : // fall thru
 558   case Interpreter::java_lang_math_pow     : // fall thru
 559   case Interpreter::java_lang_math_exp     : entry_point = generate_math_entry(kind);      break;
 560   case Interpreter::java_lang_ref_reference_get
 561                                            : entry_point = generate_Reference_get_entry(); break;
 562 #ifndef CC_INTERP
 563   case Interpreter::java_util_zip_CRC32_update
 564                                            : entry_point = generate_CRC32_update_entry();  break;
 565   case Interpreter::java_util_zip_CRC32_updateBytes
 566                                            : // fall thru
 567   case Interpreter::java_util_zip_CRC32_updateByteBuffer
 568                                            : entry_point = generate_CRC32_updateBytes_entry(kind); break;
 569   case Interpreter::java_util_zip_CRC32C_updateBytes
 570                                            : // fall thru
 571   case Interpreter::java_util_zip_CRC32C_updateDirectByteBuffer
 572                                            : entry_point = generate_CRC32C_updateBytes_entry(kind); break;
 573     
 574 #endif // CC_INTERP
 575   default:
 576     fatal(err_msg("unexpected method kind: %d", kind));
 577     break;
 578   }
 579 
 580   if (entry_point) {
 581     return entry_point;
 582   }
 583 
 584   return generate_normal_entry(synchronized);
 585 }
< prev index next >