27 #include "code/codeCache.hpp"
28 #include "code/compiledIC.hpp"
29 #include "code/nmethod.hpp"
30 #include "code/pcDesc.hpp"
31 #include "code/scopeDesc.hpp"
32 #include "code/vtableStubs.hpp"
33 #include "compiler/compilationMemoryStatistic.hpp"
34 #include "compiler/compileBroker.hpp"
35 #include "compiler/oopMap.hpp"
36 #include "gc/g1/g1HeapRegion.hpp"
37 #include "gc/shared/barrierSet.hpp"
38 #include "gc/shared/collectedHeap.hpp"
39 #include "gc/shared/gcLocker.hpp"
40 #include "interpreter/bytecode.hpp"
41 #include "interpreter/interpreter.hpp"
42 #include "interpreter/linkResolver.hpp"
43 #include "logging/log.hpp"
44 #include "logging/logStream.hpp"
45 #include "memory/oopFactory.hpp"
46 #include "memory/resourceArea.hpp"
47 #include "oops/klass.inline.hpp"
48 #include "oops/objArrayKlass.hpp"
49 #include "oops/oop.inline.hpp"
50 #include "oops/typeArrayOop.inline.hpp"
51 #include "opto/ad.hpp"
52 #include "opto/addnode.hpp"
53 #include "opto/callnode.hpp"
54 #include "opto/cfgnode.hpp"
55 #include "opto/graphKit.hpp"
56 #include "opto/machnode.hpp"
57 #include "opto/matcher.hpp"
58 #include "opto/memnode.hpp"
59 #include "opto/mulnode.hpp"
60 #include "opto/output.hpp"
61 #include "opto/runtime.hpp"
62 #include "opto/subnode.hpp"
63 #include "prims/jvmtiExport.hpp"
64 #include "runtime/atomicAccess.hpp"
65 #include "runtime/frame.inline.hpp"
66 #include "runtime/handles.inline.hpp"
153
154 bool OptoRuntime::generate(ciEnv* env) {
155
156 C2_STUBS_DO(GEN_C2_BLOB, GEN_C2_STUB)
157
158 return true;
159 }
160
161 #undef GEN_C2_BLOB
162
163 #undef C2_STUB_FIELD_NAME
164 #undef C2_STUB_TYPEFUNC
165 #undef C2_STUB_C_FUNC
166 #undef C2_STUB_NAME
167 #undef GEN_C2_STUB
168
169 // #undef gen
170
171 const TypeFunc* OptoRuntime::_new_instance_Type = nullptr;
172 const TypeFunc* OptoRuntime::_new_array_Type = nullptr;
173 const TypeFunc* OptoRuntime::_multianewarray2_Type = nullptr;
174 const TypeFunc* OptoRuntime::_multianewarray3_Type = nullptr;
175 const TypeFunc* OptoRuntime::_multianewarray4_Type = nullptr;
176 const TypeFunc* OptoRuntime::_multianewarray5_Type = nullptr;
177 const TypeFunc* OptoRuntime::_multianewarrayN_Type = nullptr;
178 const TypeFunc* OptoRuntime::_complete_monitor_enter_Type = nullptr;
179 const TypeFunc* OptoRuntime::_complete_monitor_exit_Type = nullptr;
180 const TypeFunc* OptoRuntime::_monitor_notify_Type = nullptr;
181 const TypeFunc* OptoRuntime::_uncommon_trap_Type = nullptr;
182 const TypeFunc* OptoRuntime::_athrow_Type = nullptr;
183 const TypeFunc* OptoRuntime::_rethrow_Type = nullptr;
184 const TypeFunc* OptoRuntime::_Math_D_D_Type = nullptr;
185 const TypeFunc* OptoRuntime::_Math_DD_D_Type = nullptr;
186 const TypeFunc* OptoRuntime::_modf_Type = nullptr;
187 const TypeFunc* OptoRuntime::_l2f_Type = nullptr;
188 const TypeFunc* OptoRuntime::_void_long_Type = nullptr;
189 const TypeFunc* OptoRuntime::_void_void_Type = nullptr;
190 const TypeFunc* OptoRuntime::_jfr_write_checkpoint_Type = nullptr;
191 const TypeFunc* OptoRuntime::_flush_windows_Type = nullptr;
192 const TypeFunc* OptoRuntime::_fast_arraycopy_Type = nullptr;
281 oopDesc* dest, jint dest_pos,
282 jint length, JavaThread* thread) {
283 SharedRuntime::slow_arraycopy_C(src, src_pos, dest, dest_pos, length, thread);
284 }
285
286 void OptoRuntime::complete_monitor_locking_C(oopDesc* obj, BasicLock* lock, JavaThread* current) {
287 SharedRuntime::complete_monitor_locking_C(obj, lock, current);
288 }
289
290
291 //=============================================================================
292 // Opto compiler runtime routines
293 //=============================================================================
294
295
296 //=============================allocation======================================
297 // We failed the fast-path allocation. Now we need to do a scavenge or GC
298 // and try allocation again.
299
300 // object allocation
301 JRT_BLOCK_ENTRY(void, OptoRuntime::new_instance_C(Klass* klass, JavaThread* current))
302 JRT_BLOCK;
303 #ifndef PRODUCT
304 SharedRuntime::_new_instance_ctr++; // new instance requires GC
305 #endif
306 assert(check_compiled_frame(current), "incorrect caller");
307
308 // These checks are cheap to make and support reflective allocation.
309 int lh = klass->layout_helper();
310 if (Klass::layout_helper_needs_slow_path(lh) || !InstanceKlass::cast(klass)->is_initialized()) {
311 Handle holder(current, klass->klass_holder()); // keep the klass alive
312 klass->check_valid_for_instantiation(false, THREAD);
313 if (!HAS_PENDING_EXCEPTION) {
314 InstanceKlass::cast(klass)->initialize(THREAD);
315 }
316 }
317
318 if (!HAS_PENDING_EXCEPTION) {
319 // Scavenge and allocate an instance.
320 Handle holder(current, klass->klass_holder()); // keep the klass alive
321 oop result = InstanceKlass::cast(klass)->allocate_instance(THREAD);
322 current->set_vm_result_oop(result);
323
324 // Pass oops back through thread local storage. Our apparent type to Java
325 // is that we return an oop, but we can block on exit from this routine and
326 // a GC can trash the oop in C's return register. The generated stub will
327 // fetch the oop from TLS after any possible GC.
328 }
329
330 deoptimize_caller_frame(current, HAS_PENDING_EXCEPTION);
331 JRT_BLOCK_END;
332
333 // inform GC that we won't do card marks for initializing writes.
334 SharedRuntime::on_slowpath_allocation_exit(current);
335 JRT_END
336
337
338 // array allocation
339 JRT_BLOCK_ENTRY(void, OptoRuntime::new_array_C(Klass* array_type, int len, JavaThread* current))
340 JRT_BLOCK;
341 #ifndef PRODUCT
342 SharedRuntime::_new_array_ctr++; // new array requires GC
343 #endif
344 assert(check_compiled_frame(current), "incorrect caller");
345
346 // Scavenge and allocate an instance.
347 oop result;
348
349 if (array_type->is_typeArray_klass()) {
350 // The oopFactory likes to work with the element type.
351 // (We could bypass the oopFactory, since it doesn't add much value.)
352 BasicType elem_type = TypeArrayKlass::cast(array_type)->element_type();
353 result = oopFactory::new_typeArray(elem_type, len, THREAD);
354 } else {
355 // Although the oopFactory likes to work with the elem_type,
356 // the compiler prefers the array_type, since it must already have
357 // that latter value in hand for the fast path.
358 Handle holder(current, array_type->klass_holder()); // keep the array klass alive
359 Klass* elem_type = ObjArrayKlass::cast(array_type)->element_klass();
360 result = oopFactory::new_objArray(elem_type, len, THREAD);
361 }
362
363 // Pass oops back through thread local storage. Our apparent type to Java
364 // is that we return an oop, but we can block on exit from this routine and
365 // a GC can trash the oop in C's return register. The generated stub will
366 // fetch the oop from TLS after any possible GC.
367 deoptimize_caller_frame(current, HAS_PENDING_EXCEPTION);
368 current->set_vm_result_oop(result);
369 JRT_BLOCK_END;
370
371 // inform GC that we won't do card marks for initializing writes.
372 SharedRuntime::on_slowpath_allocation_exit(current);
373 JRT_END
374
375 // array allocation without zeroing
376 JRT_BLOCK_ENTRY(void, OptoRuntime::new_array_nozero_C(Klass* array_type, int len, JavaThread* current))
377 JRT_BLOCK;
378 #ifndef PRODUCT
379 SharedRuntime::_new_array_ctr++; // new array requires GC
380 #endif
557 JRT_END
558
559 JRT_ENTRY(void, OptoRuntime::vthread_start_final_transition_C(oopDesc* vt, jboolean is_mount, JavaThread* current))
560 java_lang_Thread::set_is_in_vthread_transition(vt, false);
561 current->set_is_in_vthread_transition(false);
562 MountUnmountDisabler::start_transition(current, vt, false /*is_mount */, true /*is_thread_end*/);
563 JRT_END
564
565 JRT_ENTRY(void, OptoRuntime::vthread_start_transition_C(oopDesc* vt, jboolean is_mount, JavaThread* current))
566 java_lang_Thread::set_is_in_vthread_transition(vt, false);
567 current->set_is_in_vthread_transition(false);
568 MountUnmountDisabler::start_transition(current, vt, is_mount, false /*is_thread_end*/);
569 JRT_END
570
571 JRT_ENTRY(void, OptoRuntime::vthread_end_transition_C(oopDesc* vt, jboolean is_mount, JavaThread* current))
572 MountUnmountDisabler::end_transition(current, vt, is_mount, false /*is_thread_start*/);
573 JRT_END
574
575 static const TypeFunc* make_new_instance_Type() {
576 // create input type (domain)
577 const Type **fields = TypeTuple::fields(1);
578 fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL; // Klass to be allocated
579 const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+1, fields);
580
581 // create result type (range)
582 fields = TypeTuple::fields(1);
583 fields[TypeFunc::Parms+0] = TypeRawPtr::NOTNULL; // Returned oop
584
585 const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+1, fields);
586
587 return TypeFunc::make(domain, range);
588 }
589
590 static const TypeFunc* make_vthread_transition_Type() {
591 // create input type (domain)
592 const Type **fields = TypeTuple::fields(2);
593 fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL; // VirtualThread oop
594 fields[TypeFunc::Parms+1] = TypeInt::BOOL; // jboolean
595 const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+2,fields);
596
597 // no result type needed
598 fields = TypeTuple::fields(1);
599 fields[TypeFunc::Parms+0] = nullptr; // void
600 const TypeTuple* range = TypeTuple::make(TypeFunc::Parms, fields);
601
602 return TypeFunc::make(domain,range);
603 }
604
605 static const TypeFunc* make_athrow_Type() {
606 // create input type (domain)
607 const Type **fields = TypeTuple::fields(1);
608 fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL; // Klass to be allocated
609 const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+1, fields);
610
611 // create result type (range)
612 fields = TypeTuple::fields(0);
613
614 const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+0, fields);
615
616 return TypeFunc::make(domain, range);
617 }
618
619 static const TypeFunc* make_new_array_Type() {
620 // create input type (domain)
621 const Type **fields = TypeTuple::fields(2);
622 fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL; // element klass
623 fields[TypeFunc::Parms+1] = TypeInt::INT; // array size
624 const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+2, fields);
625
626 // create result type (range)
627 fields = TypeTuple::fields(1);
628 fields[TypeFunc::Parms+0] = TypeRawPtr::NOTNULL; // Returned oop
629
630 const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+1, fields);
631
632 return TypeFunc::make(domain, range);
633 }
634
635 const TypeFunc* OptoRuntime::multianewarray_Type(int ndim) {
636 // create input type (domain)
637 const int nargs = ndim + 1;
638 const Type **fields = TypeTuple::fields(nargs);
639 fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL; // element klass
675 const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+0, fields);
676
677 return TypeFunc::make(domain, range);
678 }
679
680 //-----------------------------------------------------------------------------
681 // Monitor Handling
682
683 static const TypeFunc* make_complete_monitor_enter_Type() {
684 // create input type (domain)
685 const Type **fields = TypeTuple::fields(2);
686 fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL; // Object to be Locked
687 fields[TypeFunc::Parms+1] = TypeRawPtr::BOTTOM; // Address of stack location for lock
688 const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+2,fields);
689
690 // create result type (range)
691 fields = TypeTuple::fields(0);
692
693 const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+0,fields);
694
695 return TypeFunc::make(domain,range);
696 }
697
698 //-----------------------------------------------------------------------------
699
700 static const TypeFunc* make_complete_monitor_exit_Type() {
701 // create input type (domain)
702 const Type **fields = TypeTuple::fields(3);
703 fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL; // Object to be Locked
704 fields[TypeFunc::Parms+1] = TypeRawPtr::BOTTOM; // Address of stack location for lock - BasicLock
705 fields[TypeFunc::Parms+2] = TypeRawPtr::BOTTOM; // Thread pointer (Self)
706 const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+3, fields);
707
708 // create result type (range)
709 fields = TypeTuple::fields(0);
710
711 const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+0, fields);
712
713 return TypeFunc::make(domain, range);
714 }
715
2109 RegisterMap::WalkContinuation::skip);
2110 frame stub_frame = thread->last_frame();
2111 assert(stub_frame.is_runtime_frame() || exception_blob()->contains(stub_frame.pc()), "sanity check");
2112 frame caller_frame = stub_frame.sender(®_map);
2113 return caller_frame.is_deoptimized_frame();
2114 }
2115
2116 static const TypeFunc* make_register_finalizer_Type() {
2117 // create input type (domain)
2118 const Type **fields = TypeTuple::fields(1);
2119 fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL; // oop; Receiver
2120 // // The JavaThread* is passed to each routine as the last argument
2121 // fields[TypeFunc::Parms+1] = TypeRawPtr::NOTNULL; // JavaThread *; Executing thread
2122 const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+1,fields);
2123
2124 // create result type (range)
2125 fields = TypeTuple::fields(0);
2126
2127 const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+0,fields);
2128
2129 return TypeFunc::make(domain,range);
2130 }
2131
2132 #if INCLUDE_JFR
2133 static const TypeFunc* make_class_id_load_barrier_Type() {
2134 // create input type (domain)
2135 const Type **fields = TypeTuple::fields(1);
2136 fields[TypeFunc::Parms+0] = TypeInstPtr::KLASS;
2137 const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms + 1, fields);
2138
2139 // create result type (range)
2140 fields = TypeTuple::fields(0);
2141
2142 const TypeTuple *range = TypeTuple::make(TypeFunc::Parms + 0, fields);
2143
2144 return TypeFunc::make(domain,range);
2145 }
2146 #endif // INCLUDE_JFR
2147
2148 //-----------------------------------------------------------------------------
2149 static const TypeFunc* make_dtrace_method_entry_exit_Type() {
2150 // create input type (domain)
2151 const Type **fields = TypeTuple::fields(2);
2152 fields[TypeFunc::Parms+0] = TypeRawPtr::BOTTOM; // Thread-local storage
2153 fields[TypeFunc::Parms+1] = TypeMetadataPtr::BOTTOM; // Method*; Method we are entering
2154 const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+2,fields);
2155
2156 // create result type (range)
2157 fields = TypeTuple::fields(0);
2158
2159 const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+0,fields);
2160
2161 return TypeFunc::make(domain,range);
2162 }
2163
2164 static const TypeFunc* make_dtrace_object_alloc_Type() {
2165 // create input type (domain)
2166 const Type **fields = TypeTuple::fields(2);
2167 fields[TypeFunc::Parms+0] = TypeRawPtr::BOTTOM; // Thread-local storage
2168 fields[TypeFunc::Parms+1] = TypeInstPtr::NOTNULL; // oop; newly allocated object
2169
2170 const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+2,fields);
2171
2172 // create result type (range)
2173 fields = TypeTuple::fields(0);
2174
2175 const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+0,fields);
2176
2177 return TypeFunc::make(domain,range);
2178 }
2179
2180 JRT_ENTRY_NO_ASYNC(void, OptoRuntime::register_finalizer_C(oopDesc* obj, JavaThread* current))
2181 assert(oopDesc::is_oop(obj), "must be a valid oop");
2182 assert(obj->klass()->has_finalizer(), "shouldn't be here otherwise");
2183 InstanceKlass::register_finalizer(instanceOop(obj), CHECK);
2184 JRT_END
2185
2186 //-----------------------------------------------------------------------------
2187
2188 NamedCounter * volatile OptoRuntime::_named_counters = nullptr;
2189
2190 //
2191 // dump the collected NamedCounters.
2192 //
2193 void OptoRuntime::print_named_counters() {
2194 int total_lock_count = 0;
2195 int eliminated_lock_count = 0;
2196
2197 NamedCounter* c = _named_counters;
2248 }
2249 st.print("@%d", bci);
2250 // To print linenumbers instead of bci use: m->line_number_from_bci(bci)
2251 }
2252 NamedCounter* c = new NamedCounter(st.freeze(), tag);
2253
2254 // atomically add the new counter to the head of the list. We only
2255 // add counters so this is safe.
2256 NamedCounter* head;
2257 do {
2258 c->set_next(nullptr);
2259 head = _named_counters;
2260 c->set_next(head);
2261 } while (AtomicAccess::cmpxchg(&_named_counters, head, c) != head);
2262 return c;
2263 }
2264
2265 void OptoRuntime::initialize_types() {
2266 _new_instance_Type = make_new_instance_Type();
2267 _new_array_Type = make_new_array_Type();
2268 _multianewarray2_Type = multianewarray_Type(2);
2269 _multianewarray3_Type = multianewarray_Type(3);
2270 _multianewarray4_Type = multianewarray_Type(4);
2271 _multianewarray5_Type = multianewarray_Type(5);
2272 _multianewarrayN_Type = make_multianewarrayN_Type();
2273 _complete_monitor_enter_Type = make_complete_monitor_enter_Type();
2274 _complete_monitor_exit_Type = make_complete_monitor_exit_Type();
2275 _monitor_notify_Type = make_monitor_notify_Type();
2276 _uncommon_trap_Type = make_uncommon_trap_Type();
2277 _athrow_Type = make_athrow_Type();
2278 _rethrow_Type = make_rethrow_Type();
2279 _Math_D_D_Type = make_Math_D_D_Type();
2280 _Math_DD_D_Type = make_Math_DD_D_Type();
2281 _modf_Type = make_modf_Type();
2282 _l2f_Type = make_l2f_Type();
2283 _void_long_Type = make_void_long_Type();
2284 _void_void_Type = make_void_void_Type();
2285 _jfr_write_checkpoint_Type = make_jfr_write_checkpoint_Type();
2286 _flush_windows_Type = make_flush_windows_Type();
2287 _fast_arraycopy_Type = make_arraycopy_Type(ac_fast);
2346 static void trace_exception(outputStream* st, oop exception_oop, address exception_pc, const char* msg) {
2347 trace_exception_counter++;
2348 stringStream tempst;
2349
2350 tempst.print("%d [Exception (%s): ", trace_exception_counter, msg);
2351 exception_oop->print_value_on(&tempst);
2352 tempst.print(" in ");
2353 CodeBlob* blob = CodeCache::find_blob(exception_pc);
2354 if (blob->is_nmethod()) {
2355 blob->as_nmethod()->method()->print_value_on(&tempst);
2356 } else if (blob->is_runtime_stub()) {
2357 tempst.print("<runtime-stub>");
2358 } else {
2359 tempst.print("<unknown>");
2360 }
2361 tempst.print(" at " INTPTR_FORMAT, p2i(exception_pc));
2362 tempst.print("]");
2363
2364 st->print_raw_cr(tempst.freeze());
2365 }
|
27 #include "code/codeCache.hpp"
28 #include "code/compiledIC.hpp"
29 #include "code/nmethod.hpp"
30 #include "code/pcDesc.hpp"
31 #include "code/scopeDesc.hpp"
32 #include "code/vtableStubs.hpp"
33 #include "compiler/compilationMemoryStatistic.hpp"
34 #include "compiler/compileBroker.hpp"
35 #include "compiler/oopMap.hpp"
36 #include "gc/g1/g1HeapRegion.hpp"
37 #include "gc/shared/barrierSet.hpp"
38 #include "gc/shared/collectedHeap.hpp"
39 #include "gc/shared/gcLocker.hpp"
40 #include "interpreter/bytecode.hpp"
41 #include "interpreter/interpreter.hpp"
42 #include "interpreter/linkResolver.hpp"
43 #include "logging/log.hpp"
44 #include "logging/logStream.hpp"
45 #include "memory/oopFactory.hpp"
46 #include "memory/resourceArea.hpp"
47 #include "oops/flatArrayKlass.hpp"
48 #include "oops/flatArrayOop.inline.hpp"
49 #include "oops/klass.inline.hpp"
50 #include "oops/objArrayKlass.hpp"
51 #include "oops/oop.inline.hpp"
52 #include "oops/typeArrayOop.inline.hpp"
53 #include "opto/ad.hpp"
54 #include "opto/addnode.hpp"
55 #include "opto/callnode.hpp"
56 #include "opto/cfgnode.hpp"
57 #include "opto/graphKit.hpp"
58 #include "opto/machnode.hpp"
59 #include "opto/matcher.hpp"
60 #include "opto/memnode.hpp"
61 #include "opto/mulnode.hpp"
62 #include "opto/output.hpp"
63 #include "opto/runtime.hpp"
64 #include "opto/subnode.hpp"
65 #include "prims/jvmtiExport.hpp"
66 #include "runtime/atomicAccess.hpp"
67 #include "runtime/frame.inline.hpp"
68 #include "runtime/handles.inline.hpp"
155
156 bool OptoRuntime::generate(ciEnv* env) {
157
158 C2_STUBS_DO(GEN_C2_BLOB, GEN_C2_STUB)
159
160 return true;
161 }
162
163 #undef GEN_C2_BLOB
164
165 #undef C2_STUB_FIELD_NAME
166 #undef C2_STUB_TYPEFUNC
167 #undef C2_STUB_C_FUNC
168 #undef C2_STUB_NAME
169 #undef GEN_C2_STUB
170
171 // #undef gen
172
173 const TypeFunc* OptoRuntime::_new_instance_Type = nullptr;
174 const TypeFunc* OptoRuntime::_new_array_Type = nullptr;
175 const TypeFunc* OptoRuntime::_new_array_nozero_Type = nullptr;
176 const TypeFunc* OptoRuntime::_multianewarray2_Type = nullptr;
177 const TypeFunc* OptoRuntime::_multianewarray3_Type = nullptr;
178 const TypeFunc* OptoRuntime::_multianewarray4_Type = nullptr;
179 const TypeFunc* OptoRuntime::_multianewarray5_Type = nullptr;
180 const TypeFunc* OptoRuntime::_multianewarrayN_Type = nullptr;
181 const TypeFunc* OptoRuntime::_complete_monitor_enter_Type = nullptr;
182 const TypeFunc* OptoRuntime::_complete_monitor_exit_Type = nullptr;
183 const TypeFunc* OptoRuntime::_monitor_notify_Type = nullptr;
184 const TypeFunc* OptoRuntime::_uncommon_trap_Type = nullptr;
185 const TypeFunc* OptoRuntime::_athrow_Type = nullptr;
186 const TypeFunc* OptoRuntime::_rethrow_Type = nullptr;
187 const TypeFunc* OptoRuntime::_Math_D_D_Type = nullptr;
188 const TypeFunc* OptoRuntime::_Math_DD_D_Type = nullptr;
189 const TypeFunc* OptoRuntime::_modf_Type = nullptr;
190 const TypeFunc* OptoRuntime::_l2f_Type = nullptr;
191 const TypeFunc* OptoRuntime::_void_long_Type = nullptr;
192 const TypeFunc* OptoRuntime::_void_void_Type = nullptr;
193 const TypeFunc* OptoRuntime::_jfr_write_checkpoint_Type = nullptr;
194 const TypeFunc* OptoRuntime::_flush_windows_Type = nullptr;
195 const TypeFunc* OptoRuntime::_fast_arraycopy_Type = nullptr;
284 oopDesc* dest, jint dest_pos,
285 jint length, JavaThread* thread) {
286 SharedRuntime::slow_arraycopy_C(src, src_pos, dest, dest_pos, length, thread);
287 }
288
289 void OptoRuntime::complete_monitor_locking_C(oopDesc* obj, BasicLock* lock, JavaThread* current) {
290 SharedRuntime::complete_monitor_locking_C(obj, lock, current);
291 }
292
293
294 //=============================================================================
295 // Opto compiler runtime routines
296 //=============================================================================
297
298
299 //=============================allocation======================================
300 // We failed the fast-path allocation. Now we need to do a scavenge or GC
301 // and try allocation again.
302
303 // object allocation
304 JRT_BLOCK_ENTRY(void, OptoRuntime::new_instance_C(Klass* klass, bool is_larval, JavaThread* current))
305 JRT_BLOCK;
306 #ifndef PRODUCT
307 SharedRuntime::_new_instance_ctr++; // new instance requires GC
308 #endif
309 assert(check_compiled_frame(current), "incorrect caller");
310
311 // These checks are cheap to make and support reflective allocation.
312 int lh = klass->layout_helper();
313 if (Klass::layout_helper_needs_slow_path(lh) || !InstanceKlass::cast(klass)->is_initialized()) {
314 Handle holder(current, klass->klass_holder()); // keep the klass alive
315 klass->check_valid_for_instantiation(false, THREAD);
316 if (!HAS_PENDING_EXCEPTION) {
317 InstanceKlass::cast(klass)->initialize(THREAD);
318 }
319 }
320
321 if (!HAS_PENDING_EXCEPTION) {
322 // Scavenge and allocate an instance.
323 Handle holder(current, klass->klass_holder()); // keep the klass alive
324 instanceOop result = InstanceKlass::cast(klass)->allocate_instance(THREAD);
325 if (is_larval) {
326 // Check if this is a larval buffer allocation
327 result->set_mark(result->mark().enter_larval_state());
328 }
329 current->set_vm_result_oop(result);
330
331 // Pass oops back through thread local storage. Our apparent type to Java
332 // is that we return an oop, but we can block on exit from this routine and
333 // a GC can trash the oop in C's return register. The generated stub will
334 // fetch the oop from TLS after any possible GC.
335 }
336
337 deoptimize_caller_frame(current, HAS_PENDING_EXCEPTION);
338 JRT_BLOCK_END;
339
340 // inform GC that we won't do card marks for initializing writes.
341 SharedRuntime::on_slowpath_allocation_exit(current);
342 JRT_END
343
344
345 // array allocation
346 JRT_BLOCK_ENTRY(void, OptoRuntime::new_array_C(Klass* array_type, int len, oopDesc* init_val, JavaThread* current))
347 JRT_BLOCK;
348 #ifndef PRODUCT
349 SharedRuntime::_new_array_ctr++; // new array requires GC
350 #endif
351 assert(check_compiled_frame(current), "incorrect caller");
352
353 // Scavenge and allocate an instance.
354 oop result;
355 Handle h_init_val(current, init_val); // keep the init_val object alive
356
357 if (array_type->is_flatArray_klass()) {
358 Handle holder(current, array_type->klass_holder()); // keep the array klass alive
359 FlatArrayKlass* fak = FlatArrayKlass::cast(array_type);
360 InlineKlass* vk = fak->element_klass();
361 ArrayKlass::ArrayProperties props = ArrayKlass::array_properties_from_layout(fak->layout_kind());
362 result = oopFactory::new_flatArray(vk, len, props, fak->layout_kind(), THREAD);
363 if (array_type->is_null_free_array_klass() && !h_init_val.is_null()) {
364 // Null-free arrays need to be initialized
365 for (int i = 0; i < len; i++) {
366 vk->write_value_to_addr(h_init_val(), ((flatArrayOop)result)->value_at_addr(i, fak->layout_helper()), fak->layout_kind(), CHECK);
367 }
368 }
369 } else if (array_type->is_typeArray_klass()) {
370 // The oopFactory likes to work with the element type.
371 // (We could bypass the oopFactory, since it doesn't add much value.)
372 BasicType elem_type = TypeArrayKlass::cast(array_type)->element_type();
373 result = oopFactory::new_typeArray(elem_type, len, THREAD);
374 } else {
375 Handle holder(current, array_type->klass_holder()); // keep the array klass alive
376 result = oopFactory::new_refArray(array_type, len, THREAD);
377 if (array_type->is_null_free_array_klass() && !h_init_val.is_null()) {
378 // Null-free arrays need to be initialized
379 for (int i = 0; i < len; i++) {
380 ((objArrayOop)result)->obj_at_put(i, h_init_val());
381 }
382 }
383 }
384
385 // Pass oops back through thread local storage. Our apparent type to Java
386 // is that we return an oop, but we can block on exit from this routine and
387 // a GC can trash the oop in C's return register. The generated stub will
388 // fetch the oop from TLS after any possible GC.
389 deoptimize_caller_frame(current, HAS_PENDING_EXCEPTION);
390 current->set_vm_result_oop(result);
391 JRT_BLOCK_END;
392
393 // inform GC that we won't do card marks for initializing writes.
394 SharedRuntime::on_slowpath_allocation_exit(current);
395 JRT_END
396
397 // array allocation without zeroing
398 JRT_BLOCK_ENTRY(void, OptoRuntime::new_array_nozero_C(Klass* array_type, int len, JavaThread* current))
399 JRT_BLOCK;
400 #ifndef PRODUCT
401 SharedRuntime::_new_array_ctr++; // new array requires GC
402 #endif
579 JRT_END
580
581 JRT_ENTRY(void, OptoRuntime::vthread_start_final_transition_C(oopDesc* vt, jboolean is_mount, JavaThread* current))
582 java_lang_Thread::set_is_in_vthread_transition(vt, false);
583 current->set_is_in_vthread_transition(false);
584 MountUnmountDisabler::start_transition(current, vt, false /*is_mount */, true /*is_thread_end*/);
585 JRT_END
586
587 JRT_ENTRY(void, OptoRuntime::vthread_start_transition_C(oopDesc* vt, jboolean is_mount, JavaThread* current))
588 java_lang_Thread::set_is_in_vthread_transition(vt, false);
589 current->set_is_in_vthread_transition(false);
590 MountUnmountDisabler::start_transition(current, vt, is_mount, false /*is_thread_end*/);
591 JRT_END
592
593 JRT_ENTRY(void, OptoRuntime::vthread_end_transition_C(oopDesc* vt, jboolean is_mount, JavaThread* current))
594 MountUnmountDisabler::end_transition(current, vt, is_mount, false /*is_thread_start*/);
595 JRT_END
596
597 static const TypeFunc* make_new_instance_Type() {
598 // create input type (domain)
599 const Type **fields = TypeTuple::fields(2);
600 fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL; // Klass to be allocated
601 fields[TypeFunc::Parms+1] = TypeInt::BOOL; // is_larval
602 const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+2, fields);
603
604 // create result type (range)
605 fields = TypeTuple::fields(1);
606 fields[TypeFunc::Parms+0] = TypeRawPtr::NOTNULL; // Returned oop
607
608 const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+1, fields);
609
610 return TypeFunc::make(domain, range);
611 }
612
613 static const TypeFunc* make_vthread_transition_Type() {
614 // create input type (domain)
615 const Type **fields = TypeTuple::fields(2);
616 fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL; // VirtualThread oop
617 fields[TypeFunc::Parms+1] = TypeInt::BOOL; // jboolean
618 const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+2,fields);
619
620 // no result type needed
621 fields = TypeTuple::fields(1);
622 fields[TypeFunc::Parms+0] = nullptr; // void
623 const TypeTuple* range = TypeTuple::make(TypeFunc::Parms, fields);
624
625 return TypeFunc::make(domain,range);
626 }
627
628 static const TypeFunc* make_athrow_Type() {
629 // create input type (domain)
630 const Type **fields = TypeTuple::fields(1);
631 fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL; // Klass to be allocated
632 const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+1, fields);
633
634 // create result type (range)
635 fields = TypeTuple::fields(0);
636
637 const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+0, fields);
638
639 return TypeFunc::make(domain, range);
640 }
641
642 static const TypeFunc* make_new_array_Type() {
643 // create input type (domain)
644 const Type **fields = TypeTuple::fields(3);
645 fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL; // element klass
646 fields[TypeFunc::Parms+1] = TypeInt::INT; // array size
647 fields[TypeFunc::Parms+2] = TypeInstPtr::NOTNULL; // init value
648 const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+3, fields);
649
650 // create result type (range)
651 fields = TypeTuple::fields(1);
652 fields[TypeFunc::Parms+0] = TypeRawPtr::NOTNULL; // Returned oop
653
654 const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+1, fields);
655
656 return TypeFunc::make(domain, range);
657 }
658
659 static const TypeFunc* make_new_array_nozero_Type() {
660 // create input type (domain)
661 const Type **fields = TypeTuple::fields(2);
662 fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL; // element klass
663 fields[TypeFunc::Parms+1] = TypeInt::INT; // array size
664 const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+2, fields);
665
666 // create result type (range)
667 fields = TypeTuple::fields(1);
668 fields[TypeFunc::Parms+0] = TypeRawPtr::NOTNULL; // Returned oop
669
670 const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+1, fields);
671
672 return TypeFunc::make(domain, range);
673 }
674
675 const TypeFunc* OptoRuntime::multianewarray_Type(int ndim) {
676 // create input type (domain)
677 const int nargs = ndim + 1;
678 const Type **fields = TypeTuple::fields(nargs);
679 fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL; // element klass
715 const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+0, fields);
716
717 return TypeFunc::make(domain, range);
718 }
719
720 //-----------------------------------------------------------------------------
721 // Monitor Handling
722
723 static const TypeFunc* make_complete_monitor_enter_Type() {
724 // create input type (domain)
725 const Type **fields = TypeTuple::fields(2);
726 fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL; // Object to be Locked
727 fields[TypeFunc::Parms+1] = TypeRawPtr::BOTTOM; // Address of stack location for lock
728 const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+2,fields);
729
730 // create result type (range)
731 fields = TypeTuple::fields(0);
732
733 const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+0,fields);
734
735 return TypeFunc::make(domain, range);
736 }
737
738 //-----------------------------------------------------------------------------
739
740 static const TypeFunc* make_complete_monitor_exit_Type() {
741 // create input type (domain)
742 const Type **fields = TypeTuple::fields(3);
743 fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL; // Object to be Locked
744 fields[TypeFunc::Parms+1] = TypeRawPtr::BOTTOM; // Address of stack location for lock - BasicLock
745 fields[TypeFunc::Parms+2] = TypeRawPtr::BOTTOM; // Thread pointer (Self)
746 const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+3, fields);
747
748 // create result type (range)
749 fields = TypeTuple::fields(0);
750
751 const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+0, fields);
752
753 return TypeFunc::make(domain, range);
754 }
755
2149 RegisterMap::WalkContinuation::skip);
2150 frame stub_frame = thread->last_frame();
2151 assert(stub_frame.is_runtime_frame() || exception_blob()->contains(stub_frame.pc()), "sanity check");
2152 frame caller_frame = stub_frame.sender(®_map);
2153 return caller_frame.is_deoptimized_frame();
2154 }
2155
2156 static const TypeFunc* make_register_finalizer_Type() {
2157 // create input type (domain)
2158 const Type **fields = TypeTuple::fields(1);
2159 fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL; // oop; Receiver
2160 // // The JavaThread* is passed to each routine as the last argument
2161 // fields[TypeFunc::Parms+1] = TypeRawPtr::NOTNULL; // JavaThread *; Executing thread
2162 const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+1,fields);
2163
2164 // create result type (range)
2165 fields = TypeTuple::fields(0);
2166
2167 const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+0,fields);
2168
2169 return TypeFunc::make(domain, range);
2170 }
2171
2172 #if INCLUDE_JFR
2173 static const TypeFunc* make_class_id_load_barrier_Type() {
2174 // create input type (domain)
2175 const Type **fields = TypeTuple::fields(1);
2176 fields[TypeFunc::Parms+0] = TypeInstPtr::KLASS;
2177 const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms + 1, fields);
2178
2179 // create result type (range)
2180 fields = TypeTuple::fields(0);
2181
2182 const TypeTuple *range = TypeTuple::make(TypeFunc::Parms + 0, fields);
2183
2184 return TypeFunc::make(domain,range);
2185 }
2186 #endif // INCLUDE_JFR
2187
2188 //-----------------------------------------------------------------------------
2189 static const TypeFunc* make_dtrace_method_entry_exit_Type() {
2190 // create input type (domain)
2191 const Type **fields = TypeTuple::fields(2);
2192 fields[TypeFunc::Parms+0] = TypeRawPtr::BOTTOM; // Thread-local storage
2193 fields[TypeFunc::Parms+1] = TypeMetadataPtr::BOTTOM; // Method*; Method we are entering
2194 const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+2,fields);
2195
2196 // create result type (range)
2197 fields = TypeTuple::fields(0);
2198
2199 const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+0,fields);
2200
2201 return TypeFunc::make(domain, range);
2202 }
2203
2204 static const TypeFunc* make_dtrace_object_alloc_Type() {
2205 // create input type (domain)
2206 const Type **fields = TypeTuple::fields(2);
2207 fields[TypeFunc::Parms+0] = TypeRawPtr::BOTTOM; // Thread-local storage
2208 fields[TypeFunc::Parms+1] = TypeInstPtr::NOTNULL; // oop; newly allocated object
2209
2210 const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+2,fields);
2211
2212 // create result type (range)
2213 fields = TypeTuple::fields(0);
2214
2215 const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+0,fields);
2216
2217 return TypeFunc::make(domain, range);
2218 }
2219
2220 JRT_ENTRY_NO_ASYNC(void, OptoRuntime::register_finalizer_C(oopDesc* obj, JavaThread* current))
2221 assert(oopDesc::is_oop(obj), "must be a valid oop");
2222 assert(obj->klass()->has_finalizer(), "shouldn't be here otherwise");
2223 InstanceKlass::register_finalizer(instanceOop(obj), CHECK);
2224 JRT_END
2225
2226 //-----------------------------------------------------------------------------
2227
2228 NamedCounter * volatile OptoRuntime::_named_counters = nullptr;
2229
2230 //
2231 // dump the collected NamedCounters.
2232 //
2233 void OptoRuntime::print_named_counters() {
2234 int total_lock_count = 0;
2235 int eliminated_lock_count = 0;
2236
2237 NamedCounter* c = _named_counters;
2288 }
2289 st.print("@%d", bci);
2290 // To print linenumbers instead of bci use: m->line_number_from_bci(bci)
2291 }
2292 NamedCounter* c = new NamedCounter(st.freeze(), tag);
2293
2294 // atomically add the new counter to the head of the list. We only
2295 // add counters so this is safe.
2296 NamedCounter* head;
2297 do {
2298 c->set_next(nullptr);
2299 head = _named_counters;
2300 c->set_next(head);
2301 } while (AtomicAccess::cmpxchg(&_named_counters, head, c) != head);
2302 return c;
2303 }
2304
2305 void OptoRuntime::initialize_types() {
2306 _new_instance_Type = make_new_instance_Type();
2307 _new_array_Type = make_new_array_Type();
2308 _new_array_nozero_Type = make_new_array_nozero_Type();
2309 _multianewarray2_Type = multianewarray_Type(2);
2310 _multianewarray3_Type = multianewarray_Type(3);
2311 _multianewarray4_Type = multianewarray_Type(4);
2312 _multianewarray5_Type = multianewarray_Type(5);
2313 _multianewarrayN_Type = make_multianewarrayN_Type();
2314 _complete_monitor_enter_Type = make_complete_monitor_enter_Type();
2315 _complete_monitor_exit_Type = make_complete_monitor_exit_Type();
2316 _monitor_notify_Type = make_monitor_notify_Type();
2317 _uncommon_trap_Type = make_uncommon_trap_Type();
2318 _athrow_Type = make_athrow_Type();
2319 _rethrow_Type = make_rethrow_Type();
2320 _Math_D_D_Type = make_Math_D_D_Type();
2321 _Math_DD_D_Type = make_Math_DD_D_Type();
2322 _modf_Type = make_modf_Type();
2323 _l2f_Type = make_l2f_Type();
2324 _void_long_Type = make_void_long_Type();
2325 _void_void_Type = make_void_void_Type();
2326 _jfr_write_checkpoint_Type = make_jfr_write_checkpoint_Type();
2327 _flush_windows_Type = make_flush_windows_Type();
2328 _fast_arraycopy_Type = make_arraycopy_Type(ac_fast);
2387 static void trace_exception(outputStream* st, oop exception_oop, address exception_pc, const char* msg) {
2388 trace_exception_counter++;
2389 stringStream tempst;
2390
2391 tempst.print("%d [Exception (%s): ", trace_exception_counter, msg);
2392 exception_oop->print_value_on(&tempst);
2393 tempst.print(" in ");
2394 CodeBlob* blob = CodeCache::find_blob(exception_pc);
2395 if (blob->is_nmethod()) {
2396 blob->as_nmethod()->method()->print_value_on(&tempst);
2397 } else if (blob->is_runtime_stub()) {
2398 tempst.print("<runtime-stub>");
2399 } else {
2400 tempst.print("<unknown>");
2401 }
2402 tempst.print(" at " INTPTR_FORMAT, p2i(exception_pc));
2403 tempst.print("]");
2404
2405 st->print_raw_cr(tempst.freeze());
2406 }
2407
2408 const TypeFunc *OptoRuntime::store_inline_type_fields_Type() {
2409 // create input type (domain)
2410 uint total = SharedRuntime::java_return_convention_max_int + SharedRuntime::java_return_convention_max_float*2;
2411 const Type **fields = TypeTuple::fields(total);
2412 // We don't know the number of returned values and their
2413 // types. Assume all registers available to the return convention
2414 // are used.
2415 fields[TypeFunc::Parms] = TypePtr::BOTTOM;
2416 uint i = 1;
2417 for (; i < SharedRuntime::java_return_convention_max_int; i++) {
2418 fields[TypeFunc::Parms+i] = TypeInt::INT;
2419 }
2420 for (; i < total; i+=2) {
2421 fields[TypeFunc::Parms+i] = Type::DOUBLE;
2422 fields[TypeFunc::Parms+i+1] = Type::HALF;
2423 }
2424 const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms + total, fields);
2425
2426 // create result type (range)
2427 fields = TypeTuple::fields(1);
2428 fields[TypeFunc::Parms+0] = TypeInstPtr::BOTTOM;
2429
2430 const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+1,fields);
2431
2432 return TypeFunc::make(domain, range);
2433 }
2434
2435 const TypeFunc *OptoRuntime::pack_inline_type_Type() {
2436 // create input type (domain)
2437 uint total = 1 + SharedRuntime::java_return_convention_max_int + SharedRuntime::java_return_convention_max_float*2;
2438 const Type **fields = TypeTuple::fields(total);
2439 // We don't know the number of returned values and their
2440 // types. Assume all registers available to the return convention
2441 // are used.
2442 fields[TypeFunc::Parms] = TypeRawPtr::BOTTOM;
2443 fields[TypeFunc::Parms+1] = TypeRawPtr::BOTTOM;
2444 uint i = 2;
2445 for (; i < SharedRuntime::java_return_convention_max_int+1; i++) {
2446 fields[TypeFunc::Parms+i] = TypeInt::INT;
2447 }
2448 for (; i < total; i+=2) {
2449 fields[TypeFunc::Parms+i] = Type::DOUBLE;
2450 fields[TypeFunc::Parms+i+1] = Type::HALF;
2451 }
2452 const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms + total, fields);
2453
2454 // create result type (range)
2455 fields = TypeTuple::fields(1);
2456 fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL;
2457
2458 const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+1,fields);
2459
2460 return TypeFunc::make(domain, range);
2461 }
2462
2463 JRT_BLOCK_ENTRY(void, OptoRuntime::load_unknown_inline_C(flatArrayOopDesc* array, int index, JavaThread* current))
2464 JRT_BLOCK;
2465 oop buffer = array->obj_at(index, THREAD);
2466 deoptimize_caller_frame(current, HAS_PENDING_EXCEPTION);
2467 current->set_vm_result_oop(buffer);
2468 JRT_BLOCK_END;
2469 JRT_END
2470
2471 const TypeFunc* OptoRuntime::load_unknown_inline_Type() {
2472 // create input type (domain)
2473 const Type** fields = TypeTuple::fields(2);
2474 fields[TypeFunc::Parms] = TypeOopPtr::NOTNULL;
2475 fields[TypeFunc::Parms+1] = TypeInt::POS;
2476
2477 const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+2, fields);
2478
2479 // create result type (range)
2480 fields = TypeTuple::fields(1);
2481 fields[TypeFunc::Parms] = TypeInstPtr::BOTTOM;
2482
2483 const TypeTuple* range = TypeTuple::make(TypeFunc::Parms+1, fields);
2484
2485 return TypeFunc::make(domain, range);
2486 }
2487
2488 JRT_BLOCK_ENTRY(void, OptoRuntime::store_unknown_inline_C(instanceOopDesc* buffer, flatArrayOopDesc* array, int index, JavaThread* current))
2489 JRT_BLOCK;
2490 array->obj_at_put(index, buffer, THREAD);
2491 if (HAS_PENDING_EXCEPTION) {
2492 fatal("This entry must be changed to be a non-leaf entry because writing to a flat array can now throw an exception");
2493 }
2494 JRT_BLOCK_END;
2495 JRT_END
2496
2497 const TypeFunc* OptoRuntime::store_unknown_inline_Type() {
2498 // create input type (domain)
2499 const Type** fields = TypeTuple::fields(3);
2500 fields[TypeFunc::Parms] = TypeInstPtr::NOTNULL;
2501 fields[TypeFunc::Parms+1] = TypeOopPtr::NOTNULL;
2502 fields[TypeFunc::Parms+2] = TypeInt::POS;
2503
2504 const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+3, fields);
2505
2506 // create result type (range)
2507 fields = TypeTuple::fields(0);
2508 const TypeTuple* range = TypeTuple::make(TypeFunc::Parms, fields);
2509
2510 return TypeFunc::make(domain, range);
2511 }
|