comparison src/share/vm/runtime/reflection.cpp @ 14392:b5c8a61d7fa0

Merge
author kvn
date Fri, 21 Jun 2013 15:56:24 -0700
parents 4552a7633a07
children c1bd7b5bdc70
comparison
equal deleted inserted replaced
14391:d2907f74462e 14392:b5c8a61d7fa0
1 /* 1 /*
2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2013, 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.
42 #include "runtime/reflection.hpp" 42 #include "runtime/reflection.hpp"
43 #include "runtime/reflectionUtils.hpp" 43 #include "runtime/reflectionUtils.hpp"
44 #include "runtime/signature.hpp" 44 #include "runtime/signature.hpp"
45 #include "runtime/vframe.hpp" 45 #include "runtime/vframe.hpp"
46 46
47 #define JAVA_1_5_VERSION 49
48
49 static void trace_class_resolution(Klass* to_class) { 47 static void trace_class_resolution(Klass* to_class) {
50 ResourceMark rm; 48 ResourceMark rm;
51 int line_number = -1; 49 int line_number = -1;
52 const char * source_file = NULL; 50 const char * source_file = NULL;
53 Klass* caller = NULL; 51 Klass* caller = NULL;
373 } 371 }
374 dim += k_dim; 372 dim += k_dim;
375 } 373 }
376 } 374 }
377 klass = klass->array_klass(dim, CHECK_NULL); 375 klass = klass->array_klass(dim, CHECK_NULL);
378 oop obj = ArrayKlass::cast(klass)->multi_allocate(len, dimensions, THREAD); 376 oop obj = ArrayKlass::cast(klass)->multi_allocate(len, dimensions, CHECK_NULL);
379 assert(obj->is_array(), "just checking"); 377 assert(obj->is_array(), "just checking");
380 return arrayOop(obj); 378 return arrayOop(obj);
381 } 379 }
382 380
383 381
505 // because one is inside the other. 503 // because one is inside the other.
506 if (under_host_klass(accessor_ik, accessee) || 504 if (under_host_klass(accessor_ik, accessee) ||
507 under_host_klass(accessee_ik, accessor)) 505 under_host_klass(accessee_ik, accessor))
508 return true; 506 return true;
509 507
510 if (RelaxAccessControlCheck || 508 if ((RelaxAccessControlCheck &&
511 (accessor_ik->major_version() < JAVA_1_5_VERSION && 509 accessor_ik->major_version() < Verifier::NO_RELAX_ACCESS_CTRL_CHECK_VERSION &&
512 accessee_ik->major_version() < JAVA_1_5_VERSION)) { 510 accessee_ik->major_version() < Verifier::NO_RELAX_ACCESS_CTRL_CHECK_VERSION) ||
511 (accessor_ik->major_version() < Verifier::STRICTER_ACCESS_CTRL_CHECK_VERSION &&
512 accessee_ik->major_version() < Verifier::STRICTER_ACCESS_CTRL_CHECK_VERSION)) {
513 return classloader_only && 513 return classloader_only &&
514 Verifier::relax_verify_for(accessor_ik->class_loader()) && 514 Verifier::relax_verify_for(accessor_ik->class_loader()) &&
515 accessor_ik->protection_domain() == accessee_ik->protection_domain() && 515 accessor_ik->protection_domain() == accessee_ik->protection_domain() &&
516 accessor_ik->class_loader() == accessee_ik->class_loader(); 516 accessor_ik->class_loader() == accessee_ik->class_loader();
517 } else { 517 } else {
814 java_lang_reflect_Constructor::set_annotations(ch(), an_oop); 814 java_lang_reflect_Constructor::set_annotations(ch(), an_oop);
815 } 815 }
816 if (java_lang_reflect_Constructor::has_parameter_annotations_field()) { 816 if (java_lang_reflect_Constructor::has_parameter_annotations_field()) {
817 typeArrayOop an_oop = Annotations::make_java_array(method->parameter_annotations(), CHECK_NULL); 817 typeArrayOop an_oop = Annotations::make_java_array(method->parameter_annotations(), CHECK_NULL);
818 java_lang_reflect_Constructor::set_parameter_annotations(ch(), an_oop); 818 java_lang_reflect_Constructor::set_parameter_annotations(ch(), an_oop);
819 }
820 if (java_lang_reflect_Constructor::has_type_annotations_field()) {
821 typeArrayOop an_oop = Annotations::make_java_array(method->type_annotations(), CHECK_NULL);
822 java_lang_reflect_Constructor::set_type_annotations(ch(), an_oop);
819 } 823 }
820 return ch(); 824 return ch();
821 } 825 }
822 826
823 827