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