comparison src/share/vm/opto/connode.hpp @ 6948:e522a00b91aa

Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
author Doug Simon <doug.simon@oracle.com>
date Mon, 12 Nov 2012 23:14:12 +0100
parents d804e148cff8
children 5ec7dace41a6
comparison
equal deleted inserted replaced
6711:ae13cc658b80 6948:e522a00b91aa
1 /* 1 /*
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 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 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
56 ConINode( const TypeInt *t ) : ConNode(t) {} 56 ConINode( const TypeInt *t ) : ConNode(t) {}
57 virtual int Opcode() const; 57 virtual int Opcode() const;
58 58
59 // Factory method: 59 // Factory method:
60 static ConINode* make( Compile* C, int con ) { 60 static ConINode* make( Compile* C, int con ) {
61 return new (C, 1) ConINode( TypeInt::make(con) ); 61 return new (C) ConINode( TypeInt::make(con) );
62 } 62 }
63 63
64 }; 64 };
65 65
66 //------------------------------ConPNode--------------------------------------- 66 //------------------------------ConPNode---------------------------------------
71 virtual int Opcode() const; 71 virtual int Opcode() const;
72 72
73 // Factory methods: 73 // Factory methods:
74 static ConPNode* make( Compile *C ,address con ) { 74 static ConPNode* make( Compile *C ,address con ) {
75 if (con == NULL) 75 if (con == NULL)
76 return new (C, 1) ConPNode( TypePtr::NULL_PTR ) ; 76 return new (C) ConPNode( TypePtr::NULL_PTR ) ;
77 else 77 else
78 return new (C, 1) ConPNode( TypeRawPtr::make(con) ); 78 return new (C) ConPNode( TypeRawPtr::make(con) );
79 } 79 }
80 }; 80 };
81 81
82 82
83 //------------------------------ConNNode-------------------------------------- 83 //------------------------------ConNNode--------------------------------------
86 public: 86 public:
87 ConNNode( const TypeNarrowOop *t ) : ConNode(t) {} 87 ConNNode( const TypeNarrowOop *t ) : ConNode(t) {}
88 virtual int Opcode() const; 88 virtual int Opcode() const;
89 }; 89 };
90 90
91 //------------------------------ConNKlassNode---------------------------------
92 // Simple narrow klass constants
93 class ConNKlassNode : public ConNode {
94 public:
95 ConNKlassNode( const TypeNarrowKlass *t ) : ConNode(t) {}
96 virtual int Opcode() const;
97 };
98
91 99
92 //------------------------------ConLNode--------------------------------------- 100 //------------------------------ConLNode---------------------------------------
93 // Simple long constants 101 // Simple long constants
94 class ConLNode : public ConNode { 102 class ConLNode : public ConNode {
95 public: 103 public:
96 ConLNode( const TypeLong *t ) : ConNode(t) {} 104 ConLNode( const TypeLong *t ) : ConNode(t) {}
97 virtual int Opcode() const; 105 virtual int Opcode() const;
98 106
99 // Factory method: 107 // Factory method:
100 static ConLNode* make( Compile *C ,jlong con ) { 108 static ConLNode* make( Compile *C ,jlong con ) {
101 return new (C, 1) ConLNode( TypeLong::make(con) ); 109 return new (C) ConLNode( TypeLong::make(con) );
102 } 110 }
103 111
104 }; 112 };
105 113
106 //------------------------------ConFNode--------------------------------------- 114 //------------------------------ConFNode---------------------------------------
110 ConFNode( const TypeF *t ) : ConNode(t) {} 118 ConFNode( const TypeF *t ) : ConNode(t) {}
111 virtual int Opcode() const; 119 virtual int Opcode() const;
112 120
113 // Factory method: 121 // Factory method:
114 static ConFNode* make( Compile *C, float con ) { 122 static ConFNode* make( Compile *C, float con ) {
115 return new (C, 1) ConFNode( TypeF::make(con) ); 123 return new (C) ConFNode( TypeF::make(con) );
116 } 124 }
117 125
118 }; 126 };
119 127
120 //------------------------------ConDNode--------------------------------------- 128 //------------------------------ConDNode---------------------------------------
124 ConDNode( const TypeD *t ) : ConNode(t) {} 132 ConDNode( const TypeD *t ) : ConNode(t) {}
125 virtual int Opcode() const; 133 virtual int Opcode() const;
126 134
127 // Factory method: 135 // Factory method:
128 static ConDNode* make( Compile *C, double con ) { 136 static ConDNode* make( Compile *C, double con ) {
129 return new (C, 1) ConDNode( TypeD::make(con) ); 137 return new (C) ConDNode( TypeD::make(con) );
130 } 138 }
131 139
132 }; 140 };
133 141
134 //------------------------------BinaryNode------------------------------------- 142 //------------------------------BinaryNode-------------------------------------
268 // the proper address type - which is required to compute anti-deps. 276 // the proper address type - which is required to compute anti-deps.
269 //virtual Node *Ideal_DU_postCCP( PhaseCCP * ); 277 //virtual Node *Ideal_DU_postCCP( PhaseCCP * );
270 }; 278 };
271 279
272 280
281 //------------------------------EncodeNarrowPtr--------------------------------
282 class EncodeNarrowPtrNode : public TypeNode {
283 protected:
284 EncodeNarrowPtrNode(Node* value, const Type* type):
285 TypeNode(type, 2) {
286 init_class_id(Class_EncodeNarrowPtr);
287 init_req(0, NULL);
288 init_req(1, value);
289 }
290 public:
291 virtual uint ideal_reg() const { return Op_RegN; }
292 virtual Node *Ideal_DU_postCCP( PhaseCCP *ccp );
293 };
294
273 //------------------------------EncodeP-------------------------------- 295 //------------------------------EncodeP--------------------------------
274 // Encodes an oop pointers into its compressed form 296 // Encodes an oop pointers into its compressed form
275 // Takes an extra argument which is the real heap base as a long which 297 // Takes an extra argument which is the real heap base as a long which
276 // may be useful for code generation in the backend. 298 // may be useful for code generation in the backend.
277 class EncodePNode : public TypeNode { 299 class EncodePNode : public EncodeNarrowPtrNode {
278 public: 300 public:
279 EncodePNode(Node* value, const Type* type): 301 EncodePNode(Node* value, const Type* type):
302 EncodeNarrowPtrNode(value, type) {
303 init_class_id(Class_EncodeP);
304 }
305 virtual int Opcode() const;
306 virtual Node *Identity( PhaseTransform *phase );
307 virtual const Type *Value( PhaseTransform *phase ) const;
308 };
309
310 //------------------------------EncodePKlass--------------------------------
311 // Encodes a klass pointer into its compressed form
312 // Takes an extra argument which is the real heap base as a long which
313 // may be useful for code generation in the backend.
314 class EncodePKlassNode : public EncodeNarrowPtrNode {
315 public:
316 EncodePKlassNode(Node* value, const Type* type):
317 EncodeNarrowPtrNode(value, type) {
318 init_class_id(Class_EncodePKlass);
319 }
320 virtual int Opcode() const;
321 virtual Node *Identity( PhaseTransform *phase );
322 virtual const Type *Value( PhaseTransform *phase ) const;
323 };
324
325 //------------------------------DecodeNarrowPtr--------------------------------
326 class DecodeNarrowPtrNode : public TypeNode {
327 protected:
328 DecodeNarrowPtrNode(Node* value, const Type* type):
280 TypeNode(type, 2) { 329 TypeNode(type, 2) {
281 init_class_id(Class_EncodeP); 330 init_class_id(Class_DecodeNarrowPtr);
282 init_req(0, NULL); 331 init_req(0, NULL);
283 init_req(1, value); 332 init_req(1, value);
284 } 333 }
285 virtual int Opcode() const; 334 public:
286 virtual Node *Identity( PhaseTransform *phase ); 335 virtual uint ideal_reg() const { return Op_RegP; }
287 virtual const Type *Value( PhaseTransform *phase ) const;
288 virtual uint ideal_reg() const { return Op_RegN; }
289
290 virtual Node *Ideal_DU_postCCP( PhaseCCP *ccp );
291 }; 336 };
292 337
293 //------------------------------DecodeN-------------------------------- 338 //------------------------------DecodeN--------------------------------
294 // Converts a narrow oop into a real oop ptr. 339 // Converts a narrow oop into a real oop ptr.
295 // Takes an extra argument which is the real heap base as a long which 340 // Takes an extra argument which is the real heap base as a long which
296 // may be useful for code generation in the backend. 341 // may be useful for code generation in the backend.
297 class DecodeNNode : public TypeNode { 342 class DecodeNNode : public DecodeNarrowPtrNode {
298 public: 343 public:
299 DecodeNNode(Node* value, const Type* type): 344 DecodeNNode(Node* value, const Type* type):
300 TypeNode(type, 2) { 345 DecodeNarrowPtrNode(value, type) {
301 init_class_id(Class_DecodeN); 346 init_class_id(Class_DecodeN);
302 init_req(0, NULL); 347 }
303 init_req(1, value); 348 virtual int Opcode() const;
304 } 349 virtual const Type *Value( PhaseTransform *phase ) const;
305 virtual int Opcode() const; 350 virtual Node *Identity( PhaseTransform *phase );
306 virtual Node *Identity( PhaseTransform *phase ); 351 };
307 virtual const Type *Value( PhaseTransform *phase ) const; 352
308 virtual uint ideal_reg() const { return Op_RegP; } 353 //------------------------------DecodeNKlass--------------------------------
354 // Converts a narrow klass pointer into a real klass ptr.
355 // Takes an extra argument which is the real heap base as a long which
356 // may be useful for code generation in the backend.
357 class DecodeNKlassNode : public DecodeNarrowPtrNode {
358 public:
359 DecodeNKlassNode(Node* value, const Type* type):
360 DecodeNarrowPtrNode(value, type) {
361 init_class_id(Class_DecodeNKlass);
362 }
363 virtual int Opcode() const;
364 virtual const Type *Value( PhaseTransform *phase ) const;
365 virtual Node *Identity( PhaseTransform *phase );
309 }; 366 };
310 367
311 //------------------------------Conv2BNode------------------------------------- 368 //------------------------------Conv2BNode-------------------------------------
312 // Convert int/pointer to a Boolean. Map zero to zero, all else to 1. 369 // Convert int/pointer to a Boolean. Map zero to zero, all else to 1.
313 class Conv2BNode : public Node { 370 class Conv2BNode : public Node {