83 84 ciInstanceKlass* field_holder = field->holder(); 85 86 if (is_field == field->is_static()) { 87 // Interpreter will throw java_lang_IncompatibleClassChangeError 88 // Check this before allowing <clinit> methods to access static fields 89 uncommon_trap(Deoptimization::Reason_unhandled, 90 Deoptimization::Action_none); 91 return; 92 } 93 94 if (!is_field && !field_holder->is_initialized()) { 95 if (!static_field_ok_in_clinit(field, method())) { 96 uncommon_trap(Deoptimization::Reason_uninitialized, 97 Deoptimization::Action_reinterpret, 98 NULL, "!static_field_ok_in_clinit"); 99 return; 100 } 101 } 102 103 assert(field->will_link(method()->holder(), bc()), "getfield: typeflow responsibility"); 104 105 // Note: We do not check for an unloaded field type here any more. 106 107 // Generate code for the object pointer. 108 Node* obj; 109 if (is_field) { 110 int obj_depth = is_get ? 0 : field->type()->size(); 111 obj = do_null_check(peek(obj_depth), T_OBJECT); 112 // Compile-time detect of null-exception? 113 if (stopped()) return; 114 115 #ifdef ASSERT 116 const TypeInstPtr *tjp = TypeInstPtr::make(TypePtr::NotNull, iter().get_declared_field_holder()); 117 assert(_gvn.type(obj)->higher_equal(tjp), "cast_up is no longer needed"); 118 #endif 119 120 if (is_get) { 121 --_sp; // pop receiver before getting 122 do_get_xxx(obj, field, is_field); | 83 84 ciInstanceKlass* field_holder = field->holder(); 85 86 if (is_field == field->is_static()) { 87 // Interpreter will throw java_lang_IncompatibleClassChangeError 88 // Check this before allowing <clinit> methods to access static fields 89 uncommon_trap(Deoptimization::Reason_unhandled, 90 Deoptimization::Action_none); 91 return; 92 } 93 94 if (!is_field && !field_holder->is_initialized()) { 95 if (!static_field_ok_in_clinit(field, method())) { 96 uncommon_trap(Deoptimization::Reason_uninitialized, 97 Deoptimization::Action_reinterpret, 98 NULL, "!static_field_ok_in_clinit"); 99 return; 100 } 101 } 102 103 // Deoptimize on putfield writes to CallSite.target 104 if (!is_get && field->is_call_site_target()) { 105 uncommon_trap(Deoptimization::Reason_unhandled, 106 Deoptimization::Action_reinterpret, 107 NULL, "put to CallSite.target field"); 108 return; 109 } 110 111 assert(field->will_link(method()->holder(), bc()), "getfield: typeflow responsibility"); 112 113 // Note: We do not check for an unloaded field type here any more. 114 115 // Generate code for the object pointer. 116 Node* obj; 117 if (is_field) { 118 int obj_depth = is_get ? 0 : field->type()->size(); 119 obj = do_null_check(peek(obj_depth), T_OBJECT); 120 // Compile-time detect of null-exception? 121 if (stopped()) return; 122 123 #ifdef ASSERT 124 const TypeInstPtr *tjp = TypeInstPtr::make(TypePtr::NotNull, iter().get_declared_field_holder()); 125 assert(_gvn.type(obj)->higher_equal(tjp), "cast_up is no longer needed"); 126 #endif 127 128 if (is_get) { 129 --_sp; // pop receiver before getting 130 do_get_xxx(obj, field, is_field); |