src/share/vm/opto/macro.cpp

Print this page
rev 3688 : 7054512: Compress class pointers after perm gen removal
Summary: support of compress class pointers in the compilers.
Reviewed-by:


2108 
2109     // First, check mark word for the biased lock pattern.
2110     Node* mark_node = make_load(ctrl, mem, obj, oopDesc::mark_offset_in_bytes(), TypeX_X, TypeX_X->basic_type());
2111 
2112     // Get fast path - mark word has the biased lock pattern.
2113     ctrl = opt_bits_test(ctrl, fast_lock_region, 1, mark_node,
2114                          markOopDesc::biased_lock_mask_in_place,
2115                          markOopDesc::biased_lock_pattern, true);
2116     // fast_lock_region->in(1) is set to slow path.
2117     fast_lock_mem_phi->init_req(1, mem);
2118 
2119     // Now check that the lock is biased to the current thread and has
2120     // the same epoch and bias as Klass::_prototype_header.
2121 
2122     // Special-case a fresh allocation to avoid building nodes:
2123     Node* klass_node = AllocateNode::Ideal_klass(obj, &_igvn);
2124     if (klass_node == NULL) {
2125       Node* k_adr = basic_plus_adr(obj, oopDesc::klass_offset_in_bytes());
2126       klass_node = transform_later( LoadKlassNode::make(_igvn, mem, k_adr, _igvn.type(k_adr)->is_ptr()) );
2127 #ifdef _LP64
2128       if (UseCompressedOops && klass_node->is_DecodeN()) {
2129         assert(klass_node->in(1)->Opcode() == Op_LoadNKlass, "sanity");
2130         klass_node->in(1)->init_req(0, ctrl);
2131       } else
2132 #endif
2133       klass_node->init_req(0, ctrl);
2134     }
2135     Node *proto_node = make_load(ctrl, mem, klass_node, in_bytes(Klass::prototype_header_offset()), TypeX_X, TypeX_X->basic_type());
2136 
2137     Node* thread = transform_later(new (C) ThreadLocalNode());
2138     Node* cast_thread = transform_later(new (C) CastP2XNode(ctrl, thread));
2139     Node* o_node = transform_later(new (C) OrXNode(cast_thread, proto_node));
2140     Node* x_node = transform_later(new (C) XorXNode(o_node, mark_node));
2141 
2142     // Get slow path - mark word does NOT match the value.
2143     Node* not_biased_ctrl =  opt_bits_test(ctrl, region, 3, x_node,
2144                                       (~markOopDesc::age_mask_in_place), 0);
2145     // region->in(3) is set to fast path - the object is biased to the current thread.
2146     mem_phi->init_req(3, mem);
2147 
2148 




2108 
2109     // First, check mark word for the biased lock pattern.
2110     Node* mark_node = make_load(ctrl, mem, obj, oopDesc::mark_offset_in_bytes(), TypeX_X, TypeX_X->basic_type());
2111 
2112     // Get fast path - mark word has the biased lock pattern.
2113     ctrl = opt_bits_test(ctrl, fast_lock_region, 1, mark_node,
2114                          markOopDesc::biased_lock_mask_in_place,
2115                          markOopDesc::biased_lock_pattern, true);
2116     // fast_lock_region->in(1) is set to slow path.
2117     fast_lock_mem_phi->init_req(1, mem);
2118 
2119     // Now check that the lock is biased to the current thread and has
2120     // the same epoch and bias as Klass::_prototype_header.
2121 
2122     // Special-case a fresh allocation to avoid building nodes:
2123     Node* klass_node = AllocateNode::Ideal_klass(obj, &_igvn);
2124     if (klass_node == NULL) {
2125       Node* k_adr = basic_plus_adr(obj, oopDesc::klass_offset_in_bytes());
2126       klass_node = transform_later( LoadKlassNode::make(_igvn, mem, k_adr, _igvn.type(k_adr)->is_ptr()) );
2127 #ifdef _LP64
2128       if (UseCompressedKlassPointers && klass_node->is_DecodeNKlass()) {
2129         assert(klass_node->in(1)->Opcode() == Op_LoadNKlass, "sanity");
2130         klass_node->in(1)->init_req(0, ctrl);
2131       } else
2132 #endif
2133       klass_node->init_req(0, ctrl);
2134     }
2135     Node *proto_node = make_load(ctrl, mem, klass_node, in_bytes(Klass::prototype_header_offset()), TypeX_X, TypeX_X->basic_type());
2136 
2137     Node* thread = transform_later(new (C) ThreadLocalNode());
2138     Node* cast_thread = transform_later(new (C) CastP2XNode(ctrl, thread));
2139     Node* o_node = transform_later(new (C) OrXNode(cast_thread, proto_node));
2140     Node* x_node = transform_later(new (C) XorXNode(o_node, mark_node));
2141 
2142     // Get slow path - mark word does NOT match the value.
2143     Node* not_biased_ctrl =  opt_bits_test(ctrl, region, 3, x_node,
2144                                       (~markOopDesc::age_mask_in_place), 0);
2145     // region->in(3) is set to fast path - the object is biased to the current thread.
2146     mem_phi->init_req(3, mem);
2147 
2148