1 /* |
1 /* |
2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2015, 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. |
177 |
177 |
178 void JavaCalls::call_virtual(JavaValue* result, KlassHandle spec_klass, Symbol* name, Symbol* signature, JavaCallArguments* args, TRAPS) { |
178 void JavaCalls::call_virtual(JavaValue* result, KlassHandle spec_klass, Symbol* name, Symbol* signature, JavaCallArguments* args, TRAPS) { |
179 CallInfo callinfo; |
179 CallInfo callinfo; |
180 Handle receiver = args->receiver(); |
180 Handle receiver = args->receiver(); |
181 KlassHandle recvrKlass(THREAD, receiver.is_null() ? (Klass*)NULL : receiver->klass()); |
181 KlassHandle recvrKlass(THREAD, receiver.is_null() ? (Klass*)NULL : receiver->klass()); |
|
182 LinkInfo link_info(spec_klass, name, signature, KlassHandle(), /*check_access*/false); |
182 LinkResolver::resolve_virtual_call( |
183 LinkResolver::resolve_virtual_call( |
183 callinfo, receiver, recvrKlass, spec_klass, name, signature, |
184 callinfo, receiver, recvrKlass, link_info, true, CHECK); |
184 KlassHandle(), false, true, CHECK); |
|
185 methodHandle method = callinfo.selected_method(); |
185 methodHandle method = callinfo.selected_method(); |
186 assert(method.not_null(), "should have thrown exception"); |
186 assert(method.not_null(), "should have thrown exception"); |
187 |
187 |
188 // Invoke the method |
188 // Invoke the method |
189 JavaCalls::call(result, method, args, CHECK); |
189 JavaCalls::call(result, method, args, CHECK); |
214 |
214 |
215 // ============ Special calls ============ |
215 // ============ Special calls ============ |
216 |
216 |
217 void JavaCalls::call_special(JavaValue* result, KlassHandle klass, Symbol* name, Symbol* signature, JavaCallArguments* args, TRAPS) { |
217 void JavaCalls::call_special(JavaValue* result, KlassHandle klass, Symbol* name, Symbol* signature, JavaCallArguments* args, TRAPS) { |
218 CallInfo callinfo; |
218 CallInfo callinfo; |
219 LinkResolver::resolve_special_call(callinfo, klass, name, signature, KlassHandle(), false, CHECK); |
219 LinkInfo link_info(klass, name, signature, KlassHandle(), /*check_access*/false); |
|
220 LinkResolver::resolve_special_call(callinfo, link_info, CHECK); |
220 methodHandle method = callinfo.selected_method(); |
221 methodHandle method = callinfo.selected_method(); |
221 assert(method.not_null(), "should have thrown exception"); |
222 assert(method.not_null(), "should have thrown exception"); |
222 |
223 |
223 // Invoke the method |
224 // Invoke the method |
224 JavaCalls::call(result, method, args, CHECK); |
225 JavaCalls::call(result, method, args, CHECK); |
248 |
249 |
249 // ============ Static calls ============ |
250 // ============ Static calls ============ |
250 |
251 |
251 void JavaCalls::call_static(JavaValue* result, KlassHandle klass, Symbol* name, Symbol* signature, JavaCallArguments* args, TRAPS) { |
252 void JavaCalls::call_static(JavaValue* result, KlassHandle klass, Symbol* name, Symbol* signature, JavaCallArguments* args, TRAPS) { |
252 CallInfo callinfo; |
253 CallInfo callinfo; |
253 LinkResolver::resolve_static_call(callinfo, klass, name, signature, KlassHandle(), false, true, CHECK); |
254 LinkInfo link_info(klass, name, signature, KlassHandle(), /*check_access*/false); |
|
255 LinkResolver::resolve_static_call(callinfo, link_info, true, CHECK); |
254 methodHandle method = callinfo.selected_method(); |
256 methodHandle method = callinfo.selected_method(); |
255 assert(method.not_null(), "should have thrown exception"); |
257 assert(method.not_null(), "should have thrown exception"); |
256 |
258 |
257 // Invoke the method |
259 // Invoke the method |
258 JavaCalls::call(result, method, args, CHECK); |
260 JavaCalls::call(result, method, args, CHECK); |