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

617   case vmIntrinsics::_currentThread:



618 #ifdef JFR_HAVE_INTRINSICS
619   case vmIntrinsics::_counterTime:
620   case vmIntrinsics::_getClassId:
621   case vmIntrinsics::_getEventWriter:
622 #endif
623   case vmIntrinsics::_currentTimeMillis:
624   case vmIntrinsics::_nanoTime:
625   case vmIntrinsics::_allocateInstance:
626   case vmIntrinsics::_allocateUninitializedArray:
627   case vmIntrinsics::_newArray:
628   case vmIntrinsics::_getLength:
629   case vmIntrinsics::_copyOf:
630   case vmIntrinsics::_copyOfRange:
631   case vmIntrinsics::_clone:
632   case vmIntrinsics::_isAssignableFrom:
633   case vmIntrinsics::_isInstance:
634   case vmIntrinsics::_getModifiers:
635   case vmIntrinsics::_isInterface:
636   case vmIntrinsics::_isArray:
637   case vmIntrinsics::_isPrimitive:
638   case vmIntrinsics::_isHidden:
639   case vmIntrinsics::_getSuperclass:
640   case vmIntrinsics::_getClassAccessFlags:
641   case vmIntrinsics::_floatToRawIntBits:
642   case vmIntrinsics::_floatToIntBits:
643   case vmIntrinsics::_intBitsToFloat:
644   case vmIntrinsics::_doubleToRawLongBits:
645   case vmIntrinsics::_doubleToLongBits:
646   case vmIntrinsics::_longBitsToDouble:
647   case vmIntrinsics::_Reference_get:
648   case vmIntrinsics::_Reference_refersTo0:
649   case vmIntrinsics::_PhantomReference_refersTo0:
650   case vmIntrinsics::_Class_cast:
651   case vmIntrinsics::_aescrypt_encryptBlock:
652   case vmIntrinsics::_aescrypt_decryptBlock:
653   case vmIntrinsics::_cipherBlockChaining_encryptAESCrypt:
654   case vmIntrinsics::_cipherBlockChaining_decryptAESCrypt:
655   case vmIntrinsics::_electronicCodeBook_encryptAESCrypt:
656   case vmIntrinsics::_electronicCodeBook_decryptAESCrypt:
657   case vmIntrinsics::_counterMode_AESCrypt:
658   case vmIntrinsics::_galoisCounterMode_AESCrypt:
659   case vmIntrinsics::_md5_implCompress:
660   case vmIntrinsics::_sha_implCompress:
661   case vmIntrinsics::_sha2_implCompress:
662   case vmIntrinsics::_sha5_implCompress:
663   case vmIntrinsics::_sha3_implCompress:
664   case vmIntrinsics::_digestBase_implCompressMB:
665   case vmIntrinsics::_multiplyToLen:
666   case vmIntrinsics::_squareToLen:
667   case vmIntrinsics::_mulAdd:
668   case vmIntrinsics::_montgomeryMultiply:
669   case vmIntrinsics::_montgomerySquare:
670   case vmIntrinsics::_bigIntegerRightShiftWorker:
671   case vmIntrinsics::_bigIntegerLeftShiftWorker:
672   case vmIntrinsics::_vectorizedMismatch:
673   case vmIntrinsics::_ghash_processBlocks:
674   case vmIntrinsics::_base64_encodeBlock:
675   case vmIntrinsics::_base64_decodeBlock:
676   case vmIntrinsics::_updateCRC32:
677   case vmIntrinsics::_updateBytesCRC32:
678   case vmIntrinsics::_updateByteBufferCRC32:
679   case vmIntrinsics::_updateBytesCRC32C:
680   case vmIntrinsics::_updateDirectByteBufferCRC32C:
681   case vmIntrinsics::_updateBytesAdler32:
682   case vmIntrinsics::_updateByteBufferAdler32:
683   case vmIntrinsics::_profileBoolean:
684   case vmIntrinsics::_isCompileConstant:
685   case vmIntrinsics::_Preconditions_checkIndex:
686   case vmIntrinsics::_Preconditions_checkLongIndex:
687   case vmIntrinsics::_getObjectSize:

688     break;
689 
690   case vmIntrinsics::_VectorUnaryOp:
691   case vmIntrinsics::_VectorBinaryOp:
692   case vmIntrinsics::_VectorTernaryOp:
693   case vmIntrinsics::_VectorBroadcastCoerced:
694   case vmIntrinsics::_VectorShuffleIota:
695   case vmIntrinsics::_VectorShuffleToVector:
696   case vmIntrinsics::_VectorLoadOp:
697   case vmIntrinsics::_VectorLoadMaskedOp:
698   case vmIntrinsics::_VectorStoreOp:
699   case vmIntrinsics::_VectorStoreMaskedOp:
700   case vmIntrinsics::_VectorGatherOp:
701   case vmIntrinsics::_VectorScatterOp:
702   case vmIntrinsics::_VectorReductionCoerced:
703   case vmIntrinsics::_VectorTest:
704   case vmIntrinsics::_VectorBlend:
705   case vmIntrinsics::_VectorRearrange:
706   case vmIntrinsics::_VectorCompare:
707   case vmIntrinsics::_VectorBroadcastInt:
708   case vmIntrinsics::_VectorConvert:
709   case vmIntrinsics::_VectorInsert:
710   case vmIntrinsics::_VectorExtract:
711   case vmIntrinsics::_VectorMaskOp:
712     return EnableVectorSupport;
713   case vmIntrinsics::_blackhole:
714     break;
715 
716   default:
717     return false;
718   }
719   return true;
720 }
721 
722 int C2Compiler::initial_code_buffer_size(int const_size) {
723   // See Compile::init_scratch_buffer_blob
724   int locs_size = sizeof(relocInfo) * PhaseOutput::MAX_locs_size;
725   int slop = 2 * CodeSection::end_slop(); // space between sections
726   return PhaseOutput::MAX_inst_size + PhaseOutput::MAX_stubs_size + const_size + slop + locs_size;
727 }
--- EOF ---