// Basic logic of a fast version of jni_Get<Primitive>Field: // // (See safepoint.hpp for a description of _safepoint_counter) // // load _safepoint_counter into old_counter // IF old_counter is odd THEN // a safepoint is going on, return jni_GetXXXField // ELSE // load the primitive field value into result (speculatively) // load _safepoint_counter into new_counter // IF (old_counter == new_counter) THEN // no safepoint happened during the field access, return result // ELSE // a safepoint might have happened in-between, return jni_GetXXXField() // ENDIF // ENDIF // // LoadLoad membars to maintain the load order may be necessary // for some platforms. // // The fast versions don't check for pending suspension request. // This is fine since it's totally read-only and doesn't create new race. // // There is a hypothetical safepoint counter wraparound. But it's not // a practical concern.
class JNI_FastGetField : AllStatic { private: enum { LIST_CAPACITY = 40 }; // a conservative number for the number of // speculative loads on all the platforms static address speculative_load_pclist []; static address slowcase_entry_pclist []; staticint count;
// If pc is in speculative_load_pclist, return the corresponding // slow case entry pc. Otherwise, return -1. // This is used by signal/exception handler to handle such case: // After an even safepoint counter is loaded and a fast field access // is about to begin, a GC kicks in and shrinks the heap. Then the // field access may fault. The signal/exception handler needs to // return to the slow case. // // The GC may decide to temporarily stuff some bad values into handles, // for example, for debugging purpose, in which case we need the mapping also. static address find_slowcase_pc(address pc);
};
#endif// SHARE_PRIMS_JNIFASTGETFIELD_HPP
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet am 2026-09-11)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.