src/share/vm/prims/nativeLookup.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File bug_jdk8033150 Sdiff src/share/vm/prims

src/share/vm/prims/nativeLookup.cpp

Print this page


   1 /*
   2  * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  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  *


 391         method->method_holder()->external_name(),
 392         method->name()->as_C_string());
 393     }
 394   }
 395   return method->native_function();
 396 }
 397 
 398 address NativeLookup::base_library_lookup(const char* class_name, const char* method_name, const char* signature) {
 399   EXCEPTION_MARK;
 400   bool in_base_library = true;  // SharedRuntime inits some math methods.
 401   TempNewSymbol c_name = SymbolTable::new_symbol(class_name,  CATCH);
 402   TempNewSymbol m_name = SymbolTable::new_symbol(method_name, CATCH);
 403   TempNewSymbol s_name = SymbolTable::new_symbol(signature,   CATCH);
 404 
 405   // Find the class
 406   Klass* k = SystemDictionary::resolve_or_fail(c_name, true, CATCH);
 407   instanceKlassHandle klass (THREAD, k);
 408 
 409   // Find method and invoke standard lookup
 410   methodHandle method (THREAD,
 411                        klass->uncached_lookup_method(m_name, s_name));
 412   address result = lookup(method, in_base_library, CATCH);
 413   assert(in_base_library, "must be in basic library");
 414   guarantee(result != NULL, "must be non NULL");
 415   return result;
 416 }
   1 /*
   2  * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  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  *


 391         method->method_holder()->external_name(),
 392         method->name()->as_C_string());
 393     }
 394   }
 395   return method->native_function();
 396 }
 397 
 398 address NativeLookup::base_library_lookup(const char* class_name, const char* method_name, const char* signature) {
 399   EXCEPTION_MARK;
 400   bool in_base_library = true;  // SharedRuntime inits some math methods.
 401   TempNewSymbol c_name = SymbolTable::new_symbol(class_name,  CATCH);
 402   TempNewSymbol m_name = SymbolTable::new_symbol(method_name, CATCH);
 403   TempNewSymbol s_name = SymbolTable::new_symbol(signature,   CATCH);
 404 
 405   // Find the class
 406   Klass* k = SystemDictionary::resolve_or_fail(c_name, true, CATCH);
 407   instanceKlassHandle klass (THREAD, k);
 408 
 409   // Find method and invoke standard lookup
 410   methodHandle method (THREAD,
 411                        klass->uncached_lookup_method(m_name, s_name, false));
 412   address result = lookup(method, in_base_library, CATCH);
 413   assert(in_base_library, "must be in basic library");
 414   guarantee(result != NULL, "must be non NULL");
 415   return result;
 416 }
src/share/vm/prims/nativeLookup.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File