src/share/vm/opto/macro.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 6782820 Sdiff src/share/vm/opto

src/share/vm/opto/macro.cpp

Print this page




1707     Node* fast_lock_mem_phi = new (C, 3) PhiNode( fast_lock_region, Type::MEMORY, TypeRawPtr::BOTTOM);
1708 
1709     // First, check mark word for the biased lock pattern.
1710     Node* mark_node = make_load(ctrl, mem, obj, oopDesc::mark_offset_in_bytes(), TypeX_X, TypeX_X->basic_type());
1711 
1712     // Get fast path - mark word has the biased lock pattern.
1713     ctrl = opt_bits_test(ctrl, fast_lock_region, 1, mark_node,
1714                          markOopDesc::biased_lock_mask_in_place,
1715                          markOopDesc::biased_lock_pattern, true);
1716     // fast_lock_region->in(1) is set to slow path.
1717     fast_lock_mem_phi->init_req(1, mem);
1718 
1719     // Now check that the lock is biased to the current thread and has
1720     // the same epoch and bias as Klass::_prototype_header.
1721 
1722     // Special-case a fresh allocation to avoid building nodes:
1723     Node* klass_node = AllocateNode::Ideal_klass(obj, &_igvn);
1724     if (klass_node == NULL) {
1725       Node* k_adr = basic_plus_adr(obj, oopDesc::klass_offset_in_bytes());
1726       klass_node = transform_later( LoadKlassNode::make(_igvn, mem, k_adr, _igvn.type(k_adr)->is_ptr()) );







1727     }
1728     Node *proto_node = make_load(ctrl, mem, klass_node, Klass::prototype_header_offset_in_bytes() + sizeof(oopDesc), TypeX_X, TypeX_X->basic_type());
1729 
1730     Node* thread = transform_later(new (C, 1) ThreadLocalNode());
1731     Node* cast_thread = transform_later(new (C, 2) CastP2XNode(ctrl, thread));
1732     Node* o_node = transform_later(new (C, 3) OrXNode(cast_thread, proto_node));
1733     Node* x_node = transform_later(new (C, 3) XorXNode(o_node, mark_node));
1734 
1735     // Get slow path - mark word does NOT match the value.
1736     Node* not_biased_ctrl =  opt_bits_test(ctrl, region, 3, x_node,
1737                                       (~markOopDesc::age_mask_in_place), 0);
1738     // region->in(3) is set to fast path - the object is biased to the current thread.
1739     mem_phi->init_req(3, mem);
1740 
1741 
1742     // Mark word does NOT match the value (thread | Klass::_prototype_header).
1743 
1744 
1745     // First, check biased pattern.
1746     // Get fast path - _prototype_header has the same biased lock pattern.




1707     Node* fast_lock_mem_phi = new (C, 3) PhiNode( fast_lock_region, Type::MEMORY, TypeRawPtr::BOTTOM);
1708 
1709     // First, check mark word for the biased lock pattern.
1710     Node* mark_node = make_load(ctrl, mem, obj, oopDesc::mark_offset_in_bytes(), TypeX_X, TypeX_X->basic_type());
1711 
1712     // Get fast path - mark word has the biased lock pattern.
1713     ctrl = opt_bits_test(ctrl, fast_lock_region, 1, mark_node,
1714                          markOopDesc::biased_lock_mask_in_place,
1715                          markOopDesc::biased_lock_pattern, true);
1716     // fast_lock_region->in(1) is set to slow path.
1717     fast_lock_mem_phi->init_req(1, mem);
1718 
1719     // Now check that the lock is biased to the current thread and has
1720     // the same epoch and bias as Klass::_prototype_header.
1721 
1722     // Special-case a fresh allocation to avoid building nodes:
1723     Node* klass_node = AllocateNode::Ideal_klass(obj, &_igvn);
1724     if (klass_node == NULL) {
1725       Node* k_adr = basic_plus_adr(obj, oopDesc::klass_offset_in_bytes());
1726       klass_node = transform_later( LoadKlassNode::make(_igvn, mem, k_adr, _igvn.type(k_adr)->is_ptr()) );
1727 #ifdef _LP64
1728       if (UseCompressedOops && klass_node->is_DecodeN()) {
1729         assert(klass_node->in(1)->Opcode() == Op_LoadNKlass, "sanity");
1730         klass_node->in(1)->init_req(0, ctrl);
1731       } else
1732 #endif
1733       klass_node->init_req(0, ctrl);
1734     }
1735     Node *proto_node = make_load(ctrl, mem, klass_node, Klass::prototype_header_offset_in_bytes() + sizeof(oopDesc), TypeX_X, TypeX_X->basic_type());
1736 
1737     Node* thread = transform_later(new (C, 1) ThreadLocalNode());
1738     Node* cast_thread = transform_later(new (C, 2) CastP2XNode(ctrl, thread));
1739     Node* o_node = transform_later(new (C, 3) OrXNode(cast_thread, proto_node));
1740     Node* x_node = transform_later(new (C, 3) XorXNode(o_node, mark_node));
1741 
1742     // Get slow path - mark word does NOT match the value.
1743     Node* not_biased_ctrl =  opt_bits_test(ctrl, region, 3, x_node,
1744                                       (~markOopDesc::age_mask_in_place), 0);
1745     // region->in(3) is set to fast path - the object is biased to the current thread.
1746     mem_phi->init_req(3, mem);
1747 
1748 
1749     // Mark word does NOT match the value (thread | Klass::_prototype_header).
1750 
1751 
1752     // First, check biased pattern.
1753     // Get fast path - _prototype_header has the same biased lock pattern.


src/share/vm/opto/macro.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File