comparison src/cpu/x86/vm/runtime_x86_32.cpp @ 1135:e66fd840cb6b

6893081: method handle & invokedynamic code needs additional cleanup (post 6815692, 6858164) Summary: During the work for 6829187 we have fixed a number of basic bugs which are logically grouped with 6815692 and 6858164 but which must be reviewed and pushed separately. Reviewed-by: kvn, never
author twisti
date Mon, 04 Jan 2010 18:38:08 +0100
parents 0fbdb4381b99
children 93767e6a2dfd
comparison
equal deleted inserted replaced
1134:0910903272e5 1135:e66fd840cb6b
41 // for the nmethod. 41 // for the nmethod.
42 // 42 //
43 // This code is entered with a jmp. 43 // This code is entered with a jmp.
44 // 44 //
45 // Arguments: 45 // Arguments:
46 // rax,: exception oop 46 // rax: exception oop
47 // rdx: exception pc 47 // rdx: exception pc
48 // 48 //
49 // Results: 49 // Results:
50 // rax,: exception oop 50 // rax: exception oop
51 // rdx: exception pc in caller or ??? 51 // rdx: exception pc in caller or ???
52 // destination: exception handler of caller 52 // destination: exception handler of caller
53 // 53 //
54 // Note: the exception pc MUST be at a call (precise debug information) 54 // Note: the exception pc MUST be at a call (precise debug information)
55 // Only register rax, rdx, rcx are not callee saved. 55 // Only register rax, rdx, rcx are not callee saved.
111 __ movptr(rbp, Address(rsp, rbp_off * wordSize)); 111 __ movptr(rbp, Address(rsp, rbp_off * wordSize));
112 112
113 __ addptr(rsp, return_off * wordSize); // Epilog! 113 __ addptr(rsp, return_off * wordSize); // Epilog!
114 __ pop(rdx); // Exception pc 114 __ pop(rdx); // Exception pc
115 115
116 // rax: exception handler for given <exception oop/exception pc>
116 117
117 // rax,: exception handler for given <exception oop/exception pc> 118 // Restore SP from BP if the exception PC is a MethodHandle call.
119 __ cmpl(Address(rcx, JavaThread::is_method_handle_exception_offset()), 0);
120 __ cmovptr(Assembler::notEqual, rsp, rbp);
118 121
119 // We have a handler in rax, (could be deopt blob) 122 // We have a handler in rax, (could be deopt blob)
120 // rdx - throwing pc, deopt blob will need it. 123 // rdx - throwing pc, deopt blob will need it.
121 124
122 __ push(rax); 125 __ push(rax);
123 126
124 // rcx contains handler address
125
126 __ get_thread(rcx); // TLS
127 // Get the exception 127 // Get the exception
128 __ movptr(rax, Address(rcx, JavaThread::exception_oop_offset())); 128 __ movptr(rax, Address(rcx, JavaThread::exception_oop_offset()));
129 // Get the exception pc in case we are deoptimized 129 // Get the exception pc in case we are deoptimized
130 __ movptr(rdx, Address(rcx, JavaThread::exception_pc_offset())); 130 __ movptr(rdx, Address(rcx, JavaThread::exception_pc_offset()));
131 #ifdef ASSERT 131 #ifdef ASSERT
135 // Clear the exception oop so GC no longer processes it as a root. 135 // Clear the exception oop so GC no longer processes it as a root.
136 __ movptr(Address(rcx, JavaThread::exception_oop_offset()), NULL_WORD); 136 __ movptr(Address(rcx, JavaThread::exception_oop_offset()), NULL_WORD);
137 137
138 __ pop(rcx); 138 __ pop(rcx);
139 139
140 // rax,: exception oop 140 // rax: exception oop
141 // rcx: exception handler 141 // rcx: exception handler
142 // rdx: exception pc 142 // rdx: exception pc
143 __ jmp (rcx); 143 __ jmp (rcx);
144 144
145 // ------------- 145 // -------------