Path: blob/master/src/hotspot/share/opto/connode.hpp
40930 views
/*1* Copyright (c) 1997, 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_OPTO_CONNODE_HPP25#define SHARE_OPTO_CONNODE_HPP2627#include "opto/node.hpp"28#include "opto/opcodes.hpp"29#include "opto/type.hpp"3031class PhaseTransform;32class MachNode;3334//------------------------------ConNode----------------------------------------35// Simple constants36class ConNode : public TypeNode {37public:38ConNode( const Type *t ) : TypeNode(t->remove_speculative(),1) {39init_req(0, (Node*)Compile::current()->root());40init_flags(Flag_is_Con);41}42virtual int Opcode() const;43virtual uint hash() const;44virtual const RegMask &out_RegMask() const { return RegMask::Empty; }45virtual const RegMask &in_RegMask(uint) const { return RegMask::Empty; }4647// Polymorphic factory method:48static ConNode* make(const Type *t);49};5051//------------------------------ConINode---------------------------------------52// Simple integer constants53class ConINode : public ConNode {54public:55ConINode( const TypeInt *t ) : ConNode(t) {}56virtual int Opcode() const;5758// Factory method:59static ConINode* make(int con) {60return new ConINode( TypeInt::make(con) );61}6263};6465//------------------------------ConPNode---------------------------------------66// Simple pointer constants67class ConPNode : public ConNode {68public:69ConPNode( const TypePtr *t ) : ConNode(t) {}70virtual int Opcode() const;7172// Factory methods:73static ConPNode* make(address con) {74if (con == NULL)75return new ConPNode( TypePtr::NULL_PTR ) ;76else77return new ConPNode( TypeRawPtr::make(con) );78}79};808182//------------------------------ConNNode--------------------------------------83// Simple narrow oop constants84class ConNNode : public ConNode {85public:86ConNNode( const TypeNarrowOop *t ) : ConNode(t) {}87virtual int Opcode() const;88};8990//------------------------------ConNKlassNode---------------------------------91// Simple narrow klass constants92class ConNKlassNode : public ConNode {93public:94ConNKlassNode( const TypeNarrowKlass *t ) : ConNode(t) {}95virtual int Opcode() const;96};979899//------------------------------ConLNode---------------------------------------100// Simple long constants101class ConLNode : public ConNode {102public:103ConLNode( const TypeLong *t ) : ConNode(t) {}104virtual int Opcode() const;105106// Factory method:107static ConLNode* make(jlong con) {108return new ConLNode( TypeLong::make(con) );109}110111};112113//------------------------------ConFNode---------------------------------------114// Simple float constants115class ConFNode : public ConNode {116public:117ConFNode( const TypeF *t ) : ConNode(t) {}118virtual int Opcode() const;119120// Factory method:121static ConFNode* make(float con) {122return new ConFNode( TypeF::make(con) );123}124125};126127//------------------------------ConDNode---------------------------------------128// Simple double constants129class ConDNode : public ConNode {130public:131ConDNode( const TypeD *t ) : ConNode(t) {}132virtual int Opcode() const;133134// Factory method:135static ConDNode* make(double con) {136return new ConDNode( TypeD::make(con) );137}138139};140141//------------------------------ThreadLocalNode--------------------------------142// Ideal Node which returns the base of ThreadLocalStorage.143class ThreadLocalNode : public Node {144public:145ThreadLocalNode( ) : Node((Node*)Compile::current()->root()) {}146virtual int Opcode() const;147virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM;}148virtual uint ideal_reg() const { return Op_RegP; }149};150151152153#endif // SHARE_OPTO_CONNODE_HPP154155156