Mercurial > hg > truffle
comparison src/share/vm/opto/graphKit.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 | ba764ed4b6f2 |
children | d1605aabd0a1 6aae2f9d0294 |
comparison
equal
deleted
inserted
replaced
163:885ed790ecf0 | 164:c436414a719e |
---|---|
530 // Cheat with a preallocated exception object. | 530 // Cheat with a preallocated exception object. |
531 if (C->log() != NULL) | 531 if (C->log() != NULL) |
532 C->log()->elem("hot_throw preallocated='1' reason='%s'", | 532 C->log()->elem("hot_throw preallocated='1' reason='%s'", |
533 Deoptimization::trap_reason_name(reason)); | 533 Deoptimization::trap_reason_name(reason)); |
534 const TypeInstPtr* ex_con = TypeInstPtr::make(ex_obj); | 534 const TypeInstPtr* ex_con = TypeInstPtr::make(ex_obj); |
535 Node* ex_node = _gvn.transform(new (C, 1) ConPNode(ex_con)); | 535 Node* ex_node = _gvn.transform( ConNode::make(C, ex_con) ); |
536 | 536 |
537 // Clear the detail message of the preallocated exception object. | 537 // Clear the detail message of the preallocated exception object. |
538 // Weblogic sometimes mutates the detail message of exceptions | 538 // Weblogic sometimes mutates the detail message of exceptions |
539 // using reflection. | 539 // using reflection. |
540 int offset = java_lang_Throwable::get_detailMessage_offset(); | 540 int offset = java_lang_Throwable::get_detailMessage_offset(); |
1041 Node* GraphKit::load_object_klass(Node* obj) { | 1041 Node* GraphKit::load_object_klass(Node* obj) { |
1042 // Special-case a fresh allocation to avoid building nodes: | 1042 // Special-case a fresh allocation to avoid building nodes: |
1043 Node* akls = AllocateNode::Ideal_klass(obj, &_gvn); | 1043 Node* akls = AllocateNode::Ideal_klass(obj, &_gvn); |
1044 if (akls != NULL) return akls; | 1044 if (akls != NULL) return akls; |
1045 Node* k_adr = basic_plus_adr(obj, oopDesc::klass_offset_in_bytes()); | 1045 Node* k_adr = basic_plus_adr(obj, oopDesc::klass_offset_in_bytes()); |
1046 return _gvn.transform( new (C, 3) LoadKlassNode(0, immutable_memory(), k_adr, TypeInstPtr::KLASS) ); | 1046 return _gvn.transform( LoadKlassNode::make(_gvn, immutable_memory(), k_adr, TypeInstPtr::KLASS) ); |
1047 } | 1047 } |
1048 | 1048 |
1049 //-------------------------load_array_length----------------------------------- | 1049 //-------------------------load_array_length----------------------------------- |
1050 Node* GraphKit::load_array_length(Node* array) { | 1050 Node* GraphKit::load_array_length(Node* array) { |
1051 // Special-case a fresh allocation to avoid building nodes: | 1051 // Special-case a fresh allocation to avoid building nodes: |
2208 Node *p2 = _gvn.transform( new (C, 4) AddPNode(subklass,subklass,chk_off_X) ); | 2208 Node *p2 = _gvn.transform( new (C, 4) AddPNode(subklass,subklass,chk_off_X) ); |
2209 // For some types like interfaces the following loadKlass is from a 1-word | 2209 // For some types like interfaces the following loadKlass is from a 1-word |
2210 // cache which is mutable so can't use immutable memory. Other | 2210 // cache which is mutable so can't use immutable memory. Other |
2211 // types load from the super-class display table which is immutable. | 2211 // types load from the super-class display table which is immutable. |
2212 Node *kmem = might_be_cache ? memory(p2) : immutable_memory(); | 2212 Node *kmem = might_be_cache ? memory(p2) : immutable_memory(); |
2213 Node *nkls = _gvn.transform( new (C, 3) LoadKlassNode( NULL, kmem, p2, _gvn.type(p2)->is_ptr(), TypeKlassPtr::OBJECT_OR_NULL ) ); | 2213 Node *nkls = _gvn.transform( LoadKlassNode::make( _gvn, kmem, p2, _gvn.type(p2)->is_ptr(), TypeKlassPtr::OBJECT_OR_NULL ) ); |
2214 | 2214 |
2215 // Compile speed common case: ARE a subtype and we canNOT fail | 2215 // Compile speed common case: ARE a subtype and we canNOT fail |
2216 if( superklass == nkls ) | 2216 if( superklass == nkls ) |
2217 return top(); // false path is dead; no test needed. | 2217 return top(); // false path is dead; no test needed. |
2218 | 2218 |
2799 if (ReduceFieldZeroing && !raw_mem_only) { | 2799 if (ReduceFieldZeroing && !raw_mem_only) { |
2800 // Extract memory strands which may participate in the new object's | 2800 // Extract memory strands which may participate in the new object's |
2801 // initialization, and source them from the new InitializeNode. | 2801 // initialization, and source them from the new InitializeNode. |
2802 // This will allow us to observe initializations when they occur, | 2802 // This will allow us to observe initializations when they occur, |
2803 // and link them properly (as a group) to the InitializeNode. | 2803 // and link them properly (as a group) to the InitializeNode. |
2804 Node* klass_node = alloc->in(AllocateNode::KlassNode); | |
2805 assert(init->in(InitializeNode::Memory) == malloc, ""); | 2804 assert(init->in(InitializeNode::Memory) == malloc, ""); |
2806 MergeMemNode* minit_in = MergeMemNode::make(C, malloc); | 2805 MergeMemNode* minit_in = MergeMemNode::make(C, malloc); |
2807 init->set_req(InitializeNode::Memory, minit_in); | 2806 init->set_req(InitializeNode::Memory, minit_in); |
2808 record_for_igvn(minit_in); // fold it up later, if possible | 2807 record_for_igvn(minit_in); // fold it up later, if possible |
2809 Node* minit_out = memory(rawidx); | 2808 Node* minit_out = memory(rawidx); |