2
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation.
9
* This code is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12
* version 2 for more details (a copy is included in the LICENSE file that
13
* accompanied this code).
15
* You should have received a copy of the GNU General Public License version
16
* 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.
19
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20
* or visit www.oracle.com if you need additional information or have any
25
#include "precompiled.hpp"
26
#include "memory/allocation.inline.hpp"
27
#include "opto/addnode.hpp"
28
#include "opto/compile.hpp"
29
#include "opto/connode.hpp"
30
#include "opto/machnode.hpp"
31
#include "opto/matcher.hpp"
32
#include "opto/memnode.hpp"
33
#include "opto/phaseX.hpp"
34
#include "opto/subnode.hpp"
35
#include "runtime/sharedRuntime.hpp"
37
// Optimization - Graph Style
39
//=============================================================================
40
//------------------------------hash-------------------------------------------
41
uint ConNode::hash() const {
42
return (uintptr_t)in(TypeFunc::Control) + _type->hash();
45
//------------------------------make-------------------------------------------
46
ConNode *ConNode::make(const Type *t) {
47
switch( t->basic_type() ) {
48
case T_INT: return new ConINode( t->is_int() );
49
case T_LONG: return new ConLNode( t->is_long() );
50
case T_FLOAT: return new ConFNode( t->is_float_constant() );
51
case T_DOUBLE: return new ConDNode( t->is_double_constant() );
52
case T_VOID: return new ConNode ( Type::TOP );
53
case T_OBJECT: return new ConPNode( t->is_ptr() );
54
case T_ARRAY: return new ConPNode( t->is_aryptr() );
55
case T_ADDRESS: return new ConPNode( t->is_ptr() );
56
case T_NARROWOOP: return new ConNNode( t->is_narrowoop() );
57
case T_NARROWKLASS: return new ConNKlassNode( t->is_narrowklass() );
58
case T_METADATA: return new ConPNode( t->is_ptr() );
59
// Expected cases: TypePtr::NULL_PTR, any is_rawptr()
60
// Also seen: AnyPtr(TopPTR *+top);
61
// %%%% Stop using TypePtr::NULL_PTR to represent nulls: use either TypeRawPtr::NULL_PTR
62
// or else TypeOopPtr::NULL_PTR. Then set Type::_basic_type[AnyPtr] = T_ILLEGAL