< prev index next >

src/hotspot/share/runtime/stubRoutines.cpp

Print this page

  1 /*
  2  * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
  3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  4  *
  5  * This code is free software; you can redistribute it and/or modify it
  6  * under the terms of the GNU General Public License version 2 only, as
  7  * published by the Free Software Foundation.
  8  *
  9  * This code is distributed in the hope that it will be useful, but WITHOUT
 10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 12  * version 2 for more details (a copy is included in the LICENSE file that
 13  * accompanied this code).
 14  *
 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  *

 83   assert(StubInfo::is_stubgen(id), "not a stubgen blob %s", StubInfo::name(id));
 84   return StubInfo::name(id);
 85 }
 86 
 87 const char* StubRoutines::get_stub_name(StubId id) {
 88   assert(StubInfo::is_stubgen(id), "not a stubgen stub %s", StubInfo::name(id));
 89   return StubInfo::name(id);
 90 }
 91 
 92 #ifdef ASSERT
 93 // translate a stub id to an associated blob id while checking that it
 94 // is a stubgen stub
 95 
 96 BlobId StubRoutines::stub_to_blob(StubId id) {
 97   assert(StubInfo::is_stubgen(id), "not a stubgen stub %s", StubInfo::name(id));
 98   return StubInfo::blob(id);
 99 }
100 
101 #endif // ASSERT
102 




103 // Initialization
104 
105 extern void StubGenerator_generate(CodeBuffer* code, BlobId blob_id); // only interface to generators
106 
107 void UnsafeMemoryAccess::create_table(int max_size) {
108   UnsafeMemoryAccess::_table = new UnsafeMemoryAccess[max_size];
109   UnsafeMemoryAccess::_table_max_length = max_size;
110 }
111 
112 bool UnsafeMemoryAccess::contains_pc(address pc) {
113   assert(UnsafeMemoryAccess::_table != nullptr, "");
114   for (int i = 0; i < UnsafeMemoryAccess::_table_length; i++) {
115     UnsafeMemoryAccess* entry = &UnsafeMemoryAccess::_table[i];
116     if (pc >= entry->start_pc() && pc < entry->end_pc()) {
117       return true;
118     }
119   }
120   return false;
121 }
122 

  1 /*
  2  * Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
  3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  4  *
  5  * This code is free software; you can redistribute it and/or modify it
  6  * under the terms of the GNU General Public License version 2 only, as
  7  * published by the Free Software Foundation.
  8  *
  9  * This code is distributed in the hope that it will be useful, but WITHOUT
 10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 12  * version 2 for more details (a copy is included in the LICENSE file that
 13  * accompanied this code).
 14  *
 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  *

 83   assert(StubInfo::is_stubgen(id), "not a stubgen blob %s", StubInfo::name(id));
 84   return StubInfo::name(id);
 85 }
 86 
 87 const char* StubRoutines::get_stub_name(StubId id) {
 88   assert(StubInfo::is_stubgen(id), "not a stubgen stub %s", StubInfo::name(id));
 89   return StubInfo::name(id);
 90 }
 91 
 92 #ifdef ASSERT
 93 // translate a stub id to an associated blob id while checking that it
 94 // is a stubgen stub
 95 
 96 BlobId StubRoutines::stub_to_blob(StubId id) {
 97   assert(StubInfo::is_stubgen(id), "not a stubgen stub %s", StubInfo::name(id));
 98   return StubInfo::blob(id);
 99 }
100 
101 #endif // ASSERT
102 
103 // TODO: update with 8343767
104 address StubRoutines::_load_inline_type_fields_in_regs = nullptr;
105 address StubRoutines::_store_inline_type_fields_to_buf = nullptr;
106 
107 // Initialization
108 
109 extern void StubGenerator_generate(CodeBuffer* code, BlobId blob_id); // only interface to generators
110 
111 void UnsafeMemoryAccess::create_table(int max_size) {
112   UnsafeMemoryAccess::_table = new UnsafeMemoryAccess[max_size];
113   UnsafeMemoryAccess::_table_max_length = max_size;
114 }
115 
116 bool UnsafeMemoryAccess::contains_pc(address pc) {
117   assert(UnsafeMemoryAccess::_table != nullptr, "");
118   for (int i = 0; i < UnsafeMemoryAccess::_table_length; i++) {
119     UnsafeMemoryAccess* entry = &UnsafeMemoryAccess::_table[i];
120     if (pc >= entry->start_pc() && pc < entry->end_pc()) {
121       return true;
122     }
123   }
124   return false;
125 }
126 
< prev index next >