reflection.hpp revision 2062
55N/A * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 55N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 55N/A * This code is free software; you can redistribute it and/or modify it 55N/A * under the terms of the GNU General Public License version 2 only, as 55N/A * published by the Free Software Foundation. 55N/A * This code is distributed in the hope that it will be useful, but WITHOUT 55N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 55N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 55N/A * version 2 for more details (a copy is included in the LICENSE file that 55N/A * accompanied this code). 55N/A * You should have received a copy of the GNU General Public License version 55N/A * 2 along with this work; if not, write to the Free Software Foundation, 55N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 55N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 55N/A// Class Reflection contains utility methods needed for implementing the 55N/A// Used by functions in the JVM interface. 55N/A// NOTE that in JDK 1.4 most of reflection is now implemented in Java 55N/A// using dynamic bytecode generation. The Array class has not yet been 55N/A// rewritten using bytecodes; if it were, most of the rest of this 55N/A// class could go away, as well as a few more entry points in jvm.cpp. // Creating new java.lang.reflect.xxx wrappers // Constants defined by java reflection api classes // Boxing. Returns boxed value of appropriate type. Throws IllegalArgumentException. // Unboxing. Returns type code and sets value. // Widening of basic types. Throws IllegalArgumentException. // Reflective array access. Returns type code. Throws ArrayIndexOutOfBoundsException. // Returns mirror on array element type (NULL for basic type arrays and non-arrays). // inner class reflection // raise an ICCE unless the required relationship can be proven to hold // If inner_is_member, require the inner to be a member of the outer. // If !inner_is_member, require the inner to be anonymous (a non-member). // Caller is responsible for figuring out in advance which case must be true. // Support for reflection based on dynamic bytecode generation (JDK 1.4) // Create a java.lang.reflect.Method object based on a method // Create a java.lang.reflect.Constructor object based on a method // Create a java.lang.reflect.Field object based on a field descriptor //--------------------------------------------------------------------------- // Support for old native code-based reflection (pre-JDK 1.4) // NOTE: the method and constructor invocation code is still used //--------------------------------------------------------------------------- // method resolution for invoke // Method call (shared by invoke_method and invoke_constructor) // Narrowing of basic types. Used to create correct jvalues for // boolean, byte, char and short return return values from interpreter // which are returned as ints. Throws IllegalArgumentException. // Creating new java.lang.reflect.xxx wrappers // Field lookup and verification. // Reflective field access. Returns type code. Throws IllegalArgumentException. // Reflective lookup of fields. Returns java.lang.reflect.Field instances. // Reflective lookup of methods. Returns java.lang.reflect.Method instances. // Reflective lookup of constructors. Returns java.lang.reflect.Constructor instances. // Method invokation through java.lang.reflect.Method // Method invokation through java.lang.reflect.Constructor #
endif /* SUPPORT_OLD_REFLECTION */#
endif // SHARE_VM_RUNTIME_REFLECTION_HPP