< prev index next >

src/hotspot/share/opto/graphKit.cpp

Print this page




3289   // from sliding up past the just-emitted store.
3290 
3291   MemBarNode* mb = MemBarNode::make(C, opcode, alias_idx, precedent);
3292   mb->set_req(TypeFunc::Control,control());
3293   if (alias_idx == Compile::AliasIdxBot) {
3294     mb->set_req(TypeFunc::Memory, merged_memory()->base_memory());
3295   } else {
3296     assert(!(opcode == Op_Initialize && alias_idx != Compile::AliasIdxRaw), "fix caller");
3297     mb->set_req(TypeFunc::Memory, memory(alias_idx));
3298   }
3299   Node* membar = _gvn.transform(mb);
3300   set_control(_gvn.transform(new ProjNode(membar, TypeFunc::Control)));
3301   if (alias_idx == Compile::AliasIdxBot) {
3302     merged_memory()->set_base_memory(_gvn.transform(new ProjNode(membar, TypeFunc::Memory)));
3303   } else {
3304     set_memory(_gvn.transform(new ProjNode(membar, TypeFunc::Memory)),alias_idx);
3305   }
3306   return membar;
3307 }
3308 
3309 void GraphKit::insert_store_load_for_barrier() {
3310   Node* mem = reset_memory();
3311   MemBarNode* mb = MemBarNode::make(C, Op_MemBarVolatile, Compile::AliasIdxRaw);
3312   mb->init_req(TypeFunc::Control, control());
3313   mb->init_req(TypeFunc::Memory, mem);
3314   Node* membar = _gvn.transform(mb);
3315   set_control(_gvn.transform(new ProjNode(membar, TypeFunc::Control)));
3316   Node* newmem = _gvn.transform(new ProjNode(membar, TypeFunc::Memory));
3317   set_all_memory(mem);
3318   set_memory(newmem, Compile::AliasIdxRaw);
3319 }
3320 
3321 //------------------------------shared_lock------------------------------------
3322 // Emit locking code.
3323 FastLockNode* GraphKit::shared_lock(Node* obj) {
3324   // bci is either a monitorenter bc or InvocationEntryBci
3325   // %%% SynchronizationEntryBCI is redundant; use InvocationEntryBci in interfaces
3326   assert(SynchronizationEntryBCI == InvocationEntryBci, "");
3327 
3328   if( !GenerateSynchronizationCode )
3329     return NULL;                // Not locking things?
3330   if (stopped())                // Dead monitor?
3331     return NULL;
3332 
3333   assert(dead_locals_are_killed(), "should kill locals before sync. point");
3334 
3335   obj = access_resolve(obj, ACCESS_READ | ACCESS_WRITE);
3336 
3337   // Box the stack location
3338   Node* box = _gvn.transform(new BoxLockNode(next_monitor()));
3339   Node* mem = reset_memory();
3340 




3289   // from sliding up past the just-emitted store.
3290 
3291   MemBarNode* mb = MemBarNode::make(C, opcode, alias_idx, precedent);
3292   mb->set_req(TypeFunc::Control,control());
3293   if (alias_idx == Compile::AliasIdxBot) {
3294     mb->set_req(TypeFunc::Memory, merged_memory()->base_memory());
3295   } else {
3296     assert(!(opcode == Op_Initialize && alias_idx != Compile::AliasIdxRaw), "fix caller");
3297     mb->set_req(TypeFunc::Memory, memory(alias_idx));
3298   }
3299   Node* membar = _gvn.transform(mb);
3300   set_control(_gvn.transform(new ProjNode(membar, TypeFunc::Control)));
3301   if (alias_idx == Compile::AliasIdxBot) {
3302     merged_memory()->set_base_memory(_gvn.transform(new ProjNode(membar, TypeFunc::Memory)));
3303   } else {
3304     set_memory(_gvn.transform(new ProjNode(membar, TypeFunc::Memory)),alias_idx);
3305   }
3306   return membar;
3307 }
3308 












3309 //------------------------------shared_lock------------------------------------
3310 // Emit locking code.
3311 FastLockNode* GraphKit::shared_lock(Node* obj) {
3312   // bci is either a monitorenter bc or InvocationEntryBci
3313   // %%% SynchronizationEntryBCI is redundant; use InvocationEntryBci in interfaces
3314   assert(SynchronizationEntryBCI == InvocationEntryBci, "");
3315 
3316   if( !GenerateSynchronizationCode )
3317     return NULL;                // Not locking things?
3318   if (stopped())                // Dead monitor?
3319     return NULL;
3320 
3321   assert(dead_locals_are_killed(), "should kill locals before sync. point");
3322 
3323   obj = access_resolve(obj, ACCESS_READ | ACCESS_WRITE);
3324 
3325   // Box the stack location
3326   Node* box = _gvn.transform(new BoxLockNode(next_monitor()));
3327   Node* mem = reset_memory();
3328 


< prev index next >