comparison src/share/vm/opto/library_call.cpp @ 1152:cd37471eaecc

6914206: change way of permission checking for generated MethodHandle adapters Summary: Put generated MH adapter in InvokeDynamic/MethodHandle classes to be able to indentify them easily in the compiler. Reviewed-by: kvn, never, jrose
author twisti
date Fri, 08 Jan 2010 11:09:46 +0100
parents 39b01ab7035a
children d7f654633cfe
comparison
equal deleted inserted replaced
1151:1271af4ec18c 1152:cd37471eaecc
1 /* 1 /*
2 * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. 2 * Copyright 1999-2010 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 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 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
3695 return true; 3695 return true;
3696 } 3696 }
3697 3697
3698 // Helper routine for above 3698 // Helper routine for above
3699 bool LibraryCallKit::is_method_invoke_or_aux_frame(JVMState* jvms) { 3699 bool LibraryCallKit::is_method_invoke_or_aux_frame(JVMState* jvms) {
3700 ciMethod* method = jvms->method();
3701
3700 // Is this the Method.invoke method itself? 3702 // Is this the Method.invoke method itself?
3701 if (jvms->method()->intrinsic_id() == vmIntrinsics::_invoke) 3703 if (method->intrinsic_id() == vmIntrinsics::_invoke)
3702 return true; 3704 return true;
3703 3705
3704 // Is this a helper, defined somewhere underneath MethodAccessorImpl. 3706 // Is this a helper, defined somewhere underneath MethodAccessorImpl.
3705 ciKlass* k = jvms->method()->holder(); 3707 ciKlass* k = method->holder();
3706 if (k->is_instance_klass()) { 3708 if (k->is_instance_klass()) {
3707 ciInstanceKlass* ik = k->as_instance_klass(); 3709 ciInstanceKlass* ik = k->as_instance_klass();
3708 for (; ik != NULL; ik = ik->super()) { 3710 for (; ik != NULL; ik = ik->super()) {
3709 if (ik->name() == ciSymbol::sun_reflect_MethodAccessorImpl() && 3711 if (ik->name() == ciSymbol::sun_reflect_MethodAccessorImpl() &&
3710 ik == env()->find_system_klass(ik->name())) { 3712 ik == env()->find_system_klass(ik->name())) {
3711 return true; 3713 return true;
3712 } 3714 }
3713 } 3715 }
3716 }
3717 else if (method->is_method_handle_adapter()) {
3718 // This is an internal adapter frame from the MethodHandleCompiler -- skip it
3719 return true;
3714 } 3720 }
3715 3721
3716 return false; 3722 return false;
3717 } 3723 }
3718 3724