< prev index next >

src/hotspot/share/runtime/continuation.cpp

Print this page

410 
411   st->print_cr("CONTINUATION: " PTR_FORMAT " done: %d",
412     continuation->identity_hash(), jdk_internal_vm_Continuation::done(continuation));
413   st->print_cr("CHUNKS:");
414   for (stackChunkOop chunk = cont.tail(); chunk != nullptr; chunk = chunk->parent()) {
415     st->print("* ");
416     chunk->print_on(true, st);
417   }
418 }
419 #endif // ASSERT
420 
421 
422 void continuations_init() { Continuations::init(); }
423 
424 void Continuations::init() {
425   Continuation::init();
426 }
427 
428 // While virtual threads are in Preview, there are some VM mechanisms we disable if continuations aren't used
429 bool Continuations::enabled() {
430   return VMContinuations && Arguments::enable_preview();

431 }
432 
433 #define CC (char*)  /*cast a literal from (const char*)*/
434 #define FN_PTR(f) CAST_FROM_FN_PTR(void*, &f)
435 
436 static JNINativeMethod CONT_methods[] = {
437     {CC"pin",              CC"()V",                                    FN_PTR(CONT_pin)},
438     {CC"unpin",            CC"()V",                                    FN_PTR(CONT_unpin)},
439     {CC"isPinned0",        CC"(Ljdk/internal/vm/ContinuationScope;)I", FN_PTR(CONT_isPinned0)},
440 };
441 
442 void CONT_RegisterNativeMethods(JNIEnv *env, jclass cls) {
443     Thread* thread = Thread::current();
444     assert(thread->is_Java_thread(), "");
445     ThreadToNativeFromVM trans((JavaThread*)thread);
446     int status = env->RegisterNatives(cls, CONT_methods, sizeof(CONT_methods)/sizeof(JNINativeMethod));
447     guarantee(status == JNI_OK, "register jdk.internal.vm.Continuation natives");
448     guarantee(!env->ExceptionOccurred(), "register jdk.internal.vm.Continuation natives");
449 }

410 
411   st->print_cr("CONTINUATION: " PTR_FORMAT " done: %d",
412     continuation->identity_hash(), jdk_internal_vm_Continuation::done(continuation));
413   st->print_cr("CHUNKS:");
414   for (stackChunkOop chunk = cont.tail(); chunk != nullptr; chunk = chunk->parent()) {
415     st->print("* ");
416     chunk->print_on(true, st);
417   }
418 }
419 #endif // ASSERT
420 
421 
422 void continuations_init() { Continuations::init(); }
423 
424 void Continuations::init() {
425   Continuation::init();
426 }
427 
428 // While virtual threads are in Preview, there are some VM mechanisms we disable if continuations aren't used
429 bool Continuations::enabled() {
430   // return VMContinuations && Arguments::enable_preview();
431   return VMContinuations;
432 }
433 
434 #define CC (char*)  /*cast a literal from (const char*)*/
435 #define FN_PTR(f) CAST_FROM_FN_PTR(void*, &f)
436 
437 static JNINativeMethod CONT_methods[] = {
438     {CC"pin",              CC"()V",                                    FN_PTR(CONT_pin)},
439     {CC"unpin",            CC"()V",                                    FN_PTR(CONT_unpin)},
440     {CC"isPinned0",        CC"(Ljdk/internal/vm/ContinuationScope;)I", FN_PTR(CONT_isPinned0)},
441 };
442 
443 void CONT_RegisterNativeMethods(JNIEnv *env, jclass cls) {
444     Thread* thread = Thread::current();
445     assert(thread->is_Java_thread(), "");
446     ThreadToNativeFromVM trans((JavaThread*)thread);
447     int status = env->RegisterNatives(cls, CONT_methods, sizeof(CONT_methods)/sizeof(JNINativeMethod));
448     guarantee(status == JNI_OK, "register jdk.internal.vm.Continuation natives");
449     guarantee(!env->ExceptionOccurred(), "register jdk.internal.vm.Continuation natives");
450 }
< prev index next >