1 /* 2 * Copyright (c) 1999, 2020, 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 * 23 */ 24 25 #include "precompiled.hpp" 26 #include "runtime/handles.inline.hpp" 27 #include "jfr/support/jfrIntrinsics.hpp" 28 #include "opto/c2compiler.hpp" 29 #include "opto/compile.hpp" 30 #include "opto/optoreg.hpp" 31 #include "opto/output.hpp" 32 #include "opto/runtime.hpp" 33 #include "utilities/macros.hpp" 34 35 36 // register information defined by ADLC 37 extern const char register_save_policy[]; 38 extern const int register_save_type[]; 39 40 const char* C2Compiler::retry_no_subsuming_loads() { 41 return "retry without subsuming loads"; 42 } 43 const char* C2Compiler::retry_no_escape_analysis() { 44 return "retry without escape analysis"; 45 } 46 const char* C2Compiler::retry_class_loading_during_parsing() { 47 return "retry class loading during parsing"; 48 } 49 bool C2Compiler::init_c2_runtime() { 50 51 // Check assumptions used while running ADLC 52 Compile::adlc_verification(); 53 assert(REG_COUNT <= ConcreteRegisterImpl::number_of_registers, "incompatible register counts"); 54 55 for (int i = 0; i < ConcreteRegisterImpl::number_of_registers ; i++ ) { 56 OptoReg::vm2opto[i] = OptoReg::Bad; 57 } 58 59 for( OptoReg::Name i=OptoReg::Name(0); i<OptoReg::Name(REG_COUNT); i = OptoReg::add(i,1) ) { 60 VMReg r = OptoReg::as_VMReg(i); 61 if (r->is_valid()) { 62 OptoReg::vm2opto[r->value()] = i; 63 } 64 } 65 66 DEBUG_ONLY( Node::init_NodeProperty(); ) 67 68 Compile::pd_compiler2_init(); 69 70 CompilerThread* thread = CompilerThread::current(); 71 72 HandleMark handle_mark(thread); 73 return OptoRuntime::generate(thread->env()); 74 } 75 76 void C2Compiler::initialize() { 77 assert(!is_c1_or_interpreter_only(), "C2 compiler is launched, it's not c1/interpreter only mode"); 78 // The first compiler thread that gets here will initialize the 79 // small amount of global state (and runtime stubs) that C2 needs. 80 81 // There is a race possible once at startup and then we're fine 82 83 // Note that this is being called from a compiler thread not the 84 // main startup thread. 85 if (should_perform_init()) { 86 bool successful = C2Compiler::init_c2_runtime(); 87 int new_state = (successful) ? initialized : failed; 88 set_state(new_state); 89 } 90 } 91 92 void C2Compiler::compile_method(ciEnv* env, ciMethod* target, int entry_bci, bool install_code, DirectiveSet* directive) { 93 assert(is_initialized(), "Compiler thread must be initialized"); 94 95 bool subsume_loads = SubsumeLoads; 96 bool do_escape_analysis = DoEscapeAnalysis && !env->should_retain_local_variables() 97 && !env->jvmti_can_get_owned_monitor_info(); 98 bool eliminate_boxing = EliminateAutoBox; 99 100 while (!env->failing()) { 101 // Attempt to compile while subsuming loads into machine instructions. 102 Compile C(env, target, entry_bci, subsume_loads, do_escape_analysis, eliminate_boxing, install_code, directive); 103 104 // Check result and retry if appropriate. 105 if (C.failure_reason() != NULL) { 106 if (C.failure_reason_is(retry_class_loading_during_parsing())) { 107 env->report_failure(C.failure_reason()); 108 continue; // retry 109 } 110 if (C.failure_reason_is(retry_no_subsuming_loads())) { 111 assert(subsume_loads, "must make progress"); 112 subsume_loads = false; 113 env->report_failure(C.failure_reason()); 114 continue; // retry 115 } 116 if (C.failure_reason_is(retry_no_escape_analysis())) { 117 assert(do_escape_analysis, "must make progress"); 118 do_escape_analysis = false; 119 env->report_failure(C.failure_reason()); 120 continue; // retry 121 } 122 if (C.has_boxed_value()) { 123 // Recompile without boxing elimination regardless failure reason. 124 assert(eliminate_boxing, "must make progress"); 125 eliminate_boxing = false; 126 env->report_failure(C.failure_reason()); 127 continue; // retry 128 } 129 // Pass any other failure reason up to the ciEnv. 130 // Note that serious, irreversible failures are already logged 131 // on the ciEnv via env->record_method_not_compilable(). 132 env->record_failure(C.failure_reason()); 133 } 134 if (StressRecompilation) { 135 if (subsume_loads) { 136 subsume_loads = false; 137 continue; // retry 138 } 139 if (do_escape_analysis) { 140 do_escape_analysis = false; 141 continue; // retry 142 } 143 } 144 // print inlining for last compilation only 145 C.dump_print_inlining(); 146 147 // No retry; just break the loop. 148 break; 149 } 150 } 151 152 void C2Compiler::print_timers() { 153 Compile::print_timers(); 154 } 155 156 bool C2Compiler::is_intrinsic_supported(const methodHandle& method, bool is_virtual) { 157 vmIntrinsics::ID id = method->intrinsic_id(); 158 assert(id != vmIntrinsics::_none, "must be a VM intrinsic"); 159 160 if (id < vmIntrinsics::FIRST_ID || id > vmIntrinsics::LAST_COMPILER_INLINE) { 161 return false; 162 } 163 164 // Only Object.hashCode and Object.clone intrinsics implement also a virtual 165 // dispatch because calling both methods is expensive but both methods are 166 // frequently overridden. All other intrinsics implement only a non-virtual 167 // dispatch. 168 if (is_virtual) { 169 switch (id) { 170 case vmIntrinsics::_hashCode: 171 case vmIntrinsics::_clone: 172 break; 173 default: 174 return false; 175 } 176 } 177 178 switch (id) { 179 case vmIntrinsics::_compressStringC: 180 case vmIntrinsics::_compressStringB: 181 if (!Matcher::has_match_rule(Op_StrCompressedCopy)) return false; 182 break; 183 case vmIntrinsics::_inflateStringC: 184 case vmIntrinsics::_inflateStringB: 185 if (!Matcher::has_match_rule(Op_StrInflatedCopy)) return false; 186 break; 187 case vmIntrinsics::_compareToL: 188 case vmIntrinsics::_compareToU: 189 case vmIntrinsics::_compareToLU: 190 case vmIntrinsics::_compareToUL: 191 if (!Matcher::match_rule_supported(Op_StrComp)) return false; 192 break; 193 case vmIntrinsics::_equalsL: 194 case vmIntrinsics::_equalsU: 195 if (!Matcher::match_rule_supported(Op_StrEquals)) return false; 196 break; 197 case vmIntrinsics::_equalsB: 198 case vmIntrinsics::_equalsC: 199 if (!Matcher::match_rule_supported(Op_AryEq)) return false; 200 break; 201 case vmIntrinsics::_copyMemory: 202 if (StubRoutines::unsafe_arraycopy() == NULL) return false; 203 break; 204 case vmIntrinsics::_encodeISOArray: 205 case vmIntrinsics::_encodeByteISOArray: 206 if (!Matcher::match_rule_supported(Op_EncodeISOArray)) return false; 207 break; 208 case vmIntrinsics::_hasNegatives: 209 if (!Matcher::match_rule_supported(Op_HasNegatives)) return false; 210 break; 211 case vmIntrinsics::_bitCount_i: 212 if (!Matcher::match_rule_supported(Op_PopCountI)) return false; 213 break; 214 case vmIntrinsics::_bitCount_l: 215 if (!Matcher::match_rule_supported(Op_PopCountL)) return false; 216 break; 217 case vmIntrinsics::_numberOfLeadingZeros_i: 218 if (!Matcher::match_rule_supported(Op_CountLeadingZerosI)) return false; 219 break; 220 case vmIntrinsics::_numberOfLeadingZeros_l: 221 if (!Matcher::match_rule_supported(Op_CountLeadingZerosL)) return false; 222 break; 223 case vmIntrinsics::_numberOfTrailingZeros_i: 224 if (!Matcher::match_rule_supported(Op_CountTrailingZerosI)) return false; 225 break; 226 case vmIntrinsics::_numberOfTrailingZeros_l: 227 if (!Matcher::match_rule_supported(Op_CountTrailingZerosL)) return false; 228 break; 229 case vmIntrinsics::_reverseBytes_c: 230 if (!Matcher::match_rule_supported(Op_ReverseBytesUS)) return false; 231 break; 232 case vmIntrinsics::_reverseBytes_s: 233 if (!Matcher::match_rule_supported(Op_ReverseBytesS)) return false; 234 break; 235 case vmIntrinsics::_reverseBytes_i: 236 if (!Matcher::match_rule_supported(Op_ReverseBytesI)) return false; 237 break; 238 case vmIntrinsics::_reverseBytes_l: 239 if (!Matcher::match_rule_supported(Op_ReverseBytesL)) return false; 240 break; 241 242 /* CompareAndSet, Object: */ 243 case vmIntrinsics::_compareAndSetReference: 244 #ifdef _LP64 245 if ( UseCompressedOops && !Matcher::match_rule_supported(Op_CompareAndSwapN)) return false; 246 if (!UseCompressedOops && !Matcher::match_rule_supported(Op_CompareAndSwapP)) return false; 247 #else 248 if (!Matcher::match_rule_supported(Op_CompareAndSwapP)) return false; 249 #endif 250 break; 251 case vmIntrinsics::_weakCompareAndSetReferencePlain: 252 case vmIntrinsics::_weakCompareAndSetReferenceAcquire: 253 case vmIntrinsics::_weakCompareAndSetReferenceRelease: 254 case vmIntrinsics::_weakCompareAndSetReference: 255 #ifdef _LP64 256 if ( UseCompressedOops && !Matcher::match_rule_supported(Op_WeakCompareAndSwapN)) return false; 257 if (!UseCompressedOops && !Matcher::match_rule_supported(Op_WeakCompareAndSwapP)) return false; 258 #else 259 if (!Matcher::match_rule_supported(Op_WeakCompareAndSwapP)) return false; 260 #endif 261 break; 262 /* CompareAndSet, Long: */ 263 case vmIntrinsics::_compareAndSetLong: 264 if (!Matcher::match_rule_supported(Op_CompareAndSwapL)) return false; 265 break; 266 case vmIntrinsics::_weakCompareAndSetLongPlain: 267 case vmIntrinsics::_weakCompareAndSetLongAcquire: 268 case vmIntrinsics::_weakCompareAndSetLongRelease: 269 case vmIntrinsics::_weakCompareAndSetLong: 270 if (!Matcher::match_rule_supported(Op_WeakCompareAndSwapL)) return false; 271 break; 272 273 /* CompareAndSet, Int: */ 274 case vmIntrinsics::_compareAndSetInt: 275 if (!Matcher::match_rule_supported(Op_CompareAndSwapI)) return false; 276 break; 277 case vmIntrinsics::_weakCompareAndSetIntPlain: 278 case vmIntrinsics::_weakCompareAndSetIntAcquire: 279 case vmIntrinsics::_weakCompareAndSetIntRelease: 280 case vmIntrinsics::_weakCompareAndSetInt: 281 if (!Matcher::match_rule_supported(Op_WeakCompareAndSwapI)) return false; 282 break; 283 284 /* CompareAndSet, Byte: */ 285 case vmIntrinsics::_compareAndSetByte: 286 if (!Matcher::match_rule_supported(Op_CompareAndSwapB)) return false; 287 break; 288 case vmIntrinsics::_weakCompareAndSetBytePlain: 289 case vmIntrinsics::_weakCompareAndSetByteAcquire: 290 case vmIntrinsics::_weakCompareAndSetByteRelease: 291 case vmIntrinsics::_weakCompareAndSetByte: 292 if (!Matcher::match_rule_supported(Op_WeakCompareAndSwapB)) return false; 293 break; 294 295 /* CompareAndSet, Short: */ 296 case vmIntrinsics::_compareAndSetShort: 297 if (!Matcher::match_rule_supported(Op_CompareAndSwapS)) return false; 298 break; 299 case vmIntrinsics::_weakCompareAndSetShortPlain: 300 case vmIntrinsics::_weakCompareAndSetShortAcquire: 301 case vmIntrinsics::_weakCompareAndSetShortRelease: 302 case vmIntrinsics::_weakCompareAndSetShort: 303 if (!Matcher::match_rule_supported(Op_WeakCompareAndSwapS)) return false; 304 break; 305 306 /* CompareAndExchange, Object: */ 307 case vmIntrinsics::_compareAndExchangeReference: 308 case vmIntrinsics::_compareAndExchangeReferenceAcquire: 309 case vmIntrinsics::_compareAndExchangeReferenceRelease: 310 #ifdef _LP64 311 if ( UseCompressedOops && !Matcher::match_rule_supported(Op_CompareAndExchangeN)) return false; 312 if (!UseCompressedOops && !Matcher::match_rule_supported(Op_CompareAndExchangeP)) return false; 313 #else 314 if (!Matcher::match_rule_supported(Op_CompareAndExchangeP)) return false; 315 #endif 316 break; 317 318 /* CompareAndExchange, Long: */ 319 case vmIntrinsics::_compareAndExchangeLong: 320 case vmIntrinsics::_compareAndExchangeLongAcquire: 321 case vmIntrinsics::_compareAndExchangeLongRelease: 322 if (!Matcher::match_rule_supported(Op_CompareAndExchangeL)) return false; 323 break; 324 325 /* CompareAndExchange, Int: */ 326 case vmIntrinsics::_compareAndExchangeInt: 327 case vmIntrinsics::_compareAndExchangeIntAcquire: 328 case vmIntrinsics::_compareAndExchangeIntRelease: 329 if (!Matcher::match_rule_supported(Op_CompareAndExchangeI)) return false; 330 break; 331 332 /* CompareAndExchange, Byte: */ 333 case vmIntrinsics::_compareAndExchangeByte: 334 case vmIntrinsics::_compareAndExchangeByteAcquire: 335 case vmIntrinsics::_compareAndExchangeByteRelease: 336 if (!Matcher::match_rule_supported(Op_CompareAndExchangeB)) return false; 337 break; 338 339 /* CompareAndExchange, Short: */ 340 case vmIntrinsics::_compareAndExchangeShort: 341 case vmIntrinsics::_compareAndExchangeShortAcquire: 342 case vmIntrinsics::_compareAndExchangeShortRelease: 343 if (!Matcher::match_rule_supported(Op_CompareAndExchangeS)) return false; 344 break; 345 346 case vmIntrinsics::_getAndAddByte: 347 if (!Matcher::match_rule_supported(Op_GetAndAddB)) return false; 348 break; 349 case vmIntrinsics::_getAndAddShort: 350 if (!Matcher::match_rule_supported(Op_GetAndAddS)) return false; 351 break; 352 case vmIntrinsics::_getAndAddInt: 353 if (!Matcher::match_rule_supported(Op_GetAndAddI)) return false; 354 break; 355 case vmIntrinsics::_getAndAddLong: 356 if (!Matcher::match_rule_supported(Op_GetAndAddL)) return false; 357 break; 358 359 case vmIntrinsics::_getAndSetByte: 360 if (!Matcher::match_rule_supported(Op_GetAndSetB)) return false; 361 break; 362 case vmIntrinsics::_getAndSetShort: 363 if (!Matcher::match_rule_supported(Op_GetAndSetS)) return false; 364 break; 365 case vmIntrinsics::_getAndSetInt: 366 if (!Matcher::match_rule_supported(Op_GetAndSetI)) return false; 367 break; 368 case vmIntrinsics::_getAndSetLong: 369 if (!Matcher::match_rule_supported(Op_GetAndSetL)) return false; 370 break; 371 case vmIntrinsics::_getAndSetReference: 372 #ifdef _LP64 373 if (!UseCompressedOops && !Matcher::match_rule_supported(Op_GetAndSetP)) return false; 374 if (UseCompressedOops && !Matcher::match_rule_supported(Op_GetAndSetN)) return false; 375 break; 376 #else 377 if (!Matcher::match_rule_supported(Op_GetAndSetP)) return false; 378 break; 379 #endif 380 case vmIntrinsics::_incrementExactI: 381 case vmIntrinsics::_addExactI: 382 if (!Matcher::match_rule_supported(Op_OverflowAddI)) return false; 383 break; 384 case vmIntrinsics::_incrementExactL: 385 case vmIntrinsics::_addExactL: 386 if (!Matcher::match_rule_supported(Op_OverflowAddL)) return false; 387 break; 388 case vmIntrinsics::_decrementExactI: 389 case vmIntrinsics::_subtractExactI: 390 if (!Matcher::match_rule_supported(Op_OverflowSubI)) return false; 391 break; 392 case vmIntrinsics::_decrementExactL: 393 case vmIntrinsics::_subtractExactL: 394 if (!Matcher::match_rule_supported(Op_OverflowSubL)) return false; 395 break; 396 case vmIntrinsics::_negateExactI: 397 if (!Matcher::match_rule_supported(Op_OverflowSubI)) return false; 398 break; 399 case vmIntrinsics::_negateExactL: 400 if (!Matcher::match_rule_supported(Op_OverflowSubL)) return false; 401 break; 402 case vmIntrinsics::_multiplyExactI: 403 if (!Matcher::match_rule_supported(Op_OverflowMulI)) return false; 404 break; 405 case vmIntrinsics::_multiplyExactL: 406 if (!Matcher::match_rule_supported(Op_OverflowMulL)) return false; 407 break; 408 case vmIntrinsics::_multiplyHigh: 409 if (!Matcher::match_rule_supported(Op_MulHiL)) return false; 410 break; 411 case vmIntrinsics::_getCallerClass: 412 if (SystemDictionary::reflect_CallerSensitive_klass() == NULL) return false; 413 break; 414 case vmIntrinsics::_onSpinWait: 415 if (!Matcher::match_rule_supported(Op_OnSpinWait)) return false; 416 break; 417 case vmIntrinsics::_fmaD: 418 if (!UseFMA || !Matcher::match_rule_supported(Op_FmaD)) return false; 419 break; 420 case vmIntrinsics::_fmaF: 421 if (!UseFMA || !Matcher::match_rule_supported(Op_FmaF)) return false; 422 break; 423 case vmIntrinsics::_isDigit: 424 if (!Matcher::match_rule_supported(Op_Digit)) return false; 425 break; 426 case vmIntrinsics::_isLowerCase: 427 if (!Matcher::match_rule_supported(Op_LowerCase)) return false; 428 break; 429 case vmIntrinsics::_isUpperCase: 430 if (!Matcher::match_rule_supported(Op_UpperCase)) return false; 431 break; 432 case vmIntrinsics::_isWhitespace: 433 if (!Matcher::match_rule_supported(Op_Whitespace)) return false; 434 break; 435 case vmIntrinsics::_maxF: 436 if (!Matcher::match_rule_supported(Op_MaxF)) return false; 437 break; 438 case vmIntrinsics::_minF: 439 if (!Matcher::match_rule_supported(Op_MinF)) return false; 440 break; 441 case vmIntrinsics::_maxD: 442 if (!Matcher::match_rule_supported(Op_MaxD)) return false; 443 break; 444 case vmIntrinsics::_minD: 445 if (!Matcher::match_rule_supported(Op_MinD)) return false; 446 break; 447 case vmIntrinsics::_writeback0: 448 if (!Matcher::match_rule_supported(Op_CacheWB)) return false; 449 break; 450 case vmIntrinsics::_writebackPreSync0: 451 if (!Matcher::match_rule_supported(Op_CacheWBPreSync)) return false; 452 break; 453 case vmIntrinsics::_writebackPostSync0: 454 if (!Matcher::match_rule_supported(Op_CacheWBPostSync)) return false; 455 break; 456 case vmIntrinsics::_rint: 457 case vmIntrinsics::_ceil: 458 case vmIntrinsics::_floor: 459 if (!Matcher::match_rule_supported(Op_RoundDoubleMode)) return false; 460 break; 461 case vmIntrinsics::_hashCode: 462 case vmIntrinsics::_identityHashCode: 463 case vmIntrinsics::_getClass: 464 case vmIntrinsics::_dsin: 465 case vmIntrinsics::_dcos: 466 case vmIntrinsics::_dtan: 467 case vmIntrinsics::_dabs: 468 case vmIntrinsics::_fabs: 469 case vmIntrinsics::_iabs: 470 case vmIntrinsics::_labs: 471 case vmIntrinsics::_datan2: 472 case vmIntrinsics::_dsqrt: 473 case vmIntrinsics::_dexp: 474 case vmIntrinsics::_dlog: 475 case vmIntrinsics::_dlog10: 476 case vmIntrinsics::_dpow: 477 case vmIntrinsics::_min: 478 case vmIntrinsics::_max: 479 case vmIntrinsics::_arraycopy: 480 case vmIntrinsics::_indexOfL: 481 case vmIntrinsics::_indexOfU: 482 case vmIntrinsics::_indexOfUL: 483 case vmIntrinsics::_indexOfIL: 484 case vmIntrinsics::_indexOfIU: 485 case vmIntrinsics::_indexOfIUL: 486 case vmIntrinsics::_indexOfU_char: 487 case vmIntrinsics::_toBytesStringU: 488 case vmIntrinsics::_getCharsStringU: 489 case vmIntrinsics::_getCharStringU: 490 case vmIntrinsics::_putCharStringU: 491 case vmIntrinsics::_getReference: 492 case vmIntrinsics::_getBoolean: 493 case vmIntrinsics::_getByte: 494 case vmIntrinsics::_getShort: 495 case vmIntrinsics::_getChar: 496 case vmIntrinsics::_getInt: 497 case vmIntrinsics::_getLong: 498 case vmIntrinsics::_getFloat: 499 case vmIntrinsics::_getDouble: 500 case vmIntrinsics::_putReference: 501 case vmIntrinsics::_putBoolean: 502 case vmIntrinsics::_putByte: 503 case vmIntrinsics::_putShort: 504 case vmIntrinsics::_putChar: 505 case vmIntrinsics::_putInt: 506 case vmIntrinsics::_putLong: 507 case vmIntrinsics::_putFloat: 508 case vmIntrinsics::_putDouble: 509 case vmIntrinsics::_getReferenceVolatile: 510 case vmIntrinsics::_getBooleanVolatile: 511 case vmIntrinsics::_getByteVolatile: 512 case vmIntrinsics::_getShortVolatile: 513 case vmIntrinsics::_getCharVolatile: 514 case vmIntrinsics::_getIntVolatile: 515 case vmIntrinsics::_getLongVolatile: 516 case vmIntrinsics::_getFloatVolatile: 517 case vmIntrinsics::_getDoubleVolatile: 518 case vmIntrinsics::_putReferenceVolatile: 519 case vmIntrinsics::_putBooleanVolatile: 520 case vmIntrinsics::_putByteVolatile: 521 case vmIntrinsics::_putShortVolatile: 522 case vmIntrinsics::_putCharVolatile: 523 case vmIntrinsics::_putIntVolatile: 524 case vmIntrinsics::_putLongVolatile: 525 case vmIntrinsics::_putFloatVolatile: 526 case vmIntrinsics::_putDoubleVolatile: 527 case vmIntrinsics::_getReferenceAcquire: 528 case vmIntrinsics::_getBooleanAcquire: 529 case vmIntrinsics::_getByteAcquire: 530 case vmIntrinsics::_getShortAcquire: 531 case vmIntrinsics::_getCharAcquire: 532 case vmIntrinsics::_getIntAcquire: 533 case vmIntrinsics::_getLongAcquire: 534 case vmIntrinsics::_getFloatAcquire: 535 case vmIntrinsics::_getDoubleAcquire: 536 case vmIntrinsics::_putReferenceRelease: 537 case vmIntrinsics::_putBooleanRelease: 538 case vmIntrinsics::_putByteRelease: 539 case vmIntrinsics::_putShortRelease: 540 case vmIntrinsics::_putCharRelease: 541 case vmIntrinsics::_putIntRelease: 542 case vmIntrinsics::_putLongRelease: 543 case vmIntrinsics::_putFloatRelease: 544 case vmIntrinsics::_putDoubleRelease: 545 case vmIntrinsics::_getReferenceOpaque: 546 case vmIntrinsics::_getBooleanOpaque: 547 case vmIntrinsics::_getByteOpaque: 548 case vmIntrinsics::_getShortOpaque: 549 case vmIntrinsics::_getCharOpaque: 550 case vmIntrinsics::_getIntOpaque: 551 case vmIntrinsics::_getLongOpaque: 552 case vmIntrinsics::_getFloatOpaque: 553 case vmIntrinsics::_getDoubleOpaque: 554 case vmIntrinsics::_putReferenceOpaque: 555 case vmIntrinsics::_putBooleanOpaque: 556 case vmIntrinsics::_putByteOpaque: 557 case vmIntrinsics::_putShortOpaque: 558 case vmIntrinsics::_putCharOpaque: 559 case vmIntrinsics::_putIntOpaque: 560 case vmIntrinsics::_putLongOpaque: 561 case vmIntrinsics::_putFloatOpaque: 562 case vmIntrinsics::_putDoubleOpaque: 563 case vmIntrinsics::_getShortUnaligned: 564 case vmIntrinsics::_getCharUnaligned: 565 case vmIntrinsics::_getIntUnaligned: 566 case vmIntrinsics::_getLongUnaligned: 567 case vmIntrinsics::_putShortUnaligned: 568 case vmIntrinsics::_putCharUnaligned: 569 case vmIntrinsics::_putIntUnaligned: 570 case vmIntrinsics::_putLongUnaligned: 571 case vmIntrinsics::_loadFence: 572 case vmIntrinsics::_storeFence: 573 case vmIntrinsics::_fullFence: 574 case vmIntrinsics::_currentThread: 575 #ifdef JFR_HAVE_INTRINSICS 576 case vmIntrinsics::_counterTime: 577 case vmIntrinsics::_getClassId: 578 case vmIntrinsics::_getEventWriter: 579 #endif 580 case vmIntrinsics::_currentTimeMillis: 581 case vmIntrinsics::_nanoTime: 582 case vmIntrinsics::_allocateInstance: 583 case vmIntrinsics::_allocateUninitializedArray: 584 case vmIntrinsics::_newArray: 585 case vmIntrinsics::_getLength: 586 case vmIntrinsics::_copyOf: 587 case vmIntrinsics::_copyOfRange: 588 case vmIntrinsics::_clone: 589 case vmIntrinsics::_isAssignableFrom: 590 case vmIntrinsics::_isInstance: 591 case vmIntrinsics::_getModifiers: 592 case vmIntrinsics::_isInterface: 593 case vmIntrinsics::_isArray: 594 case vmIntrinsics::_isPrimitive: 595 case vmIntrinsics::_isHidden: 596 case vmIntrinsics::_getSuperclass: 597 case vmIntrinsics::_getClassAccessFlags: 598 case vmIntrinsics::_floatToRawIntBits: 599 case vmIntrinsics::_floatToIntBits: 600 case vmIntrinsics::_intBitsToFloat: 601 case vmIntrinsics::_doubleToRawLongBits: 602 case vmIntrinsics::_doubleToLongBits: 603 case vmIntrinsics::_longBitsToDouble: 604 case vmIntrinsics::_Reference_get: 605 case vmIntrinsics::_Class_cast: 606 case vmIntrinsics::_aescrypt_encryptBlock: 607 case vmIntrinsics::_aescrypt_decryptBlock: 608 case vmIntrinsics::_cipherBlockChaining_encryptAESCrypt: 609 case vmIntrinsics::_cipherBlockChaining_decryptAESCrypt: 610 case vmIntrinsics::_electronicCodeBook_encryptAESCrypt: 611 case vmIntrinsics::_electronicCodeBook_decryptAESCrypt: 612 case vmIntrinsics::_counterMode_AESCrypt: 613 case vmIntrinsics::_md5_implCompress: 614 case vmIntrinsics::_sha_implCompress: 615 case vmIntrinsics::_sha2_implCompress: 616 case vmIntrinsics::_sha5_implCompress: 617 case vmIntrinsics::_digestBase_implCompressMB: 618 case vmIntrinsics::_multiplyToLen: 619 case vmIntrinsics::_squareToLen: 620 case vmIntrinsics::_mulAdd: 621 case vmIntrinsics::_montgomeryMultiply: 622 case vmIntrinsics::_montgomerySquare: 623 case vmIntrinsics::_bigIntegerRightShiftWorker: 624 case vmIntrinsics::_bigIntegerLeftShiftWorker: 625 case vmIntrinsics::_vectorizedMismatch: 626 case vmIntrinsics::_ghash_processBlocks: 627 case vmIntrinsics::_base64_encodeBlock: 628 case vmIntrinsics::_updateCRC32: 629 case vmIntrinsics::_updateBytesCRC32: 630 case vmIntrinsics::_updateByteBufferCRC32: 631 case vmIntrinsics::_updateBytesCRC32C: 632 case vmIntrinsics::_updateDirectByteBufferCRC32C: 633 case vmIntrinsics::_updateBytesAdler32: 634 case vmIntrinsics::_updateByteBufferAdler32: 635 case vmIntrinsics::_profileBoolean: 636 case vmIntrinsics::_isCompileConstant: 637 case vmIntrinsics::_Preconditions_checkIndex: 638 break; 639 default: 640 return false; 641 } 642 return true; 643 } 644 645 int C2Compiler::initial_code_buffer_size(int const_size) { 646 // See Compile::init_scratch_buffer_blob 647 int locs_size = sizeof(relocInfo) * PhaseOutput::MAX_locs_size; 648 int slop = 2 * CodeSection::end_slop(); // space between sections 649 return PhaseOutput::MAX_inst_size + PhaseOutput::MAX_stubs_size + const_size + slop + locs_size; 650 }