hotspot/src/share/vm/code/compiledIC.cpp
changeset 26912 19021f626ad2
parent 26580 8cca7fbe77b8
child 32401 cc58aeaec340
equal deleted inserted replaced
26911:8f2c7a83220f 26912:19021f626ad2
   153 address CompiledIC::stub_address() const {
   153 address CompiledIC::stub_address() const {
   154   assert(is_in_transition_state(), "should only be called when we are in a transition state");
   154   assert(is_in_transition_state(), "should only be called when we are in a transition state");
   155   return _ic_call->destination();
   155   return _ic_call->destination();
   156 }
   156 }
   157 
   157 
       
   158 // Clears the IC stub if the compiled IC is in transition state
       
   159 void CompiledIC::clear_ic_stub() {
       
   160   if (is_in_transition_state()) {
       
   161     ICStub* stub = ICStub_from_destination_address(stub_address());
       
   162     stub->clear();
       
   163   }
       
   164 }
       
   165 
   158 
   166 
   159 //-----------------------------------------------------------------------------
   167 //-----------------------------------------------------------------------------
   160 // High-level access to an inline cache. Guaranteed to be MT-safe.
   168 // High-level access to an inline cache. Guaranteed to be MT-safe.
   161 
   169 
   162 void CompiledIC::initialize_from_iter(RelocIterator* iter) {
   170 void CompiledIC::initialize_from_iter(RelocIterator* iter) {
   331   // we only need to patch the destination
   339   // we only need to patch the destination
   332   bool safe_transition = is_optimized() || SafepointSynchronize::is_at_safepoint();
   340   bool safe_transition = is_optimized() || SafepointSynchronize::is_at_safepoint();
   333 
   341 
   334   if (safe_transition) {
   342   if (safe_transition) {
   335     // Kill any leftover stub we might have too
   343     // Kill any leftover stub we might have too
   336     if (is_in_transition_state()) {
   344     clear_ic_stub();
   337       ICStub* old_stub = ICStub_from_destination_address(stub_address());
       
   338       old_stub->clear();
       
   339     }
       
   340     if (is_optimized()) {
   345     if (is_optimized()) {
   341     set_ic_destination(entry);
   346     set_ic_destination(entry);
   342   } else {
   347   } else {
   343       set_ic_destination_and_value(entry, (void*)NULL);
   348       set_ic_destination_and_value(entry, (void*)NULL);
   344     }
   349     }