2146 LoadFlattenedArrayStub* slow_path = NULL; 2147 2148 if (x->elt_type() == T_OBJECT && x->array()->maybe_flattened_array()) { 2149 index.load_item(); 2150 // if we are loading from flattened array, load it using a runtime call 2151 slow_path = new LoadFlattenedArrayStub(array.result(), index.result(), result, state_for(x)); 2152 check_flattened_array(array.result(), LIR_OprFact::illegalOpr, slow_path); 2153 } 2154 2155 DecoratorSet decorators = IN_HEAP | IS_ARRAY; 2156 access_load_at(decorators, x->elt_type(), 2157 array, index.result(), result, 2158 NULL, null_check_info); 2159 2160 if (slow_path != NULL) { 2161 __ branch_destination(slow_path->continuation()); 2162 } 2163 } 2164 } 2165 2166 2167 void LIRGenerator::do_NullCheck(NullCheck* x) { 2168 if (x->can_trap()) { 2169 LIRItem value(x->obj(), this); 2170 value.load_item(); 2171 CodeEmitInfo* info = state_for(x); 2172 __ null_check(value.result(), info); 2173 } 2174 } 2175 2176 2177 void LIRGenerator::do_TypeCast(TypeCast* x) { 2178 LIRItem value(x->obj(), this); 2179 value.load_item(); 2180 // the result is the same as from the node we are casting 2181 set_result(x, value.result()); 2182 } 2183 2184 2185 void LIRGenerator::do_Throw(Throw* x) { | 2146 LoadFlattenedArrayStub* slow_path = NULL; 2147 2148 if (x->elt_type() == T_OBJECT && x->array()->maybe_flattened_array()) { 2149 index.load_item(); 2150 // if we are loading from flattened array, load it using a runtime call 2151 slow_path = new LoadFlattenedArrayStub(array.result(), index.result(), result, state_for(x)); 2152 check_flattened_array(array.result(), LIR_OprFact::illegalOpr, slow_path); 2153 } 2154 2155 DecoratorSet decorators = IN_HEAP | IS_ARRAY; 2156 access_load_at(decorators, x->elt_type(), 2157 array, index.result(), result, 2158 NULL, null_check_info); 2159 2160 if (slow_path != NULL) { 2161 __ branch_destination(slow_path->continuation()); 2162 } 2163 } 2164 } 2165 2166 void LIRGenerator::do_WithField(WithField* x) { 2167 // This happens only when a class X uses the withfield bytecode to refer to 2168 // an inline class V, where V has not yet been loaded. This is not a common 2169 // case. Let's just deoptimize. 2170 CodeEmitInfo* info = state_for(x, x->state_before()); 2171 CodeStub* stub = new DeoptimizeStub(new CodeEmitInfo(info), 2172 Deoptimization::Reason_unloaded, 2173 Deoptimization::Action_make_not_entrant); 2174 __ branch(lir_cond_always, T_ILLEGAL, stub); 2175 LIR_Opr reg = rlock_result(x, T_OBJECT); 2176 __ move(LIR_OprFact::oopConst(NULL), reg); 2177 } 2178 2179 void LIRGenerator::do_DefaultValue(DefaultValue* x) { 2180 // Same as withfield above. Let's deoptimize. 2181 CodeEmitInfo* info = state_for(x, x->state_before()); 2182 CodeStub* stub = new DeoptimizeStub(new CodeEmitInfo(info), 2183 Deoptimization::Reason_unloaded, 2184 Deoptimization::Action_make_not_entrant); 2185 __ branch(lir_cond_always, T_ILLEGAL, stub); 2186 LIR_Opr reg = rlock_result(x, T_OBJECT); 2187 __ move(LIR_OprFact::oopConst(NULL), reg); 2188 } 2189 2190 void LIRGenerator::do_NullCheck(NullCheck* x) { 2191 if (x->can_trap()) { 2192 LIRItem value(x->obj(), this); 2193 value.load_item(); 2194 CodeEmitInfo* info = state_for(x); 2195 __ null_check(value.result(), info); 2196 } 2197 } 2198 2199 2200 void LIRGenerator::do_TypeCast(TypeCast* x) { 2201 LIRItem value(x->obj(), this); 2202 value.load_item(); 2203 // the result is the same as from the node we are casting 2204 set_result(x, value.result()); 2205 } 2206 2207 2208 void LIRGenerator::do_Throw(Throw* x) { |