Mercurial > hg > truffle
comparison src/share/vm/opto/memnode.cpp @ 558:3b5ac9e7e6ea
6796746: rename LoadC (char) opcode class to LoadUS (unsigned short)
Summary: Renaming LoadC to LoadUS would round up the planned introduction of LoadUB and LoadUI.
Reviewed-by: phh, kvn
author | twisti |
---|---|
date | Mon, 26 Jan 2009 16:22:12 +0100 |
parents | 041fe019d769 |
children | dca06e7f503d |
comparison
equal
deleted
inserted
replaced
557:465813e0303a | 558:3b5ac9e7e6ea |
---|---|
777 assert(!(adr_type->isa_aryptr() && | 777 assert(!(adr_type->isa_aryptr() && |
778 adr_type->offset() == arrayOopDesc::length_offset_in_bytes()), | 778 adr_type->offset() == arrayOopDesc::length_offset_in_bytes()), |
779 "use LoadRangeNode instead"); | 779 "use LoadRangeNode instead"); |
780 switch (bt) { | 780 switch (bt) { |
781 case T_BOOLEAN: | 781 case T_BOOLEAN: |
782 case T_BYTE: return new (C, 3) LoadBNode(ctl, mem, adr, adr_type, rt->is_int() ); | 782 case T_BYTE: return new (C, 3) LoadBNode (ctl, mem, adr, adr_type, rt->is_int() ); |
783 case T_INT: return new (C, 3) LoadINode(ctl, mem, adr, adr_type, rt->is_int() ); | 783 case T_INT: return new (C, 3) LoadINode (ctl, mem, adr, adr_type, rt->is_int() ); |
784 case T_CHAR: return new (C, 3) LoadCNode(ctl, mem, adr, adr_type, rt->is_int() ); | 784 case T_CHAR: return new (C, 3) LoadUSNode(ctl, mem, adr, adr_type, rt->is_int() ); |
785 case T_SHORT: return new (C, 3) LoadSNode(ctl, mem, adr, adr_type, rt->is_int() ); | 785 case T_SHORT: return new (C, 3) LoadSNode (ctl, mem, adr, adr_type, rt->is_int() ); |
786 case T_LONG: return new (C, 3) LoadLNode(ctl, mem, adr, adr_type, rt->is_long() ); | 786 case T_LONG: return new (C, 3) LoadLNode (ctl, mem, adr, adr_type, rt->is_long() ); |
787 case T_FLOAT: return new (C, 3) LoadFNode(ctl, mem, adr, adr_type, rt ); | 787 case T_FLOAT: return new (C, 3) LoadFNode (ctl, mem, adr, adr_type, rt ); |
788 case T_DOUBLE: return new (C, 3) LoadDNode(ctl, mem, adr, adr_type, rt ); | 788 case T_DOUBLE: return new (C, 3) LoadDNode (ctl, mem, adr, adr_type, rt ); |
789 case T_ADDRESS: return new (C, 3) LoadPNode(ctl, mem, adr, adr_type, rt->is_ptr() ); | 789 case T_ADDRESS: return new (C, 3) LoadPNode (ctl, mem, adr, adr_type, rt->is_ptr() ); |
790 case T_OBJECT: | 790 case T_OBJECT: |
791 #ifdef _LP64 | 791 #ifdef _LP64 |
792 if (adr->bottom_type()->is_ptr_to_narrowoop()) { | 792 if (adr->bottom_type()->is_ptr_to_narrowoop()) { |
793 Node* load = gvn.transform(new (C, 3) LoadNNode(ctl, mem, adr, adr_type, rt->make_narrowoop())); | 793 Node* load = gvn.transform(new (C, 3) LoadNNode(ctl, mem, adr, adr_type, rt->make_narrowoop())); |
794 return new (C, 2) DecodeNNode(load, load->bottom_type()->make_ptr()); | 794 return new (C, 2) DecodeNNode(load, load->bottom_type()->make_ptr()); |
1355 // fold up, do so. | 1355 // fold up, do so. |
1356 Node* prev_mem = find_previous_store(phase); | 1356 Node* prev_mem = find_previous_store(phase); |
1357 // Steps (a), (b): Walk past independent stores to find an exact match. | 1357 // Steps (a), (b): Walk past independent stores to find an exact match. |
1358 if (prev_mem != NULL && prev_mem != in(MemNode::Memory)) { | 1358 if (prev_mem != NULL && prev_mem != in(MemNode::Memory)) { |
1359 // (c) See if we can fold up on the spot, but don't fold up here. | 1359 // (c) See if we can fold up on the spot, but don't fold up here. |
1360 // Fold-up might require truncation (for LoadB/LoadS/LoadC) or | 1360 // Fold-up might require truncation (for LoadB/LoadS/LoadUS) or |
1361 // just return a prior value, which is done by Identity calls. | 1361 // just return a prior value, which is done by Identity calls. |
1362 if (can_see_stored_value(prev_mem, phase)) { | 1362 if (can_see_stored_value(prev_mem, phase)) { |
1363 // Make ready for step (d): | 1363 // Make ready for step (d): |
1364 set_req(MemNode::Memory, prev_mem); | 1364 set_req(MemNode::Memory, prev_mem); |
1365 return this; | 1365 return this; |
1604 } | 1604 } |
1605 // Identity call will handle the case where truncation is not needed. | 1605 // Identity call will handle the case where truncation is not needed. |
1606 return LoadNode::Ideal(phase, can_reshape); | 1606 return LoadNode::Ideal(phase, can_reshape); |
1607 } | 1607 } |
1608 | 1608 |
1609 //--------------------------LoadCNode::Ideal-------------------------------------- | 1609 //--------------------------LoadUSNode::Ideal------------------------------------- |
1610 // | 1610 // |
1611 // If the previous store is to the same address as this load, | 1611 // If the previous store is to the same address as this load, |
1612 // and the value stored was larger than a char, replace this load | 1612 // and the value stored was larger than a char, replace this load |
1613 // with the value stored truncated to a char. If no truncation is | 1613 // with the value stored truncated to a char. If no truncation is |
1614 // needed, the replacement is done in LoadNode::Identity(). | 1614 // needed, the replacement is done in LoadNode::Identity(). |
1615 // | 1615 // |
1616 Node *LoadCNode::Ideal(PhaseGVN *phase, bool can_reshape) { | 1616 Node *LoadUSNode::Ideal(PhaseGVN *phase, bool can_reshape) { |
1617 Node* mem = in(MemNode::Memory); | 1617 Node* mem = in(MemNode::Memory); |
1618 Node* value = can_see_stored_value(mem,phase); | 1618 Node* value = can_see_stored_value(mem,phase); |
1619 if( value && !phase->type(value)->higher_equal( _type ) ) | 1619 if( value && !phase->type(value)->higher_equal( _type ) ) |
1620 return new (phase->C, 3) AndINode(value,phase->intcon(0xFFFF)); | 1620 return new (phase->C, 3) AndINode(value,phase->intcon(0xFFFF)); |
1621 // Identity call will handle the case where truncation is not needed. | 1621 // Identity call will handle the case where truncation is not needed. |