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 //------------------------------------------------------------------------------------------------------------------------
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 outputStream* st;
771 if (logitables) {
772 st = Log(itables)::trace_stream();
773 } else {
774 st = Log(vtables)::trace_stream();
775 }
776 st->print("%s%s, compile-time-class:%s, method:%s, method_holder:%s, access_flags: ",
777 prefix,
778 (klass == NULL ? "<NULL>" : klass->internal_name()),
779 (resolved_klass == NULL ? "<NULL>" : resolved_klass->internal_name()),
780 Method::name_and_sig_as_C_string(resolved_klass,
781 method->name(),
782 method->signature()),
783 method->method_holder()->internal_name());
784 method->print_linkage_flags(st);
785 if (index != -1) {
786 st->print("vtable_index:%d", index);
787 }
788 st->cr();
789 #endif // PRODUCT
790 }
791
792 // Do linktime resolution of a method in the interface within the context of the specied bytecode.
793 methodHandle LinkResolver::resolve_interface_method(const LinkInfo& link_info, Bytecodes::Code code, TRAPS) {
794
|
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 //------------------------------------------------------------------------------------------------------------------------
751 resolved_klass,
752 resolved_method->method_holder(),
753 resolved_method,
754 CHECK_NULL);
755
756 // check loader constraints
757 check_method_loader_constraints(link_info, resolved_method, "method", CHECK_NULL);
758 }
759
760 return resolved_method;
761 }
762
763 static void trace_method_resolution(const char* prefix,
764 Klass* klass,
765 Klass* resolved_klass,
766 const methodHandle& method,
767 bool logitables,
768 int index = -1) {
769 #ifndef PRODUCT
770 ResourceMark rm;
771 Log(itables) logi;
772 LogStream lsi(logi.trace());
773 Log(vtables) logv;
774 LogStream lsv(logv.trace());
775 outputStream* st;
776 if (logitables) {
777 st = &lsi;
778 } else {
779 st = &lsv;
780 }
781 st->print("%s%s, compile-time-class:%s, method:%s, method_holder:%s, access_flags: ",
782 prefix,
783 (klass == NULL ? "<NULL>" : klass->internal_name()),
784 (resolved_klass == NULL ? "<NULL>" : resolved_klass->internal_name()),
785 Method::name_and_sig_as_C_string(resolved_klass,
786 method->name(),
787 method->signature()),
788 method->method_holder()->internal_name());
789 method->print_linkage_flags(st);
790 if (index != -1) {
791 st->print("vtable_index:%d", index);
792 }
793 st->cr();
794 #endif // PRODUCT
795 }
796
797 // Do linktime resolution of a method in the interface within the context of the specied bytecode.
798 methodHandle LinkResolver::resolve_interface_method(const LinkInfo& link_info, Bytecodes::Code code, TRAPS) {
799
|