提交 6370beff 编写于 作者: A asaha

Merge

......@@ -565,6 +565,7 @@ e13839545238d1ecf17f0489bb6fb765de46719a jdk8u31-b12
4206e725d584be942c25ff46ff23d8e299ca4a4c jdk8u31-b13
b517d3a9aebf0fee64808f9a7c0ef8e0b82d5ed3 jdk8u31-b31
15d8108258cb60a58bdd03b9ff8e77dd6727a804 jdk8u31-b32
26b1dc6891c4fae03575a9090f7d04bd631d9164 jdk8u31-b33
1b3abbeee961dee49780c0e4af5337feb918c555 jdk8u40-b10
f10fe402dfb1543723b4b117a7cba3ea3d4159f1 hs25.40-b15
99372b2fee0eb8b3452f47230e84aa6e97003184 jdk8u40-b11
......@@ -594,6 +595,8 @@ fa4e797f61e6dda1a60e06944018213bff2a1b76 jdk8u40-b24
698dd28ecc785ffc43e3f12266b13e85382c26a8 jdk8u40-b25
f39b6944ad447269b81e06ca5da9edff9e9e67c8 jdk8u40-b26
6824e2475e0432e27f9cc51838bc34ea5fbf5113 jdk8u40-b27
8220f68a195f6eeed2f5fb6e8a303726b512e899 jdk8u40-b31
850a290eb1088a61178d1910c500e170ef4f4386 jdk8u40-b32
b95f13f05f553309cd74d6ccf8fcedb259c6716c jdk8u45-b00
41c3c456e326185053f0654be838f4b0bfb38078 jdk8u45-b01
626fd8c2eec63e2a2dff3839bfe12c0431bf00a4 jdk8u45-b02
......@@ -609,6 +612,24 @@ f4822d12204179e6a3e7aaf98991b6171670cbf2 jdk8u45-b11
dc29108bcbcbfcd49eaa9135368306dc85db73a6 jdk8u45-b12
efbf340fc7f56e49735111c23cef030413146409 jdk8u45-b13
5321d26956b283b7cb73b04b91db41c7c9fe9158 jdk8u45-b14
a5ba7c9a0b916ea088aaac5d40e17b4675c2b026 jdk8u45-b15
894b92a02c533bcd1203c4beb5b6ec067b63466e jdk8u45-b31
1428b6aa09c4e17202b801530c3c4993c7ce8e5b jdk8u45-b32
b22b01407a8140041545afe1f2d6335db4d94ba5 jdk8u51-b00
c1de2652a48c1d4a0c96707acc73db3cd317df2a jdk8u51-b01
8f03c2f5fc170da5fca2cf65734941efb619feca jdk8u51-b02
cf295659243009ded76b6c14307c177a02f9fe82 jdk8u51-b03
0b3f449553884d88f6c9d7ab067fa858f18cc3f1 jdk8u51-b04
6ce994385353023e6b3f9c5ef331f390b324a355 jdk8u51-b05
3816de51b5e7d6050584057fae5f2262dae53d7e jdk8u51-b06
5c017acbaf015fb8ecca6f00870965f3deb4e1ac jdk8u51-b07
631d4029d851b59613e6748e17447001a682276e jdk8u51-b08
ce81c4487dd1e9f89d4570a8cd25e349f6bae00d jdk8u51-b09
928e1994ad43272f808ca22b9cc1b08a7ce2824f jdk8u51-b10
1a122beb9dc6881850ef1d1250f40a83709b8b72 jdk8u51-b11
05c80f1060f0c0d5720de9eadd09162af1168eab jdk8u51-b12
07e103f3f43886a3b47945e5295eb5accad505de jdk8u51-b13
a4eea4bee2d4fdb05f1a8358d70ec6adb1135526 jdk8u51-b14
d9349fa8822336e0244da0a8448f3e6b2d62741d jdk8u60-b00
d9349fa8822336e0244da0a8448f3e6b2d62741d hs25.60-b00
ebf89088c08ab0508b9002b48dd3d68a340259af hs25.60-b01
......
......@@ -2189,7 +2189,15 @@ void LIRGenerator::do_UnsafePutRaw(UnsafePutRaw* x) {
if (log2_scale != 0) {
// temporary fix (platform dependent code without shift on Intel would be better)
// TODO: ARM also allows embedded shift in the address
__ shift_left(index_op, log2_scale, index_op);
LIR_Opr tmp = new_pointer_register();
if (TwoOperandLIRForm) {
__ move(index_op, tmp);
index_op = tmp;
}
__ shift_left(index_op, log2_scale, tmp);
if (!TwoOperandLIRForm) {
index_op = tmp;
}
}
LIR_Address* addr = new LIR_Address(base_op, index_op, x->basic_type());
......
......@@ -2349,9 +2349,6 @@ methodHandle SystemDictionary::find_method_handle_invoker(Symbol* name,
assert(!THREAD->is_Compiler_thread(), "");
Handle method_type =
SystemDictionary::find_method_handle_type(signature, accessing_klass, CHECK_(empty));
if (false) { // FIXME: Decide if the Java upcall should resolve signatures.
method_type = java_lang_String::create_from_symbol(signature, CHECK_(empty));
}
KlassHandle mh_klass = SystemDictionary::MethodHandle_klass();
int ref_kind = JVM_REF_invokeVirtual;
......@@ -2383,6 +2380,24 @@ methodHandle SystemDictionary::find_method_handle_invoker(Symbol* name,
return unpack_method_and_appendix(mname, accessing_klass, appendix_box, appendix_result, THREAD);
}
// Decide if we can globally cache a lookup of this class, to be returned to any client that asks.
// We must ensure that all class loaders everywhere will reach this class, for any client.
// This is a safe bet for public classes in java.lang, such as Object and String.
// We also include public classes in java.lang.invoke, because they appear frequently in system-level method types.
// Out of an abundance of caution, we do not include any other classes, not even for packages like java.util.
static bool is_always_visible_class(oop mirror) {
Klass* klass = java_lang_Class::as_Klass(mirror);
if (klass->oop_is_objArray()) {
klass = ObjArrayKlass::cast(klass)->bottom_klass(); // check element type
}
if (klass->oop_is_typeArray()) {
return true; // primitive array
}
assert(klass->oop_is_instance(), klass->external_name());
return klass->is_public() &&
(InstanceKlass::cast(klass)->is_same_class_package(SystemDictionary::Object_klass()) || // java.lang
InstanceKlass::cast(klass)->is_same_class_package(SystemDictionary::MethodHandle_klass())); // java.lang.invoke
}
// Ask Java code to find or construct a java.lang.invoke.MethodType for the given
// signature, as interpreted relative to the given class loader.
......@@ -2405,7 +2420,11 @@ Handle SystemDictionary::find_method_handle_type(Symbol* signature,
}
Handle class_loader, protection_domain;
bool is_on_bcp = true; // keep this true as long as we can materialize from the boot classloader
if (accessing_klass.not_null()) {
class_loader = Handle(THREAD, InstanceKlass::cast(accessing_klass())->class_loader());
protection_domain = Handle(THREAD, InstanceKlass::cast(accessing_klass())->protection_domain());
}
bool can_be_cached = true;
int npts = ArgumentCount(signature).size();
objArrayHandle pts = oopFactory::new_objArray(SystemDictionary::Class_klass(), npts, CHECK_(empty));
int arg = 0;
......@@ -2413,24 +2432,21 @@ Handle SystemDictionary::find_method_handle_type(Symbol* signature,
ResourceMark rm(THREAD);
for (SignatureStream ss(signature); !ss.is_done(); ss.next()) {
oop mirror = NULL;
if (is_on_bcp) {
// Note: class_loader & protection_domain are both null at this point.
mirror = ss.as_java_mirror(class_loader, protection_domain,
if (can_be_cached) {
// Use neutral class loader to lookup candidate classes to be placed in the cache.
mirror = ss.as_java_mirror(Handle(), Handle(),
SignatureStream::ReturnNull, CHECK_(empty));
if (mirror == NULL) {
// fall back from BCP to accessing_klass
if (accessing_klass.not_null()) {
class_loader = Handle(THREAD, InstanceKlass::cast(accessing_klass())->class_loader());
protection_domain = Handle(THREAD, InstanceKlass::cast(accessing_klass())->protection_domain());
}
is_on_bcp = false;
if (mirror == NULL || (ss.is_object() && !is_always_visible_class(mirror))) {
// Fall back to accessing_klass context.
can_be_cached = false;
}
}
if (!is_on_bcp) {
if (!can_be_cached) {
// Resolve, throwing a real error if it doesn't work.
mirror = ss.as_java_mirror(class_loader, protection_domain,
SignatureStream::NCDFError, CHECK_(empty));
}
assert(!oopDesc::is_null(mirror), ss.as_symbol(THREAD)->as_C_string());
if (ss.at_return_type())
rt = Handle(THREAD, mirror);
else
......@@ -2462,7 +2478,7 @@ Handle SystemDictionary::find_method_handle_type(Symbol* signature,
&args, CHECK_(empty));
Handle method_type(THREAD, (oop) result.get_jobject());
if (is_on_bcp) {
if (can_be_cached) {
// We can cache this MethodType inside the JVM.
MutexLocker ml(SystemDictionary_lock, THREAD);
spe = invoke_method_table()->find_entry(index, hash, signature, null_iid);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册