comparison src/share/vm/code/compiledIC.cpp @ 23660:b5f3a471e646

Merge.
author Doug Simon <doug.simon@oracle.com>
date Wed, 01 Jun 2016 00:11:44 +0200
parents be896a1983c0 be740540f60c
children
comparison
equal deleted inserted replaced
23411:d7cf78885a3a 23660:b5f3a471e646
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) {
279 CodeBlob* caller = CodeCache::find_blob_unsafe(instruction_address()); 287 CodeBlob* caller = CodeCache::find_blob_unsafe(instruction_address());
280 bool is_c1_or_jvmci_method = caller->is_compiled_by_c1() || caller->is_compiled_by_jvmci(); 288 bool is_c1_or_jvmci_method = caller->is_compiled_by_c1() || caller->is_compiled_by_jvmci();
281 assert( is_c1_or_jvmci_method || 289 assert( is_c1_or_jvmci_method ||
282 !is_monomorphic || 290 !is_monomorphic ||
283 is_optimized() || 291 is_optimized() ||
292 !caller->is_alive() ||
284 (cached_metadata() != NULL && cached_metadata()->is_klass()), "sanity check"); 293 (cached_metadata() != NULL && cached_metadata()->is_klass()), "sanity check");
285 #endif // ASSERT 294 #endif // ASSERT
286 return is_monomorphic; 295 return is_monomorphic;
287 } 296 }
288 297
313 } 322 }
314 return is_call_to_interpreted; 323 return is_call_to_interpreted;
315 } 324 }
316 325
317 326
318 void CompiledIC::set_to_clean() { 327 void CompiledIC::set_to_clean(bool in_use) {
319 assert(SafepointSynchronize::is_at_safepoint() || CompiledIC_lock->is_locked() , "MT-unsafe call"); 328 assert(SafepointSynchronize::is_at_safepoint() || CompiledIC_lock->is_locked() , "MT-unsafe call");
320 if (TraceInlineCacheClearing || TraceICs) { 329 if (TraceInlineCacheClearing || TraceICs) {
321 tty->print_cr("IC@" INTPTR_FORMAT ": set to clean", p2i(instruction_address())); 330 tty->print_cr("IC@" INTPTR_FORMAT ": set to clean", p2i(instruction_address()));
322 print(); 331 print();
323 } 332 }
329 entry = SharedRuntime::get_resolve_virtual_call_stub(); 338 entry = SharedRuntime::get_resolve_virtual_call_stub();
330 } 339 }
331 340
332 // A zombie transition will always be safe, since the metadata has already been set to NULL, so 341 // A zombie transition will always be safe, since the metadata has already been set to NULL, so
333 // we only need to patch the destination 342 // we only need to patch the destination
334 bool safe_transition = is_optimized() || SafepointSynchronize::is_at_safepoint(); 343 bool safe_transition = !in_use || is_optimized() || SafepointSynchronize::is_at_safepoint();
335 344
336 if (safe_transition) { 345 if (safe_transition) {
337 // Kill any leftover stub we might have too 346 // Kill any leftover stub we might have too
338 if (is_in_transition_state()) { 347 clear_ic_stub();
339 ICStub* old_stub = ICStub_from_destination_address(stub_address());
340 old_stub->clear();
341 }
342 if (is_optimized()) { 348 if (is_optimized()) {
343 set_ic_destination(entry); 349 set_ic_destination(entry);
344 } else { 350 } else {
345 set_ic_destination_and_value(entry, (void*)NULL); 351 set_ic_destination_and_value(entry, (void*)NULL);
346 } 352 }
347 } else { 353 } else {
348 // Unsafe transition - create stub. 354 // Unsafe transition - create stub.
349 InlineCacheBuffer::create_transition_stub(this, NULL, entry); 355 InlineCacheBuffer::create_transition_stub(this, NULL, entry);