Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/shark/sharkConstant.hpp
32285 views
/*1* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.2* Copyright 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_SHARKCONSTANT_HPP26#define SHARE_VM_SHARK_SHARKCONSTANT_HPP2728#include "ci/ciStreams.hpp"29#include "memory/allocation.hpp"30#include "shark/sharkBuilder.hpp"31#include "shark/sharkValue.hpp"3233class SharkConstant : public ResourceObj {34public:35static SharkConstant* for_ldc(ciBytecodeStream* iter);36static SharkConstant* for_field(ciBytecodeStream* iter);3738private:39SharkConstant(ciConstant constant, ciType* type);4041private:42SharkValue* _value;43ciObject* _object;44ciType* _type;45bool _is_loaded;46bool _is_nonzero;47bool _is_two_word;4849public:50bool is_loaded() const {51return _is_loaded;52}53bool is_nonzero() const {54assert(is_loaded(), "should be");55return _is_nonzero;56}57bool is_two_word() const {58assert(is_loaded(), "should be");59return _is_two_word;60}6162public:63SharkValue* value(SharkBuilder* builder) {64assert(is_loaded(), "should be");65if (_value == NULL) {66_value = SharkValue::create_generic(67_type, builder->CreateInlineOop(_object), _is_nonzero);68}69return _value;70}71};7273#endif // SHARE_VM_SHARK_SHARKCONSTANT_HPP747576