ciMethodHandle.hpp revision 1879
504N/A/*
2887N/A * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
671N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
671N/A *
671N/A * This code is free software; you can redistribute it and/or modify it
671N/A * under the terms of the GNU General Public License version 2 only, as
671N/A * published by the Free Software Foundation.
671N/A *
671N/A * This code is distributed in the hope that it will be useful, but WITHOUT
671N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6982N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
6982N/A * version 2 for more details (a copy is included in the LICENSE file that
671N/A * accompanied this code).
671N/A *
671N/A * You should have received a copy of the GNU General Public License version
671N/A * 2 along with this work; if not, write to the Free Software Foundation,
6982N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
6982N/A *
6982N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
6982N/A * or visit www.oracle.com if you need additional information or have any
671N/A * questions.
671N/A *
671N/A */
671N/A
4116N/A#ifndef SHARE_VM_CI_CIMETHODHANDLE_HPP
671N/A#define SHARE_VM_CI_CIMETHODHANDLE_HPP
504N/A
4618N/A#include "prims/methodHandles.hpp"
4618N/A
3816N/A// ciMethodHandle
3816N/A//
3816N/A// The class represents a java.dyn.MethodHandle object.
504N/Aclass ciMethodHandle : public ciInstance {
690N/Aprivate:
3973N/A ciMethod* _callee;
4618N/A
3973N/A // Return an adapter for this MethodHandle.
3973N/A ciMethod* get_adapter(bool is_invokedynamic) const;
3973N/A
3973N/Aprotected:
3973N/A void print_impl(outputStream* st);
3973N/A
3973N/Apublic:
3973N/A ciMethodHandle(instanceHandle h_i) : ciInstance(h_i) {};
4618N/A
4618N/A // What kind of ciObject is this?
4618N/A bool is_method_handle() const { return true; }
3973N/A
4618N/A ciMethod* callee() const { return _callee; }
3973N/A void set_callee(ciMethod* m) { _callee = m; }
4618N/A
3973N/A // Return an adapter for a MethodHandle call.
3973N/A ciMethod* get_method_handle_adapter() const {
3973N/A return get_adapter(false);
5331N/A }
3973N/A
4618N/A // Return an adapter for an invokedynamic call.
3973N/A ciMethod* get_invokedynamic_adapter() const {
3973N/A return get_adapter(true);
3973N/A }
3973N/A};
3973N/A
3973N/A#endif // SHARE_VM_CI_CIMETHODHANDLE_HPP
4618N/A