< prev index next >

src/share/vm/oops/instanceKlass.cpp

Print this page




1195     outputStream* log = Log(class, init)::info_stream();
1196     log->print("%d Initializing ", call_class_initializer_counter++);
1197     name()->print_value_on(log);
1198     log->print_cr("%s (" INTPTR_FORMAT ")", h_method() == NULL ? "(no method)" : "", p2i(this));
1199   }
1200   if (h_method() != NULL) {
1201     JavaCallArguments args; // No arguments
1202     JavaValue result(T_VOID);
1203     JavaCalls::call(&result, h_method, &args, CHECK); // Static call (no args)
1204   }
1205 }
1206 
1207 
1208 void InstanceKlass::mask_for(const methodHandle& method, int bci,
1209   InterpreterOopMap* entry_for) {
1210   // Lazily create the _oop_map_cache at first request
1211   // Lock-free access requires load_ptr_acquire.
1212   OopMapCache* oop_map_cache =
1213       static_cast<OopMapCache*>(OrderAccess::load_ptr_acquire(&_oop_map_cache));
1214   if (oop_map_cache == NULL) {
1215     MutexLocker x(OopMapCacheAlloc_lock);
1216     // Check if _oop_map_cache was allocated while we were waiting for this lock
1217     if ((oop_map_cache = _oop_map_cache) == NULL) {
1218       oop_map_cache = new OopMapCache();
1219       // Ensure _oop_map_cache is stable, since it is examined without a lock
1220       OrderAccess::release_store_ptr(&_oop_map_cache, oop_map_cache);
1221     }
1222   }
1223   // _oop_map_cache is constant after init; lookup below does its own locking.
1224   oop_map_cache->lookup(method, bci, entry_for);
1225 }
1226 
1227 
1228 bool InstanceKlass::find_local_field(Symbol* name, Symbol* sig, fieldDescriptor* fd) const {
1229   for (JavaFieldStream fs(this); !fs.done(); fs.next()) {
1230     Symbol* f_name = fs.name();
1231     Symbol* f_sig  = fs.signature();
1232     if (f_name == name && f_sig == sig) {
1233       fd->reinitialize(const_cast<InstanceKlass*>(this), fs.index());
1234       return true;
1235     }




1195     outputStream* log = Log(class, init)::info_stream();
1196     log->print("%d Initializing ", call_class_initializer_counter++);
1197     name()->print_value_on(log);
1198     log->print_cr("%s (" INTPTR_FORMAT ")", h_method() == NULL ? "(no method)" : "", p2i(this));
1199   }
1200   if (h_method() != NULL) {
1201     JavaCallArguments args; // No arguments
1202     JavaValue result(T_VOID);
1203     JavaCalls::call(&result, h_method, &args, CHECK); // Static call (no args)
1204   }
1205 }
1206 
1207 
1208 void InstanceKlass::mask_for(const methodHandle& method, int bci,
1209   InterpreterOopMap* entry_for) {
1210   // Lazily create the _oop_map_cache at first request
1211   // Lock-free access requires load_ptr_acquire.
1212   OopMapCache* oop_map_cache =
1213       static_cast<OopMapCache*>(OrderAccess::load_ptr_acquire(&_oop_map_cache));
1214   if (oop_map_cache == NULL) {
1215     MutexLockerEx x(OopMapCacheAlloc_lock,  Mutex::_no_safepoint_check_flag);
1216     // Check if _oop_map_cache was allocated while we were waiting for this lock
1217     if ((oop_map_cache = _oop_map_cache) == NULL) {
1218       oop_map_cache = new OopMapCache();
1219       // Ensure _oop_map_cache is stable, since it is examined without a lock
1220       OrderAccess::release_store_ptr(&_oop_map_cache, oop_map_cache);
1221     }
1222   }
1223   // _oop_map_cache is constant after init; lookup below does its own locking.
1224   oop_map_cache->lookup(method, bci, entry_for);
1225 }
1226 
1227 
1228 bool InstanceKlass::find_local_field(Symbol* name, Symbol* sig, fieldDescriptor* fd) const {
1229   for (JavaFieldStream fs(this); !fs.done(); fs.next()) {
1230     Symbol* f_name = fs.name();
1231     Symbol* f_sig  = fs.signature();
1232     if (f_name == name && f_sig == sig) {
1233       fd->reinitialize(const_cast<InstanceKlass*>(this), fs.index());
1234       return true;
1235     }


< prev index next >