hotspot/src/share/vm/oops/method.cpp
changeset 46996 9cbcd7082efe
parent 46768 58f648e29a26
child 47103 a993ec29ec75
equal deleted inserted replaced
46992:95000145dd81 46996:9cbcd7082efe
   212 
   212 
   213   return -1;
   213   return -1;
   214 }
   214 }
   215 
   215 
   216 void Method::mask_for(int bci, InterpreterOopMap* mask) {
   216 void Method::mask_for(int bci, InterpreterOopMap* mask) {
   217 
   217   methodHandle h_this(Thread::current(), this);
   218   Thread* myThread    = Thread::current();
   218   // Only GC uses the OopMapCache during thread stack root scanning
   219   methodHandle h_this(myThread, this);
   219   // any other uses generate an oopmap but do not save it in the cache.
   220 #if defined(ASSERT) && !INCLUDE_JVMCI
   220   if (Universe::heap()->is_gc_active()) {
   221   bool has_capability = myThread->is_VM_thread() ||
   221     method_holder()->mask_for(h_this, bci, mask);
   222                         myThread->is_ConcurrentGC_thread() ||
   222   } else {
   223                         myThread->is_GC_task_thread();
   223     OopMapCache::compute_one_oop_map(h_this, bci, mask);
   224 
   224   }
   225   if (!has_capability) {
       
   226     if (!VerifyStack && !VerifyLastFrame) {
       
   227       // verify stack calls this outside VM thread
       
   228       warning("oopmap should only be accessed by the "
       
   229               "VM, GC task or CMS threads (or during debugging)");
       
   230       InterpreterOopMap local_mask;
       
   231       method_holder()->mask_for(h_this, bci, &local_mask);
       
   232       local_mask.print();
       
   233     }
       
   234   }
       
   235 #endif
       
   236   method_holder()->mask_for(h_this, bci, mask);
       
   237   return;
   225   return;
   238 }
   226 }
   239 
   227 
   240 
   228 
   241 int Method::bci_from(address bcp) const {
   229 int Method::bci_from(address bcp) const {