8223320: [AOT] jck test api/javax_script/ScriptEngine/PutGet.html fails when test classes are AOTed

Materialization of primitive boxes should use caches

Reviewed-by: kvn, never
This commit is contained in:
Igor Veresov 2019-06-03 13:21:02 -07:00
parent 7d63888ac8
commit e47daab7b4
18 changed files with 666 additions and 26 deletions

View file

@ -988,9 +988,11 @@ GrowableArray<ScopeValue*>* CodeInstaller::record_virtual_objects(JVMCIObject de
JVMCIObject value = JVMCIENV->get_object_at(virtualObjects, i);
int id = jvmci_env()->get_VirtualObject_id(value);
JVMCIObject type = jvmci_env()->get_VirtualObject_type(value);
bool is_auto_box = jvmci_env()->get_VirtualObject_isAutoBox(value);
Klass* klass = jvmci_env()->asKlass(type);
oop javaMirror = klass->java_mirror();
ObjectValue* sv = new ObjectValue(id, new ConstantOopWriteValue(JNIHandles::make_local(Thread::current(), javaMirror)));
ScopeValue *klass_sv = new ConstantOopWriteValue(JNIHandles::make_local(Thread::current(), javaMirror));
ObjectValue* sv = is_auto_box ? new AutoBoxObjectValue(id, klass_sv) : new ObjectValue(id, klass_sv);
if (id < 0 || id >= objects->length()) {
JVMCI_ERROR_NULL("virtual object id %d out of bounds", id);
}