< prev index next >

src/share/vm/runtime/reflection.cpp

Print this page


   1 /*
   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.
   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  *


 819 
 820   java_lang_reflect_Parameter::set_modifiers(rh(), flags);
 821   java_lang_reflect_Parameter::set_executable(rh(), method());
 822   java_lang_reflect_Parameter::set_index(rh(), index);
 823   return rh();
 824 }
 825 
 826 
 827 static methodHandle resolve_interface_call(instanceKlassHandle klass,
 828                                            const methodHandle& method,
 829                                            KlassHandle recv_klass,
 830                                            Handle receiver,
 831                                            TRAPS) {
 832 
 833   assert(!method.is_null() , "method should not be null");
 834 
 835   CallInfo info;
 836   Symbol*  signature  = method->signature();
 837   Symbol*  name       = method->name();
 838   LinkResolver::resolve_interface_call(info, receiver, recv_klass,
 839                                        LinkInfo(klass, name, signature, KlassHandle(), false),
 840                                        true,
 841                                        CHECK_(methodHandle()));
 842   return info.selected_method();
 843 }
 844 
 845 // Conversion
 846 static BasicType basic_type_mirror_to_basic_type(oop basic_type_mirror, TRAPS) {
 847   assert(java_lang_Class::is_primitive(basic_type_mirror),
 848     "just checking");
 849   return java_lang_Class::primitive_type(basic_type_mirror);
 850 }
 851 
 852 // Narrowing of basic types. Used to create correct jvalues for
 853 // boolean, byte, char and short return return values from interpreter
 854 // which are returned as ints. Throws IllegalArgumentException.
 855 static void narrow(jvalue* value, BasicType narrow_type, TRAPS) {
 856   switch (narrow_type) {
 857   case T_BOOLEAN:
 858     value->z = (jboolean)value->i;
 859     return;


   1 /*
   2  * Copyright (c) 1997, 2016, 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  *


 819 
 820   java_lang_reflect_Parameter::set_modifiers(rh(), flags);
 821   java_lang_reflect_Parameter::set_executable(rh(), method());
 822   java_lang_reflect_Parameter::set_index(rh(), index);
 823   return rh();
 824 }
 825 
 826 
 827 static methodHandle resolve_interface_call(instanceKlassHandle klass,
 828                                            const methodHandle& method,
 829                                            KlassHandle recv_klass,
 830                                            Handle receiver,
 831                                            TRAPS) {
 832 
 833   assert(!method.is_null() , "method should not be null");
 834 
 835   CallInfo info;
 836   Symbol*  signature  = method->signature();
 837   Symbol*  name       = method->name();
 838   LinkResolver::resolve_interface_call(info, receiver, recv_klass,
 839                                        LinkInfo(klass, name, signature),
 840                                        true,
 841                                        CHECK_(methodHandle()));
 842   return info.selected_method();
 843 }
 844 
 845 // Conversion
 846 static BasicType basic_type_mirror_to_basic_type(oop basic_type_mirror, TRAPS) {
 847   assert(java_lang_Class::is_primitive(basic_type_mirror),
 848     "just checking");
 849   return java_lang_Class::primitive_type(basic_type_mirror);
 850 }
 851 
 852 // Narrowing of basic types. Used to create correct jvalues for
 853 // boolean, byte, char and short return return values from interpreter
 854 // which are returned as ints. Throws IllegalArgumentException.
 855 static void narrow(jvalue* value, BasicType narrow_type, TRAPS) {
 856   switch (narrow_type) {
 857   case T_BOOLEAN:
 858     value->z = (jboolean)value->i;
 859     return;


< prev index next >