Mercurial > hg > truffle
comparison src/share/vm/opto/memnode.cpp @ 3849:f1c12354c3f7
7074017: Introduce MemBarAcquireLock/MemBarReleaseLock nodes for monitor enter/exit code paths
Summary: replace MemBarAcquire/MemBarRelease nodes on the monitor enter/exit code paths with new MemBarAcquireLock/MemBarReleaseLock nodes
Reviewed-by: kvn, twisti
author | roland |
---|---|
date | Tue, 02 Aug 2011 18:36:40 +0200 |
parents | 286c498ae0d4 |
children | 11a4af030e4b |
comparison
equal
deleted
inserted
replaced
3848:a19c671188cb | 3849:f1c12354c3f7 |
---|---|
923 // through any kind of MemBar but normal loads shouldn't skip | 923 // through any kind of MemBar but normal loads shouldn't skip |
924 // through MemBarAcquire since the could allow them to move out of | 924 // through MemBarAcquire since the could allow them to move out of |
925 // a synchronized region. | 925 // a synchronized region. |
926 while (current->is_Proj()) { | 926 while (current->is_Proj()) { |
927 int opc = current->in(0)->Opcode(); | 927 int opc = current->in(0)->Opcode(); |
928 if ((final && opc == Op_MemBarAcquire) || | 928 if ((final && (opc == Op_MemBarAcquire || opc == Op_MemBarAcquireLock)) || |
929 opc == Op_MemBarRelease || opc == Op_MemBarCPUOrder) { | 929 opc == Op_MemBarRelease || opc == Op_MemBarCPUOrder || |
930 opc == Op_MemBarReleaseLock) { | |
930 Node* mem = current->in(0)->in(TypeFunc::Memory); | 931 Node* mem = current->in(0)->in(TypeFunc::Memory); |
931 if (mem->is_MergeMem()) { | 932 if (mem->is_MergeMem()) { |
932 MergeMemNode* merge = mem->as_MergeMem(); | 933 MergeMemNode* merge = mem->as_MergeMem(); |
933 Node* new_st = merge->memory_at(alias_idx); | 934 Node* new_st = merge->memory_at(alias_idx); |
934 if (new_st == merge->base_memory()) { | 935 if (new_st == merge->base_memory()) { |
2664 MemBarNode* MemBarNode::make(Compile* C, int opcode, int atp, Node* pn) { | 2665 MemBarNode* MemBarNode::make(Compile* C, int opcode, int atp, Node* pn) { |
2665 int len = Precedent + (pn == NULL? 0: 1); | 2666 int len = Precedent + (pn == NULL? 0: 1); |
2666 switch (opcode) { | 2667 switch (opcode) { |
2667 case Op_MemBarAcquire: return new(C, len) MemBarAcquireNode(C, atp, pn); | 2668 case Op_MemBarAcquire: return new(C, len) MemBarAcquireNode(C, atp, pn); |
2668 case Op_MemBarRelease: return new(C, len) MemBarReleaseNode(C, atp, pn); | 2669 case Op_MemBarRelease: return new(C, len) MemBarReleaseNode(C, atp, pn); |
2670 case Op_MemBarAcquireLock: return new(C, len) MemBarAcquireLockNode(C, atp, pn); | |
2671 case Op_MemBarReleaseLock: return new(C, len) MemBarReleaseLockNode(C, atp, pn); | |
2669 case Op_MemBarVolatile: return new(C, len) MemBarVolatileNode(C, atp, pn); | 2672 case Op_MemBarVolatile: return new(C, len) MemBarVolatileNode(C, atp, pn); |
2670 case Op_MemBarCPUOrder: return new(C, len) MemBarCPUOrderNode(C, atp, pn); | 2673 case Op_MemBarCPUOrder: return new(C, len) MemBarCPUOrderNode(C, atp, pn); |
2671 case Op_Initialize: return new(C, len) InitializeNode(C, atp, pn); | 2674 case Op_Initialize: return new(C, len) InitializeNode(C, atp, pn); |
2672 default: ShouldNotReachHere(); return NULL; | 2675 default: ShouldNotReachHere(); return NULL; |
2673 } | 2676 } |