Mercurial > hg > graal-compiler
comparison src/share/vm/opto/connode.cpp @ 164:c436414a719e
6703890: Compressed Oops: add LoadNKlass node to generate narrow oops (32-bits) compare instructions
Summary: Add LoadNKlass and CMoveN nodes, use CmpN and ConN nodes to generate narrow oops compare instructions.
Reviewed-by: never, rasbold
author | kvn |
---|---|
date | Wed, 21 May 2008 13:46:23 -0700 |
parents | 885ed790ecf0 |
children | 7793bd37a336 |
comparison
equal
deleted
inserted
replaced
163:885ed790ecf0 | 164:c436414a719e |
---|---|
36 //------------------------------make------------------------------------------- | 36 //------------------------------make------------------------------------------- |
37 ConNode *ConNode::make( Compile* C, const Type *t ) { | 37 ConNode *ConNode::make( Compile* C, const Type *t ) { |
38 if (t->isa_narrowoop()) return new (C, 1) ConNNode( t->is_narrowoop() ); | 38 if (t->isa_narrowoop()) return new (C, 1) ConNNode( t->is_narrowoop() ); |
39 switch( t->basic_type() ) { | 39 switch( t->basic_type() ) { |
40 case T_INT: return new (C, 1) ConINode( t->is_int() ); | 40 case T_INT: return new (C, 1) ConINode( t->is_int() ); |
41 case T_ARRAY: return new (C, 1) ConPNode( t->is_aryptr() ); | |
42 case T_LONG: return new (C, 1) ConLNode( t->is_long() ); | 41 case T_LONG: return new (C, 1) ConLNode( t->is_long() ); |
43 case T_FLOAT: return new (C, 1) ConFNode( t->is_float_constant() ); | 42 case T_FLOAT: return new (C, 1) ConFNode( t->is_float_constant() ); |
44 case T_DOUBLE: return new (C, 1) ConDNode( t->is_double_constant() ); | 43 case T_DOUBLE: return new (C, 1) ConDNode( t->is_double_constant() ); |
45 case T_VOID: return new (C, 1) ConNode ( Type::TOP ); | 44 case T_VOID: return new (C, 1) ConNode ( Type::TOP ); |
46 case T_OBJECT: return new (C, 1) ConPNode( t->is_oopptr() ); | 45 case T_OBJECT: return new (C, 1) ConPNode( t->is_oopptr() ); |
46 case T_ARRAY: return new (C, 1) ConPNode( t->is_aryptr() ); | |
47 case T_ADDRESS: return new (C, 1) ConPNode( t->is_ptr() ); | 47 case T_ADDRESS: return new (C, 1) ConPNode( t->is_ptr() ); |
48 // Expected cases: TypePtr::NULL_PTR, any is_rawptr() | 48 // Expected cases: TypePtr::NULL_PTR, any is_rawptr() |
49 // Also seen: AnyPtr(TopPTR *+top); from command line: | 49 // Also seen: AnyPtr(TopPTR *+top); from command line: |
50 // r -XX:+PrintOpto -XX:CIStart=285 -XX:+CompileTheWorld -XX:CompileTheWorldStartAt=660 | 50 // r -XX:+PrintOpto -XX:CIStart=285 -XX:+CompileTheWorld -XX:CompileTheWorldStartAt=660 |
51 // %%%% Stop using TypePtr::NULL_PTR to represent nulls: use either TypeRawPtr::NULL_PTR | 51 // %%%% Stop using TypePtr::NULL_PTR to represent nulls: use either TypeRawPtr::NULL_PTR |
183 case T_FLOAT: return new (C, 4) CMoveFNode( bol, left, right, t ); | 183 case T_FLOAT: return new (C, 4) CMoveFNode( bol, left, right, t ); |
184 case T_DOUBLE: return new (C, 4) CMoveDNode( bol, left, right, t ); | 184 case T_DOUBLE: return new (C, 4) CMoveDNode( bol, left, right, t ); |
185 case T_LONG: return new (C, 4) CMoveLNode( bol, left, right, t->is_long() ); | 185 case T_LONG: return new (C, 4) CMoveLNode( bol, left, right, t->is_long() ); |
186 case T_OBJECT: return new (C, 4) CMovePNode( c, bol, left, right, t->is_oopptr() ); | 186 case T_OBJECT: return new (C, 4) CMovePNode( c, bol, left, right, t->is_oopptr() ); |
187 case T_ADDRESS: return new (C, 4) CMovePNode( c, bol, left, right, t->is_ptr() ); | 187 case T_ADDRESS: return new (C, 4) CMovePNode( c, bol, left, right, t->is_ptr() ); |
188 case T_NARROWOOP: return new (C, 4) CMoveNNode( c, bol, left, right, t ); | |
188 default: | 189 default: |
189 ShouldNotReachHere(); | 190 ShouldNotReachHere(); |
190 return NULL; | 191 return NULL; |
191 } | 192 } |
192 } | 193 } |
568 return TypePtr::NULL_PTR; | 569 return TypePtr::NULL_PTR; |
569 } | 570 } |
570 return bottom_type(); | 571 return bottom_type(); |
571 } | 572 } |
572 | 573 |
573 Node* DecodeNNode::decode(PhaseGVN* phase, Node* value) { | 574 Node* DecodeNNode::decode(PhaseTransform* phase, Node* value) { |
574 if (value->Opcode() == Op_EncodeP) { | 575 if (value->Opcode() == Op_EncodeP) { |
575 // (DecodeN (EncodeP p)) -> p | 576 // (DecodeN (EncodeP p)) -> p |
576 return value->in(1); | 577 return value->in(1); |
577 } | 578 } |
578 const Type* newtype = value->bottom_type(); | 579 const Type* newtype = value->bottom_type(); |
602 return TypeNarrowOop::NULL_PTR; | 603 return TypeNarrowOop::NULL_PTR; |
603 } | 604 } |
604 return bottom_type(); | 605 return bottom_type(); |
605 } | 606 } |
606 | 607 |
607 Node* EncodePNode::encode(PhaseGVN* phase, Node* value) { | 608 Node* EncodePNode::encode(PhaseTransform* phase, Node* value) { |
608 if (value->Opcode() == Op_DecodeN) { | 609 if (value->Opcode() == Op_DecodeN) { |
609 // (EncodeP (DecodeN p)) -> p | 610 // (EncodeP (DecodeN p)) -> p |
610 return value->in(1); | 611 return value->in(1); |
611 } | 612 } |
612 const Type* newtype = value->bottom_type(); | 613 const Type* newtype = value->bottom_type(); |