< prev index next >

src/hotspot/share/interpreter/abstractInterpreter.cpp

Print this page


   1 /*
   2  * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.

   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 171   //       TemplateInterpreterGenerator::generate_method_entry() for
 172   //       for details.
 173   switch (m->intrinsic_id()) {
 174     case vmIntrinsics::_dsin  : return java_lang_math_sin  ;
 175     case vmIntrinsics::_dcos  : return java_lang_math_cos  ;
 176     case vmIntrinsics::_dtan  : return java_lang_math_tan  ;
 177     case vmIntrinsics::_dabs  : return java_lang_math_abs  ;
 178     case vmIntrinsics::_dsqrt : return java_lang_math_sqrt ;
 179     case vmIntrinsics::_dlog  : return java_lang_math_log  ;
 180     case vmIntrinsics::_dlog10: return java_lang_math_log10;
 181     case vmIntrinsics::_dpow  : return java_lang_math_pow  ;
 182     case vmIntrinsics::_dexp  : return java_lang_math_exp  ;
 183     case vmIntrinsics::_fmaD  : return java_lang_math_fmaD ;
 184     case vmIntrinsics::_fmaF  : return java_lang_math_fmaF ;
 185 
 186     case vmIntrinsics::_Reference_get
 187                               : return java_lang_ref_reference_get;
 188     default                   : break;
 189   }
 190 































 191   // Accessor method?
 192   if (m->is_getter()) {
 193     // TODO: We should have used ::is_accessor above, but fast accessors in Zero expect only getters.
 194     // See CppInterpreter::accessor_entry in cppInterpreter_zero.cpp. This should be fixed in Zero,
 195     // then the call above updated to ::is_accessor
 196     assert(m->size_of_parameters() == 1, "fast code for accessors assumes parameter size = 1");
 197     return accessor;
 198   }
 199 
 200   // Note: for now: zero locals for all non-empty methods
 201   return zerolocals;
 202 }
 203 
 204 #if INCLUDE_CDS
 205 
 206 address AbstractInterpreter::get_trampoline_code_buffer(AbstractInterpreter::MethodKind kind) {
 207   const size_t trampoline_size = SharedRuntime::trampoline_size();
 208   address addr = MetaspaceShared::cds_i2i_entry_code_buffers((size_t)(AbstractInterpreter::number_of_method_entries) * trampoline_size);
 209   addr += (size_t)(kind) * trampoline_size;
 210 


 265     case zerolocals_synchronized: tty->print("zerolocals_synchronized"); break;
 266     case native                 : tty->print("native"                 ); break;
 267     case native_synchronized    : tty->print("native_synchronized"    ); break;
 268     case empty                  : tty->print("empty"                  ); break;
 269     case accessor               : tty->print("accessor"               ); break;
 270     case abstract               : tty->print("abstract"               ); break;
 271     case java_lang_math_sin     : tty->print("java_lang_math_sin"     ); break;
 272     case java_lang_math_cos     : tty->print("java_lang_math_cos"     ); break;
 273     case java_lang_math_tan     : tty->print("java_lang_math_tan"     ); break;
 274     case java_lang_math_abs     : tty->print("java_lang_math_abs"     ); break;
 275     case java_lang_math_sqrt    : tty->print("java_lang_math_sqrt"    ); break;
 276     case java_lang_math_log     : tty->print("java_lang_math_log"     ); break;
 277     case java_lang_math_log10   : tty->print("java_lang_math_log10"   ); break;
 278     case java_lang_math_fmaD    : tty->print("java_lang_math_fmaD"    ); break;
 279     case java_lang_math_fmaF    : tty->print("java_lang_math_fmaF"    ); break;
 280     case java_util_zip_CRC32_update           : tty->print("java_util_zip_CRC32_update"); break;
 281     case java_util_zip_CRC32_updateBytes      : tty->print("java_util_zip_CRC32_updateBytes"); break;
 282     case java_util_zip_CRC32_updateByteBuffer : tty->print("java_util_zip_CRC32_updateByteBuffer"); break;
 283     case java_util_zip_CRC32C_updateBytes     : tty->print("java_util_zip_CRC32C_updateBytes"); break;
 284     case java_util_zip_CRC32C_updateDirectByteBuffer: tty->print("java_util_zip_CRC32C_updateDirectByteByffer"); break;









 285     default:
 286       if (kind >= method_handle_invoke_FIRST &&
 287           kind <= method_handle_invoke_LAST) {
 288         const char* kind_name = vmIntrinsics::name_at(method_handle_intrinsic(kind));
 289         if (kind_name[0] == '_')  kind_name = &kind_name[1];  // '_invokeExact' => 'invokeExact'
 290         tty->print("method_handle_%s", kind_name);
 291         break;
 292       }
 293       ShouldNotReachHere();
 294       break;
 295   }
 296 }
 297 #endif // PRODUCT
 298 
 299 
 300 //------------------------------------------------------------------------------------------------------------------------
 301 // Deoptimization support
 302 
 303 /**
 304  * If a deoptimization happens, this function returns the point of next bytecode to continue execution.


   1 /*
   2  * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * Copyright (c) 2015-2018, Azul Systems, Inc. All rights reserved.
   4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5  *
   6  * This code is free software; you can redistribute it and/or modify it
   7  * under the terms of the GNU General Public License version 2 only, as
   8  * published by the Free Software Foundation.
   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  *


 172   //       TemplateInterpreterGenerator::generate_method_entry() for
 173   //       for details.
 174   switch (m->intrinsic_id()) {
 175     case vmIntrinsics::_dsin  : return java_lang_math_sin  ;
 176     case vmIntrinsics::_dcos  : return java_lang_math_cos  ;
 177     case vmIntrinsics::_dtan  : return java_lang_math_tan  ;
 178     case vmIntrinsics::_dabs  : return java_lang_math_abs  ;
 179     case vmIntrinsics::_dsqrt : return java_lang_math_sqrt ;
 180     case vmIntrinsics::_dlog  : return java_lang_math_log  ;
 181     case vmIntrinsics::_dlog10: return java_lang_math_log10;
 182     case vmIntrinsics::_dpow  : return java_lang_math_pow  ;
 183     case vmIntrinsics::_dexp  : return java_lang_math_exp  ;
 184     case vmIntrinsics::_fmaD  : return java_lang_math_fmaD ;
 185     case vmIntrinsics::_fmaF  : return java_lang_math_fmaF ;
 186 
 187     case vmIntrinsics::_Reference_get
 188                               : return java_lang_ref_reference_get;
 189     default                   : break;
 190   }
 191 
 192 #ifdef AARCH32
 193   if (UseAESIntrinsics) {
 194     // Use optimized stub code for AES native methods.
 195     switch (m->intrinsic_id()) {
 196     case vmIntrinsics::_aescrypt_encryptBlock  : return com_sun_crypto_provider_AESCrypt_encryptBlock;
 197     case vmIntrinsics::_aescrypt_decryptBlock  : return com_sun_crypto_provider_AESCrypt_decryptBlock;
 198     }
 199     // Use optimized stub code for AES CBC native methods.
 200     if (StubRoutines::cipherBlockChaining_encryptAESCrypt_special() &&
 201         m->intrinsic_id() == vmIntrinsics::_cipherBlockChaining_encryptAESCrypt)
 202       return com_sun_crypto_provider_CipherBlockChaining_encrypt;
 203 
 204     if (StubRoutines::cipherBlockChaining_decryptAESCrypt_special() &&
 205         m->intrinsic_id() == vmIntrinsics::_cipherBlockChaining_decryptAESCrypt)
 206       return com_sun_crypto_provider_CipherBlockChaining_decrypt;
 207   }
 208 
 209   // Use optimized stub code for SHA256/512 native methods.
 210   switch (m->intrinsic_id()) {
 211   case vmIntrinsics::_sha_implCompress :
 212     if (UseSHA1Intrinsics) return sun_security_provider_SHA_implCompress;
 213     break;
 214   case vmIntrinsics::_sha2_implCompress :
 215     if (UseSHA256Intrinsics) return sun_security_provider_SHA2_implCompress;
 216     break;
 217   case vmIntrinsics::_sha5_implCompress :
 218     if (UseSHA512Intrinsics) return sun_security_provider_SHA5_implCompress;
 219     break;
 220   }
 221 #endif
 222 
 223   // Accessor method?
 224   if (m->is_getter()) {
 225     // TODO: We should have used ::is_accessor above, but fast accessors in Zero expect only getters.
 226     // See CppInterpreter::accessor_entry in cppInterpreter_zero.cpp. This should be fixed in Zero,
 227     // then the call above updated to ::is_accessor
 228     assert(m->size_of_parameters() == 1, "fast code for accessors assumes parameter size = 1");
 229     return accessor;
 230   }
 231 
 232   // Note: for now: zero locals for all non-empty methods
 233   return zerolocals;
 234 }
 235 
 236 #if INCLUDE_CDS
 237 
 238 address AbstractInterpreter::get_trampoline_code_buffer(AbstractInterpreter::MethodKind kind) {
 239   const size_t trampoline_size = SharedRuntime::trampoline_size();
 240   address addr = MetaspaceShared::cds_i2i_entry_code_buffers((size_t)(AbstractInterpreter::number_of_method_entries) * trampoline_size);
 241   addr += (size_t)(kind) * trampoline_size;
 242 


 297     case zerolocals_synchronized: tty->print("zerolocals_synchronized"); break;
 298     case native                 : tty->print("native"                 ); break;
 299     case native_synchronized    : tty->print("native_synchronized"    ); break;
 300     case empty                  : tty->print("empty"                  ); break;
 301     case accessor               : tty->print("accessor"               ); break;
 302     case abstract               : tty->print("abstract"               ); break;
 303     case java_lang_math_sin     : tty->print("java_lang_math_sin"     ); break;
 304     case java_lang_math_cos     : tty->print("java_lang_math_cos"     ); break;
 305     case java_lang_math_tan     : tty->print("java_lang_math_tan"     ); break;
 306     case java_lang_math_abs     : tty->print("java_lang_math_abs"     ); break;
 307     case java_lang_math_sqrt    : tty->print("java_lang_math_sqrt"    ); break;
 308     case java_lang_math_log     : tty->print("java_lang_math_log"     ); break;
 309     case java_lang_math_log10   : tty->print("java_lang_math_log10"   ); break;
 310     case java_lang_math_fmaD    : tty->print("java_lang_math_fmaD"    ); break;
 311     case java_lang_math_fmaF    : tty->print("java_lang_math_fmaF"    ); break;
 312     case java_util_zip_CRC32_update           : tty->print("java_util_zip_CRC32_update"); break;
 313     case java_util_zip_CRC32_updateBytes      : tty->print("java_util_zip_CRC32_updateBytes"); break;
 314     case java_util_zip_CRC32_updateByteBuffer : tty->print("java_util_zip_CRC32_updateByteBuffer"); break;
 315     case java_util_zip_CRC32C_updateBytes     : tty->print("java_util_zip_CRC32C_updateBytes"); break;
 316     case java_util_zip_CRC32C_updateDirectByteBuffer: tty->print("java_util_zip_CRC32C_updateDirectByteByffer"); break;
 317 #ifdef AARCH32
 318     case com_sun_crypto_provider_AESCrypt_encryptBlock : tty->print("com_sun_crypto_provider_AESCrypt_encryptBlock"); break;
 319     case com_sun_crypto_provider_AESCrypt_decryptBlock : tty->print("com_sun_crypto_provider_AESCrypt_decryptBlock"); break;
 320     case com_sun_crypto_provider_CipherBlockChaining_encrypt : tty->print("com_sun_crypto_provider_CipherBlockChaining_encrypt"); break;
 321     case com_sun_crypto_provider_CipherBlockChaining_decrypt : tty->print("com_sun_crypto_provider_CipherBlockChaining_decrypt"); break;
 322     case sun_security_provider_SHA_implCompress : tty->print("sun_security_provider_SHA_implCompress"); break;
 323     case sun_security_provider_SHA2_implCompress : tty->print("sun_security_provider_SHA2_implCompress"); break;
 324     case sun_security_provider_SHA5_implCompress : tty->print("sun_security_provider_SHA5_implCompress"); break;
 325 #endif
 326     default:
 327       if (kind >= method_handle_invoke_FIRST &&
 328           kind <= method_handle_invoke_LAST) {
 329         const char* kind_name = vmIntrinsics::name_at(method_handle_intrinsic(kind));
 330         if (kind_name[0] == '_')  kind_name = &kind_name[1];  // '_invokeExact' => 'invokeExact'
 331         tty->print("method_handle_%s", kind_name);
 332         break;
 333       }
 334       ShouldNotReachHere();
 335       break;
 336   }
 337 }
 338 #endif // PRODUCT
 339 
 340 
 341 //------------------------------------------------------------------------------------------------------------------------
 342 // Deoptimization support
 343 
 344 /**
 345  * If a deoptimization happens, this function returns the point of next bytecode to continue execution.


< prev index next >