Mercurial > hg > truffle
comparison src/share/vm/opto/parseHelper.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 | a61af66fc99e |
children | d1605aabd0a1 |
comparison
equal
deleted
inserted
replaced
163:885ed790ecf0 | 164:c436414a719e |
---|---|
36 // Get base of thread-local storage area | 36 // Get base of thread-local storage area |
37 Node* thread = _gvn.transform( new (C, 1) ThreadLocalNode() ); | 37 Node* thread = _gvn.transform( new (C, 1) ThreadLocalNode() ); |
38 | 38 |
39 // Get method | 39 // Get method |
40 const TypeInstPtr* method_type = TypeInstPtr::make(TypePtr::Constant, method->klass(), true, method, 0); | 40 const TypeInstPtr* method_type = TypeInstPtr::make(TypePtr::Constant, method->klass(), true, method, 0); |
41 Node *method_node = _gvn.transform( new (C, 1) ConPNode(method_type) ); | 41 Node *method_node = _gvn.transform( ConNode::make(C, method_type) ); |
42 | 42 |
43 kill_dead_locals(); | 43 kill_dead_locals(); |
44 | 44 |
45 // For some reason, this call reads only raw memory. | 45 // For some reason, this call reads only raw memory. |
46 const TypePtr* raw_adr_type = TypeRawPtr::BOTTOM; | 46 const TypePtr* raw_adr_type = TypeRawPtr::BOTTOM; |
141 | 141 |
142 // Extract the array klass type | 142 // Extract the array klass type |
143 int klass_offset = oopDesc::klass_offset_in_bytes(); | 143 int klass_offset = oopDesc::klass_offset_in_bytes(); |
144 Node* p = basic_plus_adr( ary, ary, klass_offset ); | 144 Node* p = basic_plus_adr( ary, ary, klass_offset ); |
145 // p's type is array-of-OOPS plus klass_offset | 145 // p's type is array-of-OOPS plus klass_offset |
146 Node* array_klass = _gvn.transform(new (C, 3) LoadKlassNode(0, immutable_memory(), p, TypeInstPtr::KLASS)); | 146 Node* array_klass = _gvn.transform( LoadKlassNode::make(_gvn, immutable_memory(), p, TypeInstPtr::KLASS) ); |
147 // Get the array klass | 147 // Get the array klass |
148 const TypeKlassPtr *tak = _gvn.type(array_klass)->is_klassptr(); | 148 const TypeKlassPtr *tak = _gvn.type(array_klass)->is_klassptr(); |
149 | 149 |
150 // array_klass's type is generally INexact array-of-oop. Heroically | 150 // array_klass's type is generally INexact array-of-oop. Heroically |
151 // cast the array klass to EXACT array and uncommon-trap if the cast | 151 // cast the array klass to EXACT array and uncommon-trap if the cast |
187 // Come here for polymorphic array klasses | 187 // Come here for polymorphic array klasses |
188 | 188 |
189 // Extract the array element class | 189 // Extract the array element class |
190 int element_klass_offset = objArrayKlass::element_klass_offset_in_bytes() + sizeof(oopDesc); | 190 int element_klass_offset = objArrayKlass::element_klass_offset_in_bytes() + sizeof(oopDesc); |
191 Node *p2 = basic_plus_adr(array_klass, array_klass, element_klass_offset); | 191 Node *p2 = basic_plus_adr(array_klass, array_klass, element_klass_offset); |
192 Node *a_e_klass = _gvn.transform(new (C, 3) LoadKlassNode(0, immutable_memory(), p2, tak)); | 192 Node *a_e_klass = _gvn.transform( LoadKlassNode::make(_gvn, immutable_memory(), p2, tak) ); |
193 | 193 |
194 // Check (the hard way) and throw if not a subklass. | 194 // Check (the hard way) and throw if not a subklass. |
195 // Result is ignored, we just need the CFG effects. | 195 // Result is ignored, we just need the CFG effects. |
196 gen_checkcast( obj, a_e_klass ); | 196 gen_checkcast( obj, a_e_klass ); |
197 } | 197 } |