mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 14:24:46 +02:00
8152634: generalize exception throwing routines in JVMCIRuntime
Reviewed-by: twisti
This commit is contained in:
parent
d39c84770b
commit
49558c8d6e
21 changed files with 198 additions and 41 deletions
|
@ -177,7 +177,13 @@ OopMap* CodeInstaller::create_oop_map(Handle debug_info, TRAPS) {
|
|||
return map;
|
||||
}
|
||||
|
||||
Metadata* CodeInstaller::record_metadata_reference(Handle constant, TRAPS) {
|
||||
void* CodeInstaller::record_metadata_reference(Handle constant, TRAPS) {
|
||||
/*
|
||||
* This method needs to return a raw (untyped) pointer, since the value of a pointer to the base
|
||||
* class is in general not equal to the pointer of the subclass. When patching metaspace pointers,
|
||||
* the compiler expects a direct pointer to the subclass (Klass*, Method* or Symbol*), not a
|
||||
* pointer to the base class (Metadata* or MetaspaceObj*).
|
||||
*/
|
||||
oop obj = HotSpotMetaspaceConstantImpl::metaspaceObject(constant);
|
||||
if (obj->is_a(HotSpotResolvedObjectTypeImpl::klass())) {
|
||||
Klass* klass = java_lang_Class::as_Klass(HotSpotResolvedObjectTypeImpl::javaClass(obj));
|
||||
|
@ -191,6 +197,11 @@ Metadata* CodeInstaller::record_metadata_reference(Handle constant, TRAPS) {
|
|||
int index = _oop_recorder->find_index(method);
|
||||
TRACE_jvmci_3("metadata[%d of %d] = %s", index, _oop_recorder->metadata_count(), method->name()->as_C_string());
|
||||
return method;
|
||||
} else if (obj->is_a(HotSpotSymbol::klass())) {
|
||||
Symbol* symbol = (Symbol*) (address) HotSpotSymbol::pointer(obj);
|
||||
assert(!HotSpotMetaspaceConstantImpl::compressed(constant), "unexpected compressed symbol pointer %s @ " INTPTR_FORMAT, symbol->as_C_string(), p2i(symbol));
|
||||
TRACE_jvmci_3("symbol = %s", symbol->as_C_string());
|
||||
return symbol;
|
||||
} else {
|
||||
JVMCI_ERROR_NULL("unexpected metadata reference for constant of type %s", obj->klass()->signature_name());
|
||||
}
|
||||
|
@ -706,7 +717,7 @@ JVMCIEnv::CodeInstallResult CodeInstaller::initialize_buffer(CodeBuffer& buffer,
|
|||
JVMCI_ERROR_OK("unexpected compressed Klass* in 32-bit mode");
|
||||
#endif
|
||||
} else {
|
||||
*((Metadata**) dest) = record_metadata_reference(constant, CHECK_OK);
|
||||
*((void**) dest) = record_metadata_reference(constant, CHECK_OK);
|
||||
}
|
||||
} else if (constant->is_a(HotSpotObjectConstantImpl::klass())) {
|
||||
Handle obj = HotSpotObjectConstantImpl::object(constant);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue