comparison src/share/vm/prims/nativeLookup.cpp @ 13654:503ddcb96bb0

Merge
author dholmes
date Wed, 27 Sep 2017 01:20:56 -0400
parents ffee6483b81b
children
comparison
equal deleted inserted replaced
36:d2afcb62da6e 37:cc9a5ab9656e
1 /* 1 /*
2 * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2017, 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.
173 return entry; 173 return entry;
174 } 174 }
175 } 175 }
176 176
177 // Otherwise call static method findNative in ClassLoader 177 // Otherwise call static method findNative in ClassLoader
178 KlassHandle klass (THREAD, SystemDictionary::ClassLoader_klass()); 178 Klass* klass = SystemDictionary::ClassLoader_klass();
179 Handle name_arg = java_lang_String::create_from_str(jni_name, CHECK_NULL); 179 Handle name_arg = java_lang_String::create_from_str(jni_name, CHECK_NULL);
180 180
181 JavaValue result(T_LONG); 181 JavaValue result(T_LONG);
182 JavaCalls::call_static(&result, 182 JavaCalls::call_static(&result,
183 klass, 183 klass,
343 if (wrapper_name != in_name) { 343 if (wrapper_name != in_name) {
344 // we have a name for a wrapping method 344 // we have a name for a wrapping method
345 int wrapper_name_len = (int)strlen(wrapper_name); 345 int wrapper_name_len = (int)strlen(wrapper_name);
346 TempNewSymbol wrapper_symbol = SymbolTable::probe(wrapper_name, wrapper_name_len); 346 TempNewSymbol wrapper_symbol = SymbolTable::probe(wrapper_name, wrapper_name_len);
347 if (wrapper_symbol != NULL) { 347 if (wrapper_symbol != NULL) {
348 KlassHandle kh(method->method_holder()); 348 Klass* k = method->method_holder();
349 Method* wrapper_method = kh()->lookup_method(wrapper_symbol, 349 Method* wrapper_method = k->lookup_method(wrapper_symbol, method->signature());
350 method->signature());
351 if (wrapper_method != NULL && !wrapper_method->is_native()) { 350 if (wrapper_method != NULL && !wrapper_method->is_native()) {
352 // we found a wrapper method, use its native entry 351 // we found a wrapper method, use its native entry
353 method->set_is_prefixed_native(); 352 method->set_is_prefixed_native();
354 return lookup_entry(wrapper_method, in_base_library, THREAD); 353 return lookup_entry(wrapper_method, in_base_library, THREAD);
355 } 354 }
400 TempNewSymbol m_name = SymbolTable::new_symbol(method_name, CATCH); 399 TempNewSymbol m_name = SymbolTable::new_symbol(method_name, CATCH);
401 TempNewSymbol s_name = SymbolTable::new_symbol(signature, CATCH); 400 TempNewSymbol s_name = SymbolTable::new_symbol(signature, CATCH);
402 401
403 // Find the class 402 // Find the class
404 Klass* k = SystemDictionary::resolve_or_fail(c_name, true, CATCH); 403 Klass* k = SystemDictionary::resolve_or_fail(c_name, true, CATCH);
405 instanceKlassHandle klass (THREAD, k); 404 InstanceKlass* klass = InstanceKlass::cast(k);
406 405
407 // Find method and invoke standard lookup 406 // Find method and invoke standard lookup
408 methodHandle method (THREAD, 407 methodHandle method (THREAD,
409 klass->uncached_lookup_method(m_name, s_name, Klass::find_overpass)); 408 klass->uncached_lookup_method(m_name, s_name, Klass::find_overpass));
410 address result = lookup(method, in_base_library, CATCH); 409 address result = lookup(method, in_base_library, CATCH);