2101 mem_phi ->init_req(2, reset_memory());
2102
2103 set_all_memory( _gvn.transform(mem_phi) );
2104 set_i_o( _gvn.transform(io_phi) );
2105 }
2106
2107 set_control( _gvn.transform(result_rgn) );
2108 }
2109
2110 // Add check to deoptimize once holder klass is fully initialized.
2111 void Parse::clinit_deopt() {
2112 assert(C->has_method(), "only for normal compilations");
2113 assert(depth() == 1, "only for main compiled method");
2114 assert(is_normal_parse(), "no barrier needed on osr entry");
2115 assert(method()->needs_clinit_barrier(), "barrier not needed");
2116 assert(method()->holder()->is_being_initialized(), "barrier not needed");
2117
2118 set_parse_bci(0);
2119
2120 Node* holder = makecon(TypeKlassPtr::make(method()->holder()));
2121 int init_state_off = in_bytes(InstanceKlass::init_state_offset());
2122 const Type* t = TypeKlassPtr::make(method()->holder(), init_state_off);
2123 Node* adr = basic_plus_adr(top(), holder, init_state_off);
2124 Node* init_state = make_load(control(), adr, TypeInt::BYTE, T_BYTE, MemNode::unordered);
2125
2126 Node* fully_initialized_state = makecon(TypeInt::make(InstanceKlass::fully_initialized));
2127
2128 Node* chk = gvn().transform(new CmpINode(init_state, fully_initialized_state));
2129 Node* tst = gvn().transform(new BoolNode(chk, BoolTest::ne));
2130
2131 { BuildCutout unless(this, tst, PROB_MAX);
2132 uncommon_trap(Deoptimization::Reason_initialized, Deoptimization::Action_reinterpret);
2133 }
2134 }
2135
2136 // Add check to deoptimize if RTM state is not ProfileRTM
2137 void Parse::rtm_deopt() {
2138 #if INCLUDE_RTM_OPT
2139 if (C->profile_rtm()) {
2140 assert(C->has_method(), "only for normal compilations");
2141 assert(!C->method()->method_data()->is_empty(), "MDO is needed to record RTM state");
2142 assert(depth() == 1, "generate check only for main compiled method");
2143
2144 // Set starting bci for uncommon trap.
2145 set_parse_bci(is_osr_parse() ? osr_bci() : 0);
2146
2147 // Load the rtm_state from the MethodData.
2148 const TypePtr* adr_type = TypeMetadataPtr::make(C->method()->method_data());
2149 Node* mdo = makecon(adr_type);
2150 int offset = MethodData::rtm_state_offset_in_bytes();
2151 Node* adr_node = basic_plus_adr(mdo, mdo, offset);
2152 Node* rtm_state = make_load(control(), adr_node, TypeInt::INT, T_INT, adr_type, MemNode::unordered);
2153
|
2101 mem_phi ->init_req(2, reset_memory());
2102
2103 set_all_memory( _gvn.transform(mem_phi) );
2104 set_i_o( _gvn.transform(io_phi) );
2105 }
2106
2107 set_control( _gvn.transform(result_rgn) );
2108 }
2109
2110 // Add check to deoptimize once holder klass is fully initialized.
2111 void Parse::clinit_deopt() {
2112 assert(C->has_method(), "only for normal compilations");
2113 assert(depth() == 1, "only for main compiled method");
2114 assert(is_normal_parse(), "no barrier needed on osr entry");
2115 assert(method()->needs_clinit_barrier(), "barrier not needed");
2116 assert(method()->holder()->is_being_initialized(), "barrier not needed");
2117
2118 set_parse_bci(0);
2119
2120 Node* holder = makecon(TypeKlassPtr::make(method()->holder()));
2121 guard_klass_being_initialized(holder);
2122 }
2123
2124 // Add check to deoptimize if RTM state is not ProfileRTM
2125 void Parse::rtm_deopt() {
2126 #if INCLUDE_RTM_OPT
2127 if (C->profile_rtm()) {
2128 assert(C->has_method(), "only for normal compilations");
2129 assert(!C->method()->method_data()->is_empty(), "MDO is needed to record RTM state");
2130 assert(depth() == 1, "generate check only for main compiled method");
2131
2132 // Set starting bci for uncommon trap.
2133 set_parse_bci(is_osr_parse() ? osr_bci() : 0);
2134
2135 // Load the rtm_state from the MethodData.
2136 const TypePtr* adr_type = TypeMetadataPtr::make(C->method()->method_data());
2137 Node* mdo = makecon(adr_type);
2138 int offset = MethodData::rtm_state_offset_in_bytes();
2139 Node* adr_node = basic_plus_adr(mdo, mdo, offset);
2140 Node* rtm_state = make_load(control(), adr_node, TypeInt::INT, T_INT, adr_type, MemNode::unordered);
2141
|