提交 71655535 编写于 作者: H hseigel

8015385: Remove RelaxAccessControlCheck for JDK 8 bytecodes

Summary: Check bytecode versions along with RelaxAccessControlCheck version
Reviewed-by: dholmes, acorn
上级 96bb391e
...@@ -36,8 +36,10 @@ ...@@ -36,8 +36,10 @@
class Verifier : AllStatic { class Verifier : AllStatic {
public: public:
enum { enum {
STRICTER_ACCESS_CTRL_CHECK_VERSION = 49,
STACKMAP_ATTRIBUTE_MAJOR_VERSION = 50, STACKMAP_ATTRIBUTE_MAJOR_VERSION = 50,
INVOKEDYNAMIC_MAJOR_VERSION = 51 INVOKEDYNAMIC_MAJOR_VERSION = 51,
NO_RELAX_ACCESS_CTRL_CHECK_VERSION = 52
}; };
typedef enum { ThrowException, NoException } Mode; typedef enum { ThrowException, NoException } Mode;
......
...@@ -44,8 +44,6 @@ ...@@ -44,8 +44,6 @@
#include "runtime/signature.hpp" #include "runtime/signature.hpp"
#include "runtime/vframe.hpp" #include "runtime/vframe.hpp"
#define JAVA_1_5_VERSION 49
static void trace_class_resolution(Klass* to_class) { static void trace_class_resolution(Klass* to_class) {
ResourceMark rm; ResourceMark rm;
int line_number = -1; int line_number = -1;
...@@ -507,9 +505,11 @@ bool Reflection::can_relax_access_check_for( ...@@ -507,9 +505,11 @@ bool Reflection::can_relax_access_check_for(
under_host_klass(accessee_ik, accessor)) under_host_klass(accessee_ik, accessor))
return true; return true;
if (RelaxAccessControlCheck || if ((RelaxAccessControlCheck &&
(accessor_ik->major_version() < JAVA_1_5_VERSION && accessor_ik->major_version() < Verifier::NO_RELAX_ACCESS_CTRL_CHECK_VERSION &&
accessee_ik->major_version() < JAVA_1_5_VERSION)) { accessee_ik->major_version() < Verifier::NO_RELAX_ACCESS_CTRL_CHECK_VERSION) ||
(accessor_ik->major_version() < Verifier::STRICTER_ACCESS_CTRL_CHECK_VERSION &&
accessee_ik->major_version() < Verifier::STRICTER_ACCESS_CTRL_CHECK_VERSION)) {
return classloader_only && return classloader_only &&
Verifier::relax_verify_for(accessor_ik->class_loader()) && Verifier::relax_verify_for(accessor_ik->class_loader()) &&
accessor_ik->protection_domain() == accessee_ik->protection_domain() && accessor_ik->protection_domain() == accessee_ik->protection_domain() &&
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册