85
86 symbolOop Bytecode_invoke::name() const {
87 constantPoolOop constants = method()->constants();
88 return constants->name_ref_at(index());
89 }
90
91
92 BasicType Bytecode_invoke::result_type(Thread *thread) const {
93 symbolHandle sh(thread, signature());
94 ResultTypeFinder rts(sh);
95 rts.iterate();
96 return rts.type();
97 }
98
99
100 methodHandle Bytecode_invoke::static_target(TRAPS) {
101 methodHandle m;
102 KlassHandle resolved_klass;
103 constantPoolHandle constants(THREAD, _method->constants());
104
105 if (adjusted_invoke_code() != Bytecodes::_invokeinterface) {
106 LinkResolver::resolve_method(m, resolved_klass, constants, index(), CHECK_(methodHandle()));
107 } else {
108 LinkResolver::resolve_interface_method(m, resolved_klass, constants, index(), CHECK_(methodHandle()));
109 }
110 return m;
111 }
112
113
114 int Bytecode_invoke::index() const {
115 // Note: Rewriter::rewrite changes the Java_u2 of an invokedynamic to a native_u4,
116 // at the same time it allocates per-call-site CP cache entries.
117 if (has_giant_index())
118 return Bytes::get_native_u4(bcp() + 1);
119 else
120 return Bytes::get_Java_u2(bcp() + 1);
121 }
122
123
124 // Implementation of Bytecode_static
125
|
85
86 symbolOop Bytecode_invoke::name() const {
87 constantPoolOop constants = method()->constants();
88 return constants->name_ref_at(index());
89 }
90
91
92 BasicType Bytecode_invoke::result_type(Thread *thread) const {
93 symbolHandle sh(thread, signature());
94 ResultTypeFinder rts(sh);
95 rts.iterate();
96 return rts.type();
97 }
98
99
100 methodHandle Bytecode_invoke::static_target(TRAPS) {
101 methodHandle m;
102 KlassHandle resolved_klass;
103 constantPoolHandle constants(THREAD, _method->constants());
104
105 if (adjusted_invoke_code() == Bytecodes::_invokedynamic) {
106 LinkResolver::resolve_dynamic_method(m, resolved_klass, constants, index(), CHECK_(methodHandle()));
107 } else if (adjusted_invoke_code() != Bytecodes::_invokeinterface) {
108 LinkResolver::resolve_method(m, resolved_klass, constants, index(), CHECK_(methodHandle()));
109 } else {
110 LinkResolver::resolve_interface_method(m, resolved_klass, constants, index(), CHECK_(methodHandle()));
111 }
112 return m;
113 }
114
115
116 int Bytecode_invoke::index() const {
117 // Note: Rewriter::rewrite changes the Java_u2 of an invokedynamic to a native_u4,
118 // at the same time it allocates per-call-site CP cache entries.
119 if (has_giant_index())
120 return Bytes::get_native_u4(bcp() + 1);
121 else
122 return Bytes::get_Java_u2(bcp() + 1);
123 }
124
125
126 // Implementation of Bytecode_static
127
|