@@ -7997,7 +7997,7 @@ class StubGenerator: public StubCodeGenerator {
79977997
79987998
79997999 // Initialization
8000- void generate_initial () {
8000+ void generate_initial_stubs () {
80018001 // Generate initial stubs and initializes the entry points
80028002
80038003 // entry points that exist in all platforms Note: This is code
@@ -8023,6 +8023,12 @@ class StubGenerator: public StubCodeGenerator {
80238023 generate_throw_exception (" delayed StackOverflowError throw_exception" ,
80248024 CAST_FROM_FN_PTR (address,
80258025 SharedRuntime::throw_delayed_StackOverflowError));
8026+
8027+ // Initialize table for copy memory (arraycopy) check.
8028+ if (UnsafeCopyMemory::_table == nullptr ) {
8029+ UnsafeCopyMemory::create_table (8 );
8030+ }
8031+
80268032 if (UseCRC32Intrinsics) {
80278033 // set table address before stub generation which use it
80288034 StubRoutines::_crc_table_adr = (address)StubRoutines::aarch64::_crc_table;
@@ -8047,7 +8053,7 @@ class StubGenerator: public StubCodeGenerator {
80478053 }
80488054 }
80498055
8050- void generate_phase1 () {
8056+ void generate_continuation_stubs () {
80518057 // Continuation stubs:
80528058 StubRoutines::_cont_thaw = generate_cont_thaw ();
80538059 StubRoutines::_cont_returnBarrier = generate_cont_returnBarrier ();
@@ -8057,7 +8063,7 @@ class StubGenerator: public StubCodeGenerator {
80578063 JFR_ONLY (StubRoutines::_jfr_write_checkpoint = StubRoutines::_jfr_write_checkpoint_stub->entry_point ();)
80588064 }
80598065
8060- void generate_all () {
8066+ void generate_final_stubs () {
80618067 // support for verify_oop (must happen after universe_init)
80628068 if (VerifyOops) {
80638069 StubRoutines::_verify_oop_subroutine_entry = generate_verify_oop ();
@@ -8080,32 +8086,47 @@ class StubGenerator: public StubCodeGenerator {
80808086 SharedRuntime::
80818087 throw_NullPointerException_at_call));
80828088
8083- if (UseSVE == 0 ) {
8084- StubRoutines::aarch64::_vector_iota_indices = generate_iota_indices (" iota_indices" );
8085- }
8086-
80878089 // arraycopy stubs used by compilers
80888090 generate_arraycopy_stubs ();
80898091
8090- // countPositives stub for large arrays.
8091- StubRoutines::aarch64::_count_positives = generate_count_positives (StubRoutines::aarch64::_count_positives_long);
8092+ BarrierSetNMethod* bs_nm = BarrierSet::barrier_set ()->barrier_set_nmethod ();
8093+ if (bs_nm != NULL ) {
8094+ StubRoutines::aarch64::_method_entry_barrier = generate_method_entry_barrier ();
8095+ }
8096+
8097+ StubRoutines::aarch64::_spin_wait = generate_spin_wait ();
8098+
8099+ #if defined (LINUX) && !defined (__ARM_FEATURE_ATOMICS)
8100+
8101+ generate_atomic_entry_points ();
8102+
8103+ #endif // LINUX
8104+
8105+ StubRoutines::aarch64::set_completed (); // Inidicate that arraycopy and zero_blocks stubs are generated
8106+ }
8107+
8108+ void generate_compiler_stubs () {
8109+ #if COMPILER2_OR_JVMCI
8110+
8111+ if (UseSVE == 0 ) {
8112+ StubRoutines::aarch64::_vector_iota_indices = generate_iota_indices (" iota_indices" );
8113+ }
80928114
80938115 // array equals stub for large arrays.
80948116 if (!UseSimpleArrayEquals) {
80958117 StubRoutines::aarch64::_large_array_equals = generate_large_array_equals ();
80968118 }
80978119
8120+ // byte_array_inflate stub for large arrays.
8121+ StubRoutines::aarch64::_large_byte_array_inflate = generate_large_byte_array_inflate ();
8122+
8123+ // countPositives stub for large arrays.
8124+ StubRoutines::aarch64::_count_positives = generate_count_positives (StubRoutines::aarch64::_count_positives_long);
8125+
80988126 generate_compare_long_strings ();
80998127
81008128 generate_string_indexof_stubs ();
81018129
8102- // byte_array_inflate stub for large arrays.
8103- StubRoutines::aarch64::_large_byte_array_inflate = generate_large_byte_array_inflate ();
8104-
8105- BarrierSetNMethod* bs_nm = BarrierSet::barrier_set ()->barrier_set_nmethod ();
8106- if (bs_nm != NULL ) {
8107- StubRoutines::aarch64::_method_entry_barrier = generate_method_entry_barrier ();
8108- }
81098130#ifdef COMPILER2
81108131 if (UseMultiplyToLenIntrinsic) {
81118132 StubRoutines::_multiplyToLen = generate_multiplyToLen ();
@@ -8192,36 +8213,33 @@ class StubGenerator: public StubCodeGenerator {
81928213 if (UseAdler32Intrinsics) {
81938214 StubRoutines::_updateBytesAdler32 = generate_updateBytesAdler32 ();
81948215 }
8195-
8196- StubRoutines::aarch64::_spin_wait = generate_spin_wait ();
8197-
8198- #if defined (LINUX) && !defined (__ARM_FEATURE_ATOMICS)
8199-
8200- generate_atomic_entry_points ();
8201-
8202- #endif // LINUX
8203-
8204- StubRoutines::aarch64::set_completed ();
8216+ #endif // COMPILER2_OR_JVMCI
82058217 }
82068218
82078219 public:
8208- StubGenerator (CodeBuffer* code, int phase) : StubCodeGenerator(code) {
8209- if (phase == 0 ) {
8210- generate_initial ();
8211- } else if (phase == 1 ) {
8212- generate_phase1 (); // stubs that must be available for the interpreter
8213- } else {
8214- generate_all ();
8215- }
8220+ StubGenerator (CodeBuffer* code, StubsKind kind) : StubCodeGenerator(code) {
8221+ switch (kind) {
8222+ case Initial_stubs:
8223+ generate_initial_stubs ();
8224+ break ;
8225+ case Continuation_stubs:
8226+ generate_continuation_stubs ();
8227+ break ;
8228+ case Compiler_stubs:
8229+ generate_compiler_stubs ();
8230+ break ;
8231+ case Final_stubs:
8232+ generate_final_stubs ();
8233+ break ;
8234+ default :
8235+ fatal (" unexpected stubs kind: %d" , kind);
8236+ break ;
8237+ };
82168238 }
82178239}; // end class declaration
82188240
8219- #define UCM_TABLE_MAX_ENTRIES 8
8220- void StubGenerator_generate (CodeBuffer* code, int phase) {
8221- if (UnsafeCopyMemory::_table == NULL ) {
8222- UnsafeCopyMemory::create_table (UCM_TABLE_MAX_ENTRIES);
8223- }
8224- StubGenerator g (code, phase);
8241+ void StubGenerator_generate (CodeBuffer* code, StubCodeGenerator::StubsKind kind) {
8242+ StubGenerator g (code, kind);
82258243}
82268244
82278245
0 commit comments