17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "classfile/defaultMethods.hpp"
27 #include "classfile/javaClasses.hpp"
28 #include "classfile/symbolTable.hpp"
29 #include "classfile/systemDictionary.hpp"
30 #include "classfile/vmSymbols.hpp"
31 #include "compiler/compileBroker.hpp"
32 #include "gc/shared/collectedHeap.inline.hpp"
33 #include "interpreter/bytecode.hpp"
34 #include "interpreter/interpreterRuntime.hpp"
35 #include "interpreter/linkResolver.hpp"
36 #include "logging/log.hpp"
37 #include "memory/resourceArea.hpp"
38 #include "memory/universe.inline.hpp"
39 #include "oops/instanceKlass.hpp"
40 #include "oops/method.hpp"
41 #include "oops/objArrayOop.hpp"
42 #include "oops/oop.inline.hpp"
43 #include "prims/jvm.h"
44 #include "prims/methodHandles.hpp"
45 #include "prims/nativeLookup.hpp"
46 #include "runtime/compilationPolicy.hpp"
47 #include "runtime/fieldDescriptor.hpp"
48 #include "runtime/frame.inline.hpp"
49 #include "runtime/handles.inline.hpp"
50 #include "runtime/reflection.hpp"
51 #include "runtime/signature.hpp"
52 #include "runtime/thread.inline.hpp"
53 #include "runtime/vmThread.hpp"
54
55
56 //------------------------------------------------------------------------------------------------------------------------
749 resolved_klass,
750 resolved_method->method_holder(),
751 resolved_method,
752 CHECK_NULL);
753
754 // check loader constraints
755 check_method_loader_constraints(link_info, resolved_method, "method", CHECK_NULL);
756 }
757
758 return resolved_method;
759 }
760
761 static void trace_method_resolution(const char* prefix,
762 Klass* klass,
763 Klass* resolved_klass,
764 const methodHandle& method,
765 bool logitables,
766 int index = -1) {
767 #ifndef PRODUCT
768 ResourceMark rm;
769 outputStream* st;
770 if (logitables) {
771 st = Log(itables)::trace_stream();
772 } else {
773 st = Log(vtables)::trace_stream();
774 }
775 st->print("%s%s, compile-time-class:%s, method:%s, method_holder:%s, access_flags: ",
776 prefix,
777 (klass == NULL ? "<NULL>" : klass->internal_name()),
778 (resolved_klass == NULL ? "<NULL>" : resolved_klass->internal_name()),
779 Method::name_and_sig_as_C_string(resolved_klass,
780 method->name(),
781 method->signature()),
782 method->method_holder()->internal_name());
783 method->print_linkage_flags(st);
784 if (index != -1) {
785 st->print("vtable_index:%d", index);
786 }
787 st->cr();
788 #endif // PRODUCT
789 }
790
791 // Do linktime resolution of a method in the interface within the context of the specied bytecode.
792 methodHandle LinkResolver::resolve_interface_method(const LinkInfo& link_info, Bytecodes::Code code, TRAPS) {
793
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "classfile/defaultMethods.hpp"
27 #include "classfile/javaClasses.hpp"
28 #include "classfile/symbolTable.hpp"
29 #include "classfile/systemDictionary.hpp"
30 #include "classfile/vmSymbols.hpp"
31 #include "compiler/compileBroker.hpp"
32 #include "gc/shared/collectedHeap.inline.hpp"
33 #include "interpreter/bytecode.hpp"
34 #include "interpreter/interpreterRuntime.hpp"
35 #include "interpreter/linkResolver.hpp"
36 #include "logging/log.hpp"
37 #include "logging/logStream.hpp"
38 #include "memory/resourceArea.hpp"
39 #include "memory/universe.inline.hpp"
40 #include "oops/instanceKlass.hpp"
41 #include "oops/method.hpp"
42 #include "oops/objArrayOop.hpp"
43 #include "oops/oop.inline.hpp"
44 #include "prims/jvm.h"
45 #include "prims/methodHandles.hpp"
46 #include "prims/nativeLookup.hpp"
47 #include "runtime/compilationPolicy.hpp"
48 #include "runtime/fieldDescriptor.hpp"
49 #include "runtime/frame.inline.hpp"
50 #include "runtime/handles.inline.hpp"
51 #include "runtime/reflection.hpp"
52 #include "runtime/signature.hpp"
53 #include "runtime/thread.inline.hpp"
54 #include "runtime/vmThread.hpp"
55
56
57 //------------------------------------------------------------------------------------------------------------------------
750 resolved_klass,
751 resolved_method->method_holder(),
752 resolved_method,
753 CHECK_NULL);
754
755 // check loader constraints
756 check_method_loader_constraints(link_info, resolved_method, "method", CHECK_NULL);
757 }
758
759 return resolved_method;
760 }
761
762 static void trace_method_resolution(const char* prefix,
763 Klass* klass,
764 Klass* resolved_klass,
765 const methodHandle& method,
766 bool logitables,
767 int index = -1) {
768 #ifndef PRODUCT
769 ResourceMark rm;
770 Log(itables) logi;
771 LogStream lsi(logi.trace());
772 Log(vtables) logv;
773 LogStream lsv(logv.trace());
774 outputStream* st;
775 if (logitables) {
776 st = &lsi;
777 } else {
778 st = &lsv;
779 }
780 st->print("%s%s, compile-time-class:%s, method:%s, method_holder:%s, access_flags: ",
781 prefix,
782 (klass == NULL ? "<NULL>" : klass->internal_name()),
783 (resolved_klass == NULL ? "<NULL>" : resolved_klass->internal_name()),
784 Method::name_and_sig_as_C_string(resolved_klass,
785 method->name(),
786 method->signature()),
787 method->method_holder()->internal_name());
788 method->print_linkage_flags(st);
789 if (index != -1) {
790 st->print("vtable_index:%d", index);
791 }
792 st->cr();
793 #endif // PRODUCT
794 }
795
796 // Do linktime resolution of a method in the interface within the context of the specied bytecode.
797 methodHandle LinkResolver::resolve_interface_method(const LinkInfo& link_info, Bytecodes::Code code, TRAPS) {
798
|