Mercurial > hg > truffle
comparison src/share/vm/runtime/reflection.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 | 4ce7240d622c |
children | c18cbe5936b8 |
comparison
equal
deleted
inserted
replaced
1151:1271af4ec18c | 1152:cd37471eaecc |
---|---|
1 /* | 1 /* |
2 * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. | 2 * Copyright 1997-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. |
480 // because one is inside the other. | 480 // because one is inside the other. |
481 if (under_host_klass(accessor_ik, accessee) || | 481 if (under_host_klass(accessor_ik, accessee) || |
482 under_host_klass(accessee_ik, accessor)) | 482 under_host_klass(accessee_ik, accessor)) |
483 return true; | 483 return true; |
484 | 484 |
485 // Adapter frames can access anything. | |
486 if (MethodHandleCompiler::klass_is_method_handle_adapter_holder(accessor)) | |
487 // This is an internal adapter frame from the MethodHandleCompiler. | |
488 return true; | |
489 | |
485 if (RelaxAccessControlCheck || | 490 if (RelaxAccessControlCheck || |
486 (accessor_ik->major_version() < JAVA_1_5_VERSION && | 491 (accessor_ik->major_version() < JAVA_1_5_VERSION && |
487 accessee_ik->major_version() < JAVA_1_5_VERSION)) { | 492 accessee_ik->major_version() < JAVA_1_5_VERSION)) { |
488 return classloader_only && | 493 return classloader_only && |
489 Verifier::relax_verify_for(accessor_ik->class_loader()) && | 494 Verifier::relax_verify_for(accessor_ik->class_loader()) && |