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, AOTStubData* stub_data); // only interface to generators
106 void UnsafeMemoryAccess::create_table(int max_size) {
107 UnsafeMemoryAccess::_table = new UnsafeMemoryAccess[max_size];
108 UnsafeMemoryAccess::_table_max_length = max_size;
109 }
110
111 bool UnsafeMemoryAccess::contains_pc(address pc) {
112 assert(UnsafeMemoryAccess::_table != nullptr, "");
113 for (int i = 0; i < UnsafeMemoryAccess::_table_length; i++) {
114 UnsafeMemoryAccess* entry = &UnsafeMemoryAccess::_table[i];
115 if (pc >= entry->start_pc() && pc < entry->end_pc()) {
116 return true;
117 }
118 }
119 return false;
120 }
121
122 address UnsafeMemoryAccess::page_error_continue_pc(address pc) {
|
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, AOTStubData* stub_data); // only interface to generators
110 void UnsafeMemoryAccess::create_table(int max_size) {
111 UnsafeMemoryAccess::_table = new UnsafeMemoryAccess[max_size];
112 UnsafeMemoryAccess::_table_max_length = max_size;
113 }
114
115 bool UnsafeMemoryAccess::contains_pc(address pc) {
116 assert(UnsafeMemoryAccess::_table != nullptr, "");
117 for (int i = 0; i < UnsafeMemoryAccess::_table_length; i++) {
118 UnsafeMemoryAccess* entry = &UnsafeMemoryAccess::_table[i];
119 if (pc >= entry->start_pc() && pc < entry->end_pc()) {
120 return true;
121 }
122 }
123 return false;
124 }
125
126 address UnsafeMemoryAccess::page_error_continue_pc(address pc) {
|