Path: blob/master/src/hotspot/share/c1/c1_ValueSet.inline.hpp
40931 views
/*1* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#ifndef SHARE_C1_C1_VALUESET_INLINE_HPP25#define SHARE_C1_C1_VALUESET_INLINE_HPP2627#include "c1/c1_ValueSet.hpp"2829#include "c1/c1_Instruction.hpp"30#include "utilities/bitMap.inline.hpp"3132inline ValueSet::ValueSet() : _map(Instruction::number_of_instructions()) {33}3435inline ValueSet* ValueSet::copy() {36ValueSet* res = new ValueSet();37res->_map.set_from(_map);38return res;39}4041inline bool ValueSet::contains(Value x) {42return _map.at(x->id());43}4445inline void ValueSet::put(Value x) {46_map.set_bit(x->id());47}4849inline void ValueSet::remove(Value x) {50_map.clear_bit(x->id());51}5253inline bool ValueSet::set_intersect(ValueSet* other) {54return _map.set_intersection_with_result(other->_map);55}5657inline void ValueSet::set_union(ValueSet* other) {58_map.set_union(other->_map);59}6061inline void ValueSet::clear() {62_map.clear();63}6465inline void ValueSet::set_from(ValueSet* other) {66_map.set_from(other->_map);67}6869inline bool ValueSet::equals(ValueSet* other) {70return _map.is_same(other->_map);71}7273#endif // SHARE_C1_C1_VALUESET_INLINE_HPP747576