annotate src/share/vm/ci/ciMethodHandle.hpp @ 2810:e0658a9b3f87

7105364: JDK8 b10 hotspot: src/share/vm/ci/ciMethodHandle.cpp Error: Use "." or "->" Summary: Define ciMethodHandle::print_chain_impl() and ciMethodHandle::print_chain() bodies only in debug builds. Reviewed-by: never, twisti
author kvn
date Thu, 27 Oct 2011 09:39:24 -0700
parents c26de9aef2ed
children 1d7922586cf6
rev   line source
twisti@1138 1 /*
jrose@2204 2 * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
twisti@1138 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
twisti@1138 4 *
twisti@1138 5 * This code is free software; you can redistribute it and/or modify it
twisti@1138 6 * under the terms of the GNU General Public License version 2 only, as
twisti@1138 7 * published by the Free Software Foundation.
twisti@1138 8 *
twisti@1138 9 * This code is distributed in the hope that it will be useful, but WITHOUT
twisti@1138 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
twisti@1138 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
twisti@1138 12 * version 2 for more details (a copy is included in the LICENSE file that
twisti@1138 13 * accompanied this code).
twisti@1138 14 *
twisti@1138 15 * You should have received a copy of the GNU General Public License version
twisti@1138 16 * 2 along with this work; if not, write to the Free Software Foundation,
twisti@1138 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
twisti@1138 18 *
trims@1472 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1472 20 * or visit www.oracle.com if you need additional information or have any
trims@1472 21 * questions.
twisti@1138 22 *
twisti@1138 23 */
twisti@1138 24
stefank@1879 25 #ifndef SHARE_VM_CI_CIMETHODHANDLE_HPP
stefank@1879 26 #define SHARE_VM_CI_CIMETHODHANDLE_HPP
stefank@1879 27
twisti@2463 28 #include "ci/ciCallProfile.hpp"
stefank@1890 29 #include "ci/ciInstance.hpp"
stefank@1879 30 #include "prims/methodHandles.hpp"
stefank@1879 31
twisti@1138 32 // ciMethodHandle
twisti@1138 33 //
jrose@2204 34 // The class represents a java.lang.invoke.MethodHandle object.
twisti@1138 35 class ciMethodHandle : public ciInstance {
twisti@1138 36 private:
twisti@2463 37 ciMethod* _callee;
twisti@2468 38 ciMethod* _caller;
never@2514 39 ciCallProfile _profile;
never@2670 40 ciMethod* _method_handle_adapter;
never@2670 41 ciMethod* _invokedynamic_adapter;
twisti@1138 42
twisti@1138 43 // Return an adapter for this MethodHandle.
never@2670 44 ciMethod* get_adapter_impl(bool is_invokedynamic);
never@2670 45 ciMethod* get_adapter( bool is_invokedynamic);
twisti@1138 46
twisti@1138 47 protected:
kvn@2810 48 void print_chain_impl() NOT_DEBUG_RETURN;
twisti@1138 49
twisti@1138 50 public:
twisti@2468 51 ciMethodHandle(instanceHandle h_i) :
twisti@2468 52 ciInstance(h_i),
twisti@2468 53 _callee(NULL),
never@2670 54 _caller(NULL),
never@2670 55 _method_handle_adapter(NULL),
never@2670 56 _invokedynamic_adapter(NULL)
twisti@2468 57 {}
twisti@1138 58
twisti@1138 59 // What kind of ciObject is this?
twisti@1138 60 bool is_method_handle() const { return true; }
twisti@1138 61
twisti@2468 62 void set_callee(ciMethod* m) { _callee = m; }
twisti@2468 63 void set_caller(ciMethod* m) { _caller = m; }
never@2514 64 void set_call_profile(ciCallProfile profile) { _profile = profile; }
twisti@2463 65
twisti@1138 66 // Return an adapter for a MethodHandle call.
never@2670 67 ciMethod* get_method_handle_adapter() {
never@2670 68 if (_method_handle_adapter == NULL) {
never@2670 69 _method_handle_adapter = get_adapter(false);
never@2670 70 }
never@2670 71 return _method_handle_adapter;
never@2670 72 }
twisti@1138 73
twisti@1138 74 // Return an adapter for an invokedynamic call.
never@2670 75 ciMethod* get_invokedynamic_adapter() {
never@2670 76 if (_invokedynamic_adapter == NULL) {
never@2670 77 _invokedynamic_adapter = get_adapter(true);
never@2670 78 }
never@2670 79 return _invokedynamic_adapter;
never@2670 80 }
never@2670 81
kvn@2810 82 void print_chain() NOT_DEBUG_RETURN;
twisti@1138 83 };
stefank@1879 84
stefank@1879 85 #endif // SHARE_VM_CI_CIMETHODHANDLE_HPP