twisti@2047: /* stefank@2314: * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. twisti@2047: * Copyright 2009 Red Hat, Inc. twisti@2047: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. twisti@2047: * twisti@2047: * This code is free software; you can redistribute it and/or modify it twisti@2047: * under the terms of the GNU General Public License version 2 only, as twisti@2047: * published by the Free Software Foundation. twisti@2047: * twisti@2047: * This code is distributed in the hope that it will be useful, but WITHOUT twisti@2047: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or twisti@2047: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License twisti@2047: * version 2 for more details (a copy is included in the LICENSE file that twisti@2047: * accompanied this code). twisti@2047: * twisti@2047: * You should have received a copy of the GNU General Public License version twisti@2047: * 2 along with this work; if not, write to the Free Software Foundation, twisti@2047: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. twisti@2047: * twisti@2047: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA twisti@2047: * or visit www.oracle.com if you need additional information or have any twisti@2047: * questions. twisti@2047: * twisti@2047: */ twisti@2047: stefank@2314: #ifndef SHARE_VM_SHARK_SHARKINTRINSICS_HPP stefank@2314: #define SHARE_VM_SHARK_SHARKINTRINSICS_HPP stefank@2314: stefank@2314: #include "ci/ciMethod.hpp" stefank@2314: #include "memory/allocation.hpp" stefank@2314: #include "shark/llvmHeaders.hpp" stefank@2314: #include "shark/sharkState.hpp" stefank@2314: twisti@2047: class SharkIntrinsics : public SharkTargetInvariants { twisti@2047: public: twisti@2047: static bool is_intrinsic(ciMethod* target); twisti@2047: static void inline_intrinsic(ciMethod* target, SharkState* state); twisti@2047: twisti@2047: private: twisti@2047: SharkIntrinsics(SharkState* state, ciMethod* target) twisti@2047: : SharkTargetInvariants(state, target), _state(state) {} twisti@2047: twisti@2047: private: twisti@2047: SharkState* _state; twisti@2047: twisti@2047: private: twisti@2047: SharkState* state() const { twisti@2047: return _state; twisti@2047: } twisti@2047: twisti@2047: private: twisti@2047: void do_intrinsic(); twisti@2047: twisti@2047: private: twisti@2047: void do_Math_minmax(llvm::ICmpInst::Predicate p); twisti@2047: void do_Math_1to1(llvm::Value* function); twisti@2047: void do_Math_2to1(llvm::Value* function); twisti@2047: void do_Object_getClass(); twisti@2047: void do_System_currentTimeMillis(); twisti@2047: void do_Thread_currentThread(); twisti@2047: void do_Unsafe_compareAndSwapInt(); twisti@2047: }; stefank@2314: stefank@2314: #endif // SHARE_VM_SHARK_SHARKINTRINSICS_HPP