mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8175932: Improve host instance supports
Reviewed-by: coleenp, mschoene
This commit is contained in:
parent
979cec24f8
commit
dd5b1ee367
2 changed files with 6 additions and 1 deletions
|
@ -804,7 +804,7 @@ void InterpreterRuntime::resolve_invoke(JavaThread* thread, Bytecodes::Code byte
|
||||||
// it is not an interface. The receiver for invokespecial calls within interface
|
// it is not an interface. The receiver for invokespecial calls within interface
|
||||||
// methods must be checked for every call.
|
// methods must be checked for every call.
|
||||||
InstanceKlass* sender = pool->pool_holder();
|
InstanceKlass* sender = pool->pool_holder();
|
||||||
sender = sender->is_anonymous() ? sender->host_klass() : sender;
|
sender = sender->has_host_klass() ? sender->host_klass() : sender;
|
||||||
|
|
||||||
switch (info.call_kind()) {
|
switch (info.call_kind()) {
|
||||||
case CallInfo::direct_call:
|
case CallInfo::direct_call:
|
||||||
|
|
|
@ -609,9 +609,11 @@ class InstanceKlass: public Klass {
|
||||||
InstanceKlass* host_klass() const {
|
InstanceKlass* host_klass() const {
|
||||||
InstanceKlass** hk = adr_host_klass();
|
InstanceKlass** hk = adr_host_klass();
|
||||||
if (hk == NULL) {
|
if (hk == NULL) {
|
||||||
|
assert(!is_anonymous(), "Anonymous classes have host klasses");
|
||||||
return NULL;
|
return NULL;
|
||||||
} else {
|
} else {
|
||||||
assert(*hk != NULL, "host klass should always be set if the address is not null");
|
assert(*hk != NULL, "host klass should always be set if the address is not null");
|
||||||
|
assert(is_anonymous(), "Only anonymous classes have host klasses");
|
||||||
return *hk;
|
return *hk;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -623,6 +625,9 @@ class InstanceKlass: public Klass {
|
||||||
*addr = host;
|
*addr = host;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
bool has_host_klass() const {
|
||||||
|
return adr_host_klass() != NULL;
|
||||||
|
}
|
||||||
bool is_anonymous() const {
|
bool is_anonymous() const {
|
||||||
return (_misc_flags & _misc_is_anonymous) != 0;
|
return (_misc_flags & _misc_is_anonymous) != 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue