0N/A/*
2677N/A * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
0N/A * published by the Free Software Foundation.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/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.
0N/A *
0N/A */
0N/A
1879N/A#ifndef SHARE_VM_OPTO_CALLGENERATOR_HPP
1879N/A#define SHARE_VM_OPTO_CALLGENERATOR_HPP
1879N/A
3932N/A#include "compiler/compileBroker.hpp"
1879N/A#include "opto/callnode.hpp"
1879N/A#include "opto/compile.hpp"
1879N/A#include "opto/type.hpp"
1879N/A#include "runtime/deoptimization.hpp"
1879N/A
0N/A//---------------------------CallGenerator-------------------------------------
0N/A// The subclasses of this class handle generation of ideal nodes for
0N/A// call sites and method entry points.
0N/A
0N/Aclass CallGenerator : public ResourceObj {
0N/A public:
0N/A enum {
0N/A xxxunusedxxx
0N/A };
0N/A
0N/A private:
0N/A ciMethod* _method; // The method being called.
0N/A
0N/A protected:
3932N/A CallGenerator(ciMethod* method) : _method(method) {}
0N/A
0N/A public:
0N/A // Accessors
0N/A ciMethod* method() const { return _method; }
0N/A
0N/A // is_inline: At least some code implementing the method is copied here.
0N/A virtual bool is_inline() const { return false; }
0N/A // is_intrinsic: There's a method-specific way of generating the inline code.
0N/A virtual bool is_intrinsic() const { return false; }
0N/A // is_parse: Bytecodes implementing the specific method are copied here.
0N/A virtual bool is_parse() const { return false; }
0N/A // is_virtual: The call uses the receiver type to select or check the method.
0N/A virtual bool is_virtual() const { return false; }
0N/A // is_deferred: The decision whether to inline or not is deferred.
0N/A virtual bool is_deferred() const { return false; }
0N/A // is_predicted: Uses an explicit check against a predicted type.
0N/A virtual bool is_predicted() const { return false; }
0N/A // is_trap: Does not return to the caller. (E.g., uncommon trap.)
0N/A virtual bool is_trap() const { return false; }
0N/A
1080N/A // is_late_inline: supports conversion of call into an inline
1080N/A virtual bool is_late_inline() const { return false; }
4132N/A // same but for method handle calls
4132N/A virtual bool is_mh_late_inline() const { return false; }
4132N/A
4132N/A // for method handle calls: have we tried inlinining the call already?
4132N/A virtual bool already_attempted() const { ShouldNotReachHere(); return false; }
4132N/A
1080N/A // Replace the call with an inline version of the code
1080N/A virtual void do_late_inline() { ShouldNotReachHere(); }
1080N/A
1080N/A virtual CallStaticJavaNode* call_node() const { ShouldNotReachHere(); return NULL; }
1080N/A
0N/A // Note: It is possible for a CG to be both inline and virtual.
0N/A // (The hashCode intrinsic does a vtable check and an inlined fast path.)
0N/A
0N/A // Utilities:
0N/A const TypeFunc* tf() const;
0N/A
0N/A // The given jvms has state and arguments for a call to my method.
0N/A // Edges after jvms->argoff() carry all (pre-popped) argument values.
0N/A //
0N/A // Update the map with state and return values (if any) and return it.
0N/A // The return values (0, 1, or 2) must be pushed on the map's stack,
0N/A // and the sp of the jvms incremented accordingly.
0N/A //
0N/A // The jvms is returned on success. Alternatively, a copy of the
0N/A // given jvms, suitably updated, may be returned, in which case the
0N/A // caller should discard the original jvms.
0N/A //
0N/A // The non-Parm edges of the returned map will contain updated global state,
0N/A // and one or two edges before jvms->sp() will carry any return values.
0N/A // Other map edges may contain locals or monitors, and should not
0N/A // be changed in meaning.
0N/A //
0N/A // If the call traps, the returned map must have a control edge of top.
0N/A // If the call can throw, the returned map must report has_exceptions().
0N/A //
0N/A // If the result is NULL, it means that this CallGenerator was unable
0N/A // to handle the given call, and another CallGenerator should be consulted.
0N/A virtual JVMState* generate(JVMState* jvms) = 0;
0N/A
0N/A // How to generate a call site that is inlined:
0N/A static CallGenerator* for_inline(ciMethod* m, float expected_uses = -1);
0N/A // How to generate code for an on-stack replacement handler.
0N/A static CallGenerator* for_osr(ciMethod* m, int osr_bci);
0N/A
0N/A // How to generate vanilla out-of-line call sites:
1080N/A < Error!

 

There was an error!

null

java.lang.NullPointerException