1 /*
2 * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
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 it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
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).
14 *
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.
18 *
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
21 * questions.
22 *
23 */
24
25 // Portions of code courtesy of Clifford Click
26
27 // Optimization - Graph Style
28
29
30 class AbstractLockNode;
31 class AddNode;
32 class AddPNode;
33 class AliasInfo;
34 class AllocateArrayNode;
35 class AllocateNode;
36 class Block;
37 class Block_Array;
38 class BoolNode;
39 class BoxLockNode;
40 class CMoveNode;
41 class CallDynamicJavaNode;
42 class CallJavaNode;
43 class CallLeafNode;
44 class CallNode;
1537 const Type* const _type;
1538 public:
1539 void set_type(const Type* t) {
1540 assert(t != NULL, "sanity");
1541 debug_only(uint check_hash = (VerifyHashTableKeys && _hash_lock) ? hash() : NO_HASH);
1542 *(const Type**)&_type = t; // cast away const-ness
1543 // If this node is in the hash table, make sure it doesn't need a rehash.
1544 assert(check_hash == NO_HASH || check_hash == hash(), "type change must preserve hash code");
1545 }
1546 const Type* type() const { assert(_type != NULL, "sanity"); return _type; };
1547 TypeNode( const Type *t, uint required ) : Node(required), _type(t) {
1548 init_class_id(Class_Type);
1549 }
1550 virtual const Type *Value( PhaseTransform *phase ) const;
1551 virtual const Type *bottom_type() const;
1552 virtual uint ideal_reg() const;
1553 #ifndef PRODUCT
1554 virtual void dump_spec(outputStream *st) const;
1555 #endif
1556 };
|
1 /*
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
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 it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
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).
14 *
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.
18 *
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
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_OPTO_NODE_HPP
26 #define SHARE_VM_OPTO_NODE_HPP
27
28 #include "libadt/port.hpp"
29 #include "libadt/vectset.hpp"
30 #include "opto/compile.hpp"
31 #include "opto/type.hpp"
32
33 // Portions of code courtesy of Clifford Click
34
35 // Optimization - Graph Style
36
37
38 class AbstractLockNode;
39 class AddNode;
40 class AddPNode;
41 class AliasInfo;
42 class AllocateArrayNode;
43 class AllocateNode;
44 class Block;
45 class Block_Array;
46 class BoolNode;
47 class BoxLockNode;
48 class CMoveNode;
49 class CallDynamicJavaNode;
50 class CallJavaNode;
51 class CallLeafNode;
52 class CallNode;
1545 const Type* const _type;
1546 public:
1547 void set_type(const Type* t) {
1548 assert(t != NULL, "sanity");
1549 debug_only(uint check_hash = (VerifyHashTableKeys && _hash_lock) ? hash() : NO_HASH);
1550 *(const Type**)&_type = t; // cast away const-ness
1551 // If this node is in the hash table, make sure it doesn't need a rehash.
1552 assert(check_hash == NO_HASH || check_hash == hash(), "type change must preserve hash code");
1553 }
1554 const Type* type() const { assert(_type != NULL, "sanity"); return _type; };
1555 TypeNode( const Type *t, uint required ) : Node(required), _type(t) {
1556 init_class_id(Class_Type);
1557 }
1558 virtual const Type *Value( PhaseTransform *phase ) const;
1559 virtual const Type *bottom_type() const;
1560 virtual uint ideal_reg() const;
1561 #ifndef PRODUCT
1562 virtual void dump_spec(outputStream *st) const;
1563 #endif
1564 };
1565
1566 #endif // SHARE_VM_OPTO_NODE_HPP
|