Mercurial > hg > truffle
comparison src/share/vm/opto/memnode.cpp @ 11198:1e6d5dec4a4e
Merge.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 05 Aug 2013 13:20:06 +0200 |
parents | 3aa636f2a743 |
children | edb5ab0f3fe5 7944aba7ba41 |
comparison
equal
deleted
inserted
replaced
11197:3479ab380552 | 11198:1e6d5dec4a4e |
---|---|
2928 // Return a node which is more "ideal" than the current node. Strip out | 2928 // Return a node which is more "ideal" than the current node. Strip out |
2929 // control copies | 2929 // control copies |
2930 Node *MemBarNode::Ideal(PhaseGVN *phase, bool can_reshape) { | 2930 Node *MemBarNode::Ideal(PhaseGVN *phase, bool can_reshape) { |
2931 if (remove_dead_region(phase, can_reshape)) return this; | 2931 if (remove_dead_region(phase, can_reshape)) return this; |
2932 // Don't bother trying to transform a dead node | 2932 // Don't bother trying to transform a dead node |
2933 if (in(0) && in(0)->is_top()) return NULL; | 2933 if (in(0) && in(0)->is_top()) { |
2934 return NULL; | |
2935 } | |
2934 | 2936 |
2935 // Eliminate volatile MemBars for scalar replaced objects. | 2937 // Eliminate volatile MemBars for scalar replaced objects. |
2936 if (can_reshape && req() == (Precedent+1)) { | 2938 if (can_reshape && req() == (Precedent+1)) { |
2937 bool eliminate = false; | 2939 bool eliminate = false; |
2938 int opc = Opcode(); | 2940 int opc = Opcode(); |
2939 if ((opc == Op_MemBarAcquire || opc == Op_MemBarVolatile)) { | 2941 if ((opc == Op_MemBarAcquire || opc == Op_MemBarVolatile)) { |
2940 // Volatile field loads and stores. | 2942 // Volatile field loads and stores. |
2941 Node* my_mem = in(MemBarNode::Precedent); | 2943 Node* my_mem = in(MemBarNode::Precedent); |
2944 // The MembarAquire may keep an unused LoadNode alive through the Precedent edge | |
2945 if ((my_mem != NULL) && (opc == Op_MemBarAcquire) && (my_mem->outcnt() == 1)) { | |
2946 // if the Precedent is a decodeN and its input (a Load) is used at more than one place, | |
2947 // replace this Precedent (decodeN) with the Load instead. | |
2948 if ((my_mem->Opcode() == Op_DecodeN) && (my_mem->in(1)->outcnt() > 1)) { | |
2949 Node* load_node = my_mem->in(1); | |
2950 set_req(MemBarNode::Precedent, load_node); | |
2951 phase->is_IterGVN()->_worklist.push(my_mem); | |
2952 my_mem = load_node; | |
2953 } else { | |
2954 assert(my_mem->unique_out() == this, "sanity"); | |
2955 del_req(Precedent); | |
2956 phase->is_IterGVN()->_worklist.push(my_mem); // remove dead node later | |
2957 my_mem = NULL; | |
2958 } | |
2959 } | |
2942 if (my_mem != NULL && my_mem->is_Mem()) { | 2960 if (my_mem != NULL && my_mem->is_Mem()) { |
2943 const TypeOopPtr* t_oop = my_mem->in(MemNode::Address)->bottom_type()->isa_oopptr(); | 2961 const TypeOopPtr* t_oop = my_mem->in(MemNode::Address)->bottom_type()->isa_oopptr(); |
2944 // Check for scalar replaced object reference. | 2962 // Check for scalar replaced object reference. |
2945 if( t_oop != NULL && t_oop->is_known_instance_field() && | 2963 if( t_oop != NULL && t_oop->is_known_instance_field() && |
2946 t_oop->offset() != Type::OffsetBot && | 2964 t_oop->offset() != Type::OffsetBot && |
4382 } | 4400 } |
4383 assert(expected_wide_mem, "expected narrow slice replacement"); | 4401 assert(expected_wide_mem, "expected narrow slice replacement"); |
4384 } | 4402 } |
4385 } | 4403 } |
4386 #else // !ASSERT | 4404 #else // !ASSERT |
4387 #define verify_memory_slice(m,i,n) (0) // PRODUCT version is no-op | 4405 #define verify_memory_slice(m,i,n) (void)(0) // PRODUCT version is no-op |
4388 #endif | 4406 #endif |
4389 | 4407 |
4390 | 4408 |
4391 //-----------------------------memory_at--------------------------------------- | 4409 //-----------------------------memory_at--------------------------------------- |
4392 Node* MergeMemNode::memory_at(uint alias_idx) const { | 4410 Node* MergeMemNode::memory_at(uint alias_idx) const { |