comparison src/share/vm/c1/c1_Runtime1.cpp @ 4137:04b9a2566eec

Merge with hsx23/hotspot.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Sat, 17 Dec 2011 21:40:27 +0100
parents 82f88223fcff cec1757a0134
children 723df37192d6
comparison
equal deleted inserted replaced
3737:9dc19b7d89a3 4137:04b9a2566eec
381 const char* klass_name = Klass::cast(obj->klass())->external_name(); 381 const char* klass_name = Klass::cast(obj->klass())->external_name();
382 SharedRuntime::throw_and_post_jvmti_exception(thread, vmSymbols::java_lang_ArrayStoreException(), klass_name); 382 SharedRuntime::throw_and_post_jvmti_exception(thread, vmSymbols::java_lang_ArrayStoreException(), klass_name);
383 JRT_END 383 JRT_END
384 384
385 385
386 JRT_ENTRY(void, Runtime1::post_jvmti_exception_throw(JavaThread* thread)) 386 // counter_overflow() is called from within C1-compiled methods. The enclosing method is the method
387 if (JvmtiExport::can_post_on_exceptions()) { 387 // associated with the top activation record. The inlinee (that is possibly included in the enclosing
388 vframeStream vfst(thread, true); 388 // method) method oop is passed as an argument. In order to do that it is embedded in the code as
389 address bcp = vfst.method()->bcp_from(vfst.bci()); 389 // a constant.
390 JvmtiExport::post_exception_throw(thread, vfst.method(), bcp, thread->exception_oop());
391 }
392 JRT_END
393
394 // This is a helper to allow us to safepoint but allow the outer entry
395 // to be safepoint free if we need to do an osr
396 static nmethod* counter_overflow_helper(JavaThread* THREAD, int branch_bci, methodOopDesc* m) { 390 static nmethod* counter_overflow_helper(JavaThread* THREAD, int branch_bci, methodOopDesc* m) {
397 nmethod* osr_nm = NULL; 391 nmethod* osr_nm = NULL;
398 methodHandle method(THREAD, m); 392 methodHandle method(THREAD, m);
399 393
400 RegisterMap map(THREAD, false); 394 RegisterMap map(THREAD, false);
426 default: ; 420 default: ;
427 } 421 }
428 bci = branch_bci + offset; 422 bci = branch_bci + offset;
429 } 423 }
430 424
431 osr_nm = CompilationPolicy::policy()->event(enclosing_method, method, branch_bci, bci, level, THREAD); 425 osr_nm = CompilationPolicy::policy()->event(enclosing_method, method, branch_bci, bci, level, nm, THREAD);
432 return osr_nm; 426 return osr_nm;
433 } 427 }
434 428
435 JRT_BLOCK_ENTRY(address, Runtime1::counter_overflow(JavaThread* thread, int bci, methodOopDesc* method)) 429 JRT_BLOCK_ENTRY(address, Runtime1::counter_overflow(JavaThread* thread, int bci, methodOopDesc* method))
436 nmethod* osr_nm; 430 nmethod* osr_nm;
785 // When using fast locking, the compiled code has already tried the fast case 779 // When using fast locking, the compiled code has already tried the fast case
786 ObjectSynchronizer::slow_exit(obj, lock->lock(), THREAD); 780 ObjectSynchronizer::slow_exit(obj, lock->lock(), THREAD);
787 } else { 781 } else {
788 ObjectSynchronizer::fast_exit(obj, lock->lock(), THREAD); 782 ObjectSynchronizer::fast_exit(obj, lock->lock(), THREAD);
789 } 783 }
784 JRT_END
785
786 // Cf. OptoRuntime::deoptimize_caller_frame
787 JRT_ENTRY(void, Runtime1::deoptimize(JavaThread* thread))
788 // Called from within the owner thread, so no need for safepoint
789 RegisterMap reg_map(thread, false);
790 frame stub_frame = thread->last_frame();
791 assert(stub_frame.is_runtime_frame(), "sanity check");
792 frame caller_frame = stub_frame.sender(&reg_map);
793
794 // We are coming from a compiled method; check this is true.
795 assert(CodeCache::find_nmethod(caller_frame.pc()) != NULL, "sanity");
796
797 // Deoptimize the caller frame.
798 Deoptimization::deoptimize_frame(thread, caller_frame.id());
799
800 // Return to the now deoptimized frame.
790 JRT_END 801 JRT_END
791 802
792 803
793 static klassOop resolve_field_return_klass(methodHandle caller, int bci, TRAPS) { 804 static klassOop resolve_field_return_klass(methodHandle caller, int bci, TRAPS) {
794 Bytecode_field field_access(caller, bci); 805 Bytecode_field field_access(caller, bci);