Mercurial > hg > graal-compiler
comparison src/cpu/x86/vm/sharedRuntime_x86_64.cpp @ 2059:9508a52cbd32
Add deoptimization blob support.
author | Thomas Wuerthinger <wuerthinger@ssw.jku.at> |
---|---|
date | Wed, 19 Jan 2011 15:48:15 +0100 |
parents | f95d63e2154a |
children | d25d4ca69222 |
comparison
equal
deleted
inserted
replaced
2058:8f033d37798a | 2059:9508a52cbd32 |
---|---|
2653 __ jcc(Assembler::zero, no_pending_exception); | 2653 __ jcc(Assembler::zero, no_pending_exception); |
2654 __ stop("must not have pending exception here"); | 2654 __ stop("must not have pending exception here"); |
2655 __ bind(no_pending_exception); | 2655 __ bind(no_pending_exception); |
2656 #endif | 2656 #endif |
2657 | 2657 |
2658 // (tw) Start of C1X uncommon trap code. | |
2659 __ jmp(cont); | |
2660 | |
2661 int uncommon_trap_offset = __ pc() - start; | |
2662 | |
2663 // Warning: Duplicate code | |
2664 | |
2665 // Save everything in sight. | |
2666 map = RegisterSaver::save_live_registers(masm, 0, &frame_size_in_words); | |
2667 | |
2668 // Normal deoptimization | |
2669 | |
2670 | |
2671 // fetch_unroll_info needs to call last_java_frame() | |
2672 __ set_last_Java_frame(noreg, noreg, NULL); | |
2673 | |
2674 __ movl(c_rarg1, (int32_t)Deoptimization::Unpack_reexecute); | |
2675 __ movl(r14, c_rarg1); // save into r14 for later call to unpack_frames | |
2676 __ mov(c_rarg0, r15_thread); | |
2677 __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, Deoptimization::uncommon_trap))); | |
2678 | |
2679 // Need to have an oopmap that tells fetch_unroll_info where to | |
2680 // find any register it might need. | |
2681 | |
2682 oop_maps->add_gc_map( __ pc()-start, map->deep_copy()); | |
2683 | |
2684 __ reset_last_Java_frame(false, false); | |
2685 | |
2686 Label after_fetch_unroll_info_call; | |
2687 __ jmp(after_fetch_unroll_info_call); | |
2688 | |
2689 | |
2690 // (tw) End of C1X uncommon trap code. | |
2691 | |
2658 __ bind(cont); | 2692 __ bind(cont); |
2659 | 2693 |
2660 // Call C code. Need thread and this frame, but NOT official VM entry | 2694 // Call C code. Need thread and this frame, but NOT official VM entry |
2661 // crud. We cannot block on this call, no GC can happen. | 2695 // crud. We cannot block on this call, no GC can happen. |
2662 // | 2696 // |
2681 // Need to have an oopmap that tells fetch_unroll_info where to | 2715 // Need to have an oopmap that tells fetch_unroll_info where to |
2682 // find any register it might need. | 2716 // find any register it might need. |
2683 oop_maps->add_gc_map(__ pc() - start, map); | 2717 oop_maps->add_gc_map(__ pc() - start, map); |
2684 | 2718 |
2685 __ reset_last_Java_frame(false, false); | 2719 __ reset_last_Java_frame(false, false); |
2720 | |
2721 __ bind(after_fetch_unroll_info_call); | |
2686 | 2722 |
2687 // Load UnrollBlock* into rdi | 2723 // Load UnrollBlock* into rdi |
2688 __ mov(rdi, rax); | 2724 __ mov(rdi, rax); |
2689 | 2725 |
2690 Label noException; | 2726 Label noException; |
2843 // Make sure all code is generated | 2879 // Make sure all code is generated |
2844 masm->flush(); | 2880 masm->flush(); |
2845 | 2881 |
2846 _deopt_blob = DeoptimizationBlob::create(&buffer, oop_maps, 0, exception_offset, reexecute_offset, frame_size_in_words); | 2882 _deopt_blob = DeoptimizationBlob::create(&buffer, oop_maps, 0, exception_offset, reexecute_offset, frame_size_in_words); |
2847 _deopt_blob->set_unpack_with_exception_in_tls_offset(exception_in_tls_offset); | 2883 _deopt_blob->set_unpack_with_exception_in_tls_offset(exception_in_tls_offset); |
2884 _deopt_blob->set_uncommon_trap_offset(uncommon_trap_offset); | |
2848 } | 2885 } |
2849 | 2886 |
2850 #ifdef COMPILER2 | 2887 #ifdef COMPILER2 |
2851 //------------------------------generate_uncommon_trap_blob-------------------- | 2888 //------------------------------generate_uncommon_trap_blob-------------------- |
2852 void SharedRuntime::generate_uncommon_trap_blob() { | 2889 void SharedRuntime::generate_uncommon_trap_blob() { |