1143 void Method::set_code(const methodHandle& mh, CompiledMethod *code) {
1144 MutexLockerEx pl(Patching_lock, Mutex::_no_safepoint_check_flag);
1145 assert( code, "use clear_code to remove code" );
1146 assert( mh->check_code(), "" );
1147
1148 guarantee(mh->adapter() != NULL, "Adapter blob must already exist!");
1149
1150 // These writes must happen in this order, because the interpreter will
1151 // directly jump to from_interpreted_entry which jumps to an i2c adapter
1152 // which jumps to _from_compiled_entry.
1153 mh->_code = code; // Assign before allowing compiled code to exec
1154
1155 int comp_level = code->comp_level();
1156 // In theory there could be a race here. In practice it is unlikely
1157 // and not worth worrying about.
1158 if (comp_level > mh->highest_comp_level()) {
1159 mh->set_highest_comp_level(comp_level);
1160 }
1161
1162 OrderAccess::storestore();
1163 #ifdef SHARK
1164 mh->_from_interpreted_entry = code->insts_begin();
1165 #else //!SHARK
1166 mh->_from_compiled_entry = code->verified_entry_point();
1167 OrderAccess::storestore();
1168 // Instantly compiled code can execute.
1169 if (!mh->is_method_handle_intrinsic())
1170 mh->_from_interpreted_entry = mh->get_i2c_entry();
1171 #endif //!SHARK
1172 }
1173
1174
1175 bool Method::is_overridden_in(Klass* k) const {
1176 InstanceKlass* ik = InstanceKlass::cast(k);
1177
1178 if (ik->is_interface()) return false;
1179
1180 // If method is an interface, we skip it - except if it
1181 // is a miranda method
1182 if (method_holder()->is_interface()) {
1183 // Check that method is not a miranda method
1184 if (ik->lookup_method(name(), signature()) == NULL) {
1185 // No implementation exist - so miranda method
1186 return false;
1187 }
1188 return true;
1189 }
1190
1191 assert(ik->is_subclass_of(method_holder()), "should be subklass");
|
1143 void Method::set_code(const methodHandle& mh, CompiledMethod *code) {
1144 MutexLockerEx pl(Patching_lock, Mutex::_no_safepoint_check_flag);
1145 assert( code, "use clear_code to remove code" );
1146 assert( mh->check_code(), "" );
1147
1148 guarantee(mh->adapter() != NULL, "Adapter blob must already exist!");
1149
1150 // These writes must happen in this order, because the interpreter will
1151 // directly jump to from_interpreted_entry which jumps to an i2c adapter
1152 // which jumps to _from_compiled_entry.
1153 mh->_code = code; // Assign before allowing compiled code to exec
1154
1155 int comp_level = code->comp_level();
1156 // In theory there could be a race here. In practice it is unlikely
1157 // and not worth worrying about.
1158 if (comp_level > mh->highest_comp_level()) {
1159 mh->set_highest_comp_level(comp_level);
1160 }
1161
1162 OrderAccess::storestore();
1163 mh->_from_compiled_entry = code->verified_entry_point();
1164 OrderAccess::storestore();
1165 // Instantly compiled code can execute.
1166 if (!mh->is_method_handle_intrinsic())
1167 mh->_from_interpreted_entry = mh->get_i2c_entry();
1168 }
1169
1170
1171 bool Method::is_overridden_in(Klass* k) const {
1172 InstanceKlass* ik = InstanceKlass::cast(k);
1173
1174 if (ik->is_interface()) return false;
1175
1176 // If method is an interface, we skip it - except if it
1177 // is a miranda method
1178 if (method_holder()->is_interface()) {
1179 // Check that method is not a miranda method
1180 if (ik->lookup_method(name(), signature()) == NULL) {
1181 // No implementation exist - so miranda method
1182 return false;
1183 }
1184 return true;
1185 }
1186
1187 assert(ik->is_subclass_of(method_holder()), "should be subklass");
|