< prev index next >

src/hotspot/share/classfile/javaClasses.cpp

Print this page

1969 bool java_lang_VirtualThread::is_instance(oop obj) {
1970   return obj != nullptr && is_subclass(obj->klass());
1971 }
1972 
1973 oop java_lang_VirtualThread::carrier_thread(oop vthread) {
1974   oop thread = vthread->obj_field(_carrierThread_offset);
1975   return thread;
1976 }
1977 
1978 oop java_lang_VirtualThread::continuation(oop vthread) {
1979   oop cont = vthread->obj_field(_continuation_offset);
1980   return cont;
1981 }
1982 
1983 int java_lang_VirtualThread::state(oop vthread) {
1984   return vthread->int_field_acquire(_state_offset);
1985 }
1986 
1987 JavaThreadStatus java_lang_VirtualThread::map_state_to_thread_status(int state) {
1988   JavaThreadStatus status = JavaThreadStatus::NEW;
1989   switch (state) {
1990     case NEW :
1991       status = JavaThreadStatus::NEW;
1992       break;
1993     case STARTED :
1994     case RUNNABLE :
1995     case RUNNABLE_SUSPENDED :
1996     case RUNNING :
1997     case PARKING :
1998     case YIELDING :

1999       status = JavaThreadStatus::RUNNABLE;
2000       break;
2001     case PARKED :
2002     case PARKED_SUSPENDED :
2003     case PINNED :
2004       status = JavaThreadStatus::PARKED;
2005       break;
2006     case TERMINATED :




2007       status = JavaThreadStatus::TERMINATED;
2008       break;
2009     default:
2010       ShouldNotReachHere();
2011   }
2012   return status;
2013 }
2014 
2015 #if INCLUDE_CDS
2016 void java_lang_VirtualThread::serialize_offsets(SerializeClosure* f) {
2017    VTHREAD_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
2018 }
2019 #endif
2020 
2021 // java_lang_Throwable
2022 
2023 int java_lang_Throwable::_backtrace_offset;
2024 int java_lang_Throwable::_detailMessage_offset;
2025 int java_lang_Throwable::_stackTrace_offset;
2026 int java_lang_Throwable::_depth_offset;

1969 bool java_lang_VirtualThread::is_instance(oop obj) {
1970   return obj != nullptr && is_subclass(obj->klass());
1971 }
1972 
1973 oop java_lang_VirtualThread::carrier_thread(oop vthread) {
1974   oop thread = vthread->obj_field(_carrierThread_offset);
1975   return thread;
1976 }
1977 
1978 oop java_lang_VirtualThread::continuation(oop vthread) {
1979   oop cont = vthread->obj_field(_continuation_offset);
1980   return cont;
1981 }
1982 
1983 int java_lang_VirtualThread::state(oop vthread) {
1984   return vthread->int_field_acquire(_state_offset);
1985 }
1986 
1987 JavaThreadStatus java_lang_VirtualThread::map_state_to_thread_status(int state) {
1988   JavaThreadStatus status = JavaThreadStatus::NEW;
1989   switch (state & ~SUSPENDED) {
1990     case NEW:
1991       status = JavaThreadStatus::NEW;
1992       break;
1993     case STARTED:
1994     case RUNNING:
1995     case PARKING:
1996     case TIMED_PARKING:
1997     case UNPARKED:
1998     case YIELDING:
1999     case YIELDED:
2000       status = JavaThreadStatus::RUNNABLE;
2001       break;
2002     case PARKED:
2003     case PINNED:

2004       status = JavaThreadStatus::PARKED;
2005       break;
2006     case TIMED_PARKED:
2007     case TIMED_PINNED:
2008       status = JavaThreadStatus::PARKED_TIMED;
2009       break;
2010     case TERMINATED:
2011       status = JavaThreadStatus::TERMINATED;
2012       break;
2013     default:
2014       ShouldNotReachHere();
2015   }
2016   return status;
2017 }
2018 
2019 #if INCLUDE_CDS
2020 void java_lang_VirtualThread::serialize_offsets(SerializeClosure* f) {
2021    VTHREAD_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
2022 }
2023 #endif
2024 
2025 // java_lang_Throwable
2026 
2027 int java_lang_Throwable::_backtrace_offset;
2028 int java_lang_Throwable::_detailMessage_offset;
2029 int java_lang_Throwable::_stackTrace_offset;
2030 int java_lang_Throwable::_depth_offset;
< prev index next >