comparison src/share/vm/classfile/classFileParser.cpp @ 14518:d8041d695d19

Merged with jdk9/dev/hotspot changeset 3812c088b945
author twisti
date Tue, 11 Mar 2014 18:45:59 -0700
parents 02f27ecb4f3a 4802ce6fbff6
children 4ca6dc0799b6
comparison
equal deleted inserted replaced
14141:f97c5ec83832 14518:d8041d695d19
1 /* 1 /*
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. 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.
3744 if (!is_supported_version(major_version, minor_version)) { 3744 if (!is_supported_version(major_version, minor_version)) {
3745 if (name == NULL) { 3745 if (name == NULL) {
3746 Exceptions::fthrow( 3746 Exceptions::fthrow(
3747 THREAD_AND_LOCATION, 3747 THREAD_AND_LOCATION,
3748 vmSymbols::java_lang_UnsupportedClassVersionError(), 3748 vmSymbols::java_lang_UnsupportedClassVersionError(),
3749 "Unsupported major.minor version %u.%u", 3749 "Unsupported class file version %u.%u, "
3750 "this version of the Java Runtime only recognizes class file versions up to %u.%u",
3750 major_version, 3751 major_version,
3751 minor_version); 3752 minor_version,
3753 JAVA_MAX_SUPPORTED_VERSION,
3754 JAVA_MAX_SUPPORTED_MINOR_VERSION);
3752 } else { 3755 } else {
3753 ResourceMark rm(THREAD); 3756 ResourceMark rm(THREAD);
3754 Exceptions::fthrow( 3757 Exceptions::fthrow(
3755 THREAD_AND_LOCATION, 3758 THREAD_AND_LOCATION,
3756 vmSymbols::java_lang_UnsupportedClassVersionError(), 3759 vmSymbols::java_lang_UnsupportedClassVersionError(),
3757 "%s : Unsupported major.minor version %u.%u", 3760 "%s has been compiled by a more recent version of the Java Runtime (class file version %u.%u), "
3761 "this version of the Java Runtime only recognizes class file versions up to %u.%u",
3758 name->as_C_string(), 3762 name->as_C_string(),
3759 major_version, 3763 major_version,
3760 minor_version); 3764 minor_version,
3765 JAVA_MAX_SUPPORTED_VERSION,
3766 JAVA_MAX_SUPPORTED_MINOR_VERSION);
3761 } 3767 }
3762 return nullHandle; 3768 return nullHandle;
3763 } 3769 }
3764 3770
3765 _major_version = major_version; 3771 _major_version = major_version;
4096 // print in a single call to reduce interleaving of output 4102 // print in a single call to reduce interleaving of output
4097 if (cfs->source() != NULL) { 4103 if (cfs->source() != NULL) {
4098 tty->print("[Loaded %s from %s]\n", this_klass->external_name(), 4104 tty->print("[Loaded %s from %s]\n", this_klass->external_name(),
4099 cfs->source()); 4105 cfs->source());
4100 } else if (class_loader.is_null()) { 4106 } else if (class_loader.is_null()) {
4101 if (THREAD->is_Java_thread()) { 4107 Klass* caller =
4102 Klass* caller = ((JavaThread*)THREAD)->security_get_caller_class(1); 4108 THREAD->is_Java_thread()
4109 ? ((JavaThread*)THREAD)->security_get_caller_class(1)
4110 : NULL;
4111 // caller can be NULL, for example, during a JVMTI VM_Init hook
4112 if (caller != NULL) {
4103 tty->print("[Loaded %s by instance of %s]\n", 4113 tty->print("[Loaded %s by instance of %s]\n",
4104 this_klass->external_name(), 4114 this_klass->external_name(),
4105 InstanceKlass::cast(caller)->external_name()); 4115 InstanceKlass::cast(caller)->external_name());
4106 } else { 4116 } else {
4107 tty->print("[Loaded %s]\n", this_klass->external_name()); 4117 tty->print("[Loaded %s]\n", this_klass->external_name());
4498 super_m = InstanceKlass::cast(k)->lookup_method(name, signature); 4508 super_m = InstanceKlass::cast(k)->lookup_method(name, signature);
4499 if (super_m == NULL) { 4509 if (super_m == NULL) {
4500 break; // didn't find any match; get out 4510 break; // didn't find any match; get out
4501 } 4511 }
4502 4512
4503 if (super_m->is_final() && 4513 if (super_m->is_final() && !super_m->is_static() &&
4504 // matching method in super is final 4514 // matching method in super is final, and not static
4505 (Reflection::verify_field_access(this_klass(), 4515 (Reflection::verify_field_access(this_klass(),
4506 super_m->method_holder(), 4516 super_m->method_holder(),
4507 super_m->method_holder(), 4517 super_m->method_holder(),
4508 super_m->access_flags(), false)) 4518 super_m->access_flags(), false))
4509 // this class can access super final method and therefore override 4519 // this class can access super final method and therefore override