Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/shark/llvmValue.hpp
32285 views
/*1* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.2* Copyright 2008, 2009 Red Hat, Inc.3* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.4*5* This code is free software; you can redistribute it and/or modify it6* under the terms of the GNU General Public License version 2 only, as7* published by the Free Software Foundation.8*9* This code is distributed in the hope that it will be useful, but WITHOUT10* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12* version 2 for more details (a copy is included in the LICENSE file that13* accompanied this code).14*15* You should have received a copy of the GNU General Public License version16* 2 along with this work; if not, write to the Free Software Foundation,17* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18*19* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20* or visit www.oracle.com if you need additional information or have any21* questions.22*23*/2425#ifndef SHARE_VM_SHARK_LLVMVALUE_HPP26#define SHARE_VM_SHARK_LLVMVALUE_HPP2728#include "shark/llvmHeaders.hpp"29#include "shark/sharkContext.hpp"30#include "shark/sharkType.hpp"3132class LLVMValue : public AllStatic {33public:34static llvm::ConstantInt* jbyte_constant(jbyte value)35{36return llvm::ConstantInt::get(SharkType::jbyte_type(), value, true);37}38static llvm::ConstantInt* jint_constant(jint value)39{40return llvm::ConstantInt::get(SharkType::jint_type(), value, true);41}42static llvm::ConstantInt* jlong_constant(jlong value)43{44return llvm::ConstantInt::get(SharkType::jlong_type(), value, true);45}46static llvm::ConstantFP* jfloat_constant(jfloat value)47{48return llvm::ConstantFP::get(SharkContext::current(), llvm::APFloat(value));49}50static llvm::ConstantFP* jdouble_constant(jdouble value)51{52return llvm::ConstantFP::get(SharkContext::current(), llvm::APFloat(value));53}54static llvm::ConstantPointerNull* null()55{56return llvm::ConstantPointerNull::get(SharkType::oop_type());57}58static llvm::ConstantPointerNull* nullKlass()59{60return llvm::ConstantPointerNull::get(SharkType::klass_type());61}6263public:64static llvm::ConstantInt* bit_constant(int value)65{66return llvm::ConstantInt::get(SharkType::bit_type(), value, false);67}68static llvm::ConstantInt* intptr_constant(intptr_t value)69{70return llvm::ConstantInt::get(SharkType::intptr_type(), value, false);71}72};7374#endif // SHARE_VM_SHARK_LLVMVALUE_HPP757677