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. |
46 private: |
46 private: |
47 // Conversion |
47 // Conversion |
48 static Klass* basic_type_mirror_to_arrayklass(oop basic_type_mirror, TRAPS); |
48 static Klass* basic_type_mirror_to_arrayklass(oop basic_type_mirror, TRAPS); |
49 static oop basic_type_arrayklass_to_mirror(Klass* basic_type_arrayklass, TRAPS); |
49 static oop basic_type_arrayklass_to_mirror(Klass* basic_type_arrayklass, TRAPS); |
50 |
50 |
51 static objArrayHandle get_parameter_types(methodHandle method, int parameter_count, oop* return_type, TRAPS); |
51 static objArrayHandle get_parameter_types(const methodHandle& method, int parameter_count, oop* return_type, TRAPS); |
52 static objArrayHandle get_exception_types(methodHandle method, TRAPS); |
52 static objArrayHandle get_exception_types(const methodHandle& method, TRAPS); |
53 // Creating new java.lang.reflect.xxx wrappers |
53 // Creating new java.lang.reflect.xxx wrappers |
54 static Handle new_type(Symbol* signature, KlassHandle k, TRAPS); |
54 static Handle new_type(Symbol* signature, KlassHandle k, TRAPS); |
55 |
55 |
56 public: |
56 public: |
57 // Constants defined by java reflection api classes |
57 // Constants defined by java reflection api classes |
108 // |
108 // |
109 // Support for reflection based on dynamic bytecode generation (JDK 1.4) |
109 // Support for reflection based on dynamic bytecode generation (JDK 1.4) |
110 // |
110 // |
111 |
111 |
112 // Create a java.lang.reflect.Method object based on a method |
112 // Create a java.lang.reflect.Method object based on a method |
113 static oop new_method(methodHandle method, bool for_constant_pool_access, TRAPS); |
113 static oop new_method(const methodHandle& method, bool for_constant_pool_access, TRAPS); |
114 // Create a java.lang.reflect.Constructor object based on a method |
114 // Create a java.lang.reflect.Constructor object based on a method |
115 static oop new_constructor(methodHandle method, TRAPS); |
115 static oop new_constructor(const methodHandle& method, TRAPS); |
116 // Create a java.lang.reflect.Field object based on a field descriptor |
116 // Create a java.lang.reflect.Field object based on a field descriptor |
117 static oop new_field(fieldDescriptor* fd, TRAPS); |
117 static oop new_field(fieldDescriptor* fd, TRAPS); |
118 // Create a java.lang.reflect.Parameter object based on a |
118 // Create a java.lang.reflect.Parameter object based on a |
119 // MethodParameterElement |
119 // MethodParameterElement |
120 static oop new_parameter(Handle method, int index, Symbol* sym, |
120 static oop new_parameter(Handle method, int index, Symbol* sym, |
121 int flags, TRAPS); |
121 int flags, TRAPS); |
122 |
122 |
123 private: |
123 private: |
124 // method resolution for invoke |
124 // method resolution for invoke |
125 static methodHandle resolve_interface_call(instanceKlassHandle klass, methodHandle method, KlassHandle recv_klass, Handle receiver, TRAPS); |
125 static methodHandle resolve_interface_call(instanceKlassHandle klass, const methodHandle& method, KlassHandle recv_klass, Handle receiver, TRAPS); |
126 // Method call (shared by invoke_method and invoke_constructor) |
126 // Method call (shared by invoke_method and invoke_constructor) |
127 static oop invoke(instanceKlassHandle klass, methodHandle method, Handle receiver, bool override, objArrayHandle ptypes, BasicType rtype, objArrayHandle args, bool is_method_invoke, TRAPS); |
127 static oop invoke(instanceKlassHandle klass, |
|
128 const methodHandle& method, |
|
129 Handle receiver, |
|
130 bool override, |
|
131 objArrayHandle ptypes, |
|
132 BasicType rtype, |
|
133 objArrayHandle args, |
|
134 bool is_method_invoke, TRAPS); |
128 |
135 |
129 // Narrowing of basic types. Used to create correct jvalues for |
136 // Narrowing of basic types. Used to create correct jvalues for |
130 // boolean, byte, char and short return return values from interpreter |
137 // boolean, byte, char and short return return values from interpreter |
131 // which are returned as ints. Throws IllegalArgumentException. |
138 // which are returned as ints. Throws IllegalArgumentException. |
132 static void narrow(jvalue* value, BasicType narrow_type, TRAPS); |
139 static void narrow(jvalue* value, BasicType narrow_type, TRAPS); |