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

src/share/vm/opto/macro.cpp

Print this page




1656     Node* fast_lock_mem_phi = new (C, 3) PhiNode( fast_lock_region, Type::MEMORY, TypeRawPtr::BOTTOM);
1657 
1658     // First, check mark word for the biased lock pattern.
1659     Node* mark_node = make_load(ctrl, mem, obj, oopDesc::mark_offset_in_bytes(), TypeX_X, TypeX_X->basic_type());
1660 
1661     // Get fast path - mark word has the biased lock pattern.
1662     ctrl = opt_bits_test(ctrl, fast_lock_region, 1, mark_node,
1663                          markOopDesc::biased_lock_mask_in_place,
1664                          markOopDesc::biased_lock_pattern, true);
1665     // fast_lock_region->in(1) is set to slow path.
1666     fast_lock_mem_phi->init_req(1, mem);
1667 
1668     // Now check that the lock is biased to the current thread and has
1669     // the same epoch and bias as Klass::_prototype_header.
1670 
1671     // Special-case a fresh allocation to avoid building nodes:
1672     Node* klass_node = AllocateNode::Ideal_klass(obj, &_igvn);
1673     if (klass_node == NULL) {
1674       Node* k_adr = basic_plus_adr(obj, oopDesc::klass_offset_in_bytes());
1675       klass_node = transform_later( LoadKlassNode::make(_igvn, mem, k_adr, _igvn.type(k_adr)->is_ptr()) );
1676       klass_node->init_req(0, ctrl);
1677     }
1678     Node *proto_node = make_load(ctrl, mem, klass_node, Klass::prototype_header_offset_in_bytes() + sizeof(oopDesc), TypeX_X, TypeX_X->basic_type());
1679 
1680     Node* thread = transform_later(new (C, 1) ThreadLocalNode());
1681     Node* cast_thread = transform_later(new (C, 2) CastP2XNode(ctrl, thread));
1682     Node* o_node = transform_later(new (C, 3) OrXNode(cast_thread, proto_node));
1683     Node* x_node = transform_later(new (C, 3) XorXNode(o_node, mark_node));
1684 
1685     // Get slow path - mark word does NOT match the value.
1686     Node* not_biased_ctrl =  opt_bits_test(ctrl, region, 3, x_node,
1687                                       (~markOopDesc::age_mask_in_place), 0);
1688     // region->in(3) is set to fast path - the object is biased to the current thread.
1689     mem_phi->init_req(3, mem);
1690 
1691 
1692     // Mark word does NOT match the value (thread | Klass::_prototype_header).
1693 
1694 
1695     // First, check biased pattern.
1696     // Get fast path - _prototype_header has the same biased lock pattern.




1656     Node* fast_lock_mem_phi = new (C, 3) PhiNode( fast_lock_region, Type::MEMORY, TypeRawPtr::BOTTOM);
1657 
1658     // First, check mark word for the biased lock pattern.
1659     Node* mark_node = make_load(ctrl, mem, obj, oopDesc::mark_offset_in_bytes(), TypeX_X, TypeX_X->basic_type());
1660 
1661     // Get fast path - mark word has the biased lock pattern.
1662     ctrl = opt_bits_test(ctrl, fast_lock_region, 1, mark_node,
1663                          markOopDesc::biased_lock_mask_in_place,
1664                          markOopDesc::biased_lock_pattern, true);
1665     // fast_lock_region->in(1) is set to slow path.
1666     fast_lock_mem_phi->init_req(1, mem);
1667 
1668     // Now check that the lock is biased to the current thread and has
1669     // the same epoch and bias as Klass::_prototype_header.
1670 
1671     // Special-case a fresh allocation to avoid building nodes:
1672     Node* klass_node = AllocateNode::Ideal_klass(obj, &_igvn);
1673     if (klass_node == NULL) {
1674       Node* k_adr = basic_plus_adr(obj, oopDesc::klass_offset_in_bytes());
1675       klass_node = transform_later( LoadKlassNode::make(_igvn, mem, k_adr, _igvn.type(k_adr)->is_ptr()) );

1676     }
1677     Node *proto_node = make_load(ctrl, mem, klass_node, Klass::prototype_header_offset_in_bytes() + sizeof(oopDesc), TypeX_X, TypeX_X->basic_type());
1678 
1679     Node* thread = transform_later(new (C, 1) ThreadLocalNode());
1680     Node* cast_thread = transform_later(new (C, 2) CastP2XNode(ctrl, thread));
1681     Node* o_node = transform_later(new (C, 3) OrXNode(cast_thread, proto_node));
1682     Node* x_node = transform_later(new (C, 3) XorXNode(o_node, mark_node));
1683 
1684     // Get slow path - mark word does NOT match the value.
1685     Node* not_biased_ctrl =  opt_bits_test(ctrl, region, 3, x_node,
1686                                       (~markOopDesc::age_mask_in_place), 0);
1687     // region->in(3) is set to fast path - the object is biased to the current thread.
1688     mem_phi->init_req(3, mem);
1689 
1690 
1691     // Mark word does NOT match the value (thread | Klass::_prototype_header).
1692 
1693 
1694     // First, check biased pattern.
1695     // 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