Mercurial > hg > graal-jvmci-8
comparison src/cpu/x86/vm/templateInterpreter_x86_32.cpp @ 512:db4caa99ef11
6787106: Hotspot 32 bit build fails on platforms having different definitions for intptr_t & int32_t
Summary: Avoid casting between int32_t and intptr_t specifically for MasmAssembler::movptr in 32 bit platforms.
Reviewed-by: jrose, kvn
author | xlu |
---|---|
date | Wed, 24 Dec 2008 13:06:09 -0800 |
parents | 9ee9cf798b59 |
children | dc3ad84615cf |
comparison
equal
deleted
inserted
replaced
511:dabd8d202164 | 512:db4caa99ef11 |
---|---|
108 __ call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::create_klass_exception), rax, rbx); | 108 __ call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::create_klass_exception), rax, rbx); |
109 } else { | 109 } else { |
110 if (message != NULL) { | 110 if (message != NULL) { |
111 __ lea(rbx, ExternalAddress((address)message)); | 111 __ lea(rbx, ExternalAddress((address)message)); |
112 } else { | 112 } else { |
113 __ movptr(rbx, (int32_t)NULL_WORD); | 113 __ movptr(rbx, NULL_WORD); |
114 } | 114 } |
115 __ call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::create_exception), rax, rbx); | 115 __ call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::create_exception), rax, rbx); |
116 } | 116 } |
117 // throw exception | 117 // throw exception |
118 __ jump(ExternalAddress(Interpreter::throw_exception_entry())); | 118 __ jump(ExternalAddress(Interpreter::throw_exception_entry())); |
121 | 121 |
122 | 122 |
123 address TemplateInterpreterGenerator::generate_continuation_for(TosState state) { | 123 address TemplateInterpreterGenerator::generate_continuation_for(TosState state) { |
124 address entry = __ pc(); | 124 address entry = __ pc(); |
125 // NULL last_sp until next java call | 125 // NULL last_sp until next java call |
126 __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), (int32_t)NULL_WORD); | 126 __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), NULL_WORD); |
127 __ dispatch_next(state); | 127 __ dispatch_next(state); |
128 return entry; | 128 return entry; |
129 } | 129 } |
130 | 130 |
131 | 131 |
174 __ MacroAssembler::verify_FPU(state == ftos || state == dtos ? 1 : 0, "generate_return_entry_for in interpreter"); | 174 __ MacroAssembler::verify_FPU(state == ftos || state == dtos ? 1 : 0, "generate_return_entry_for in interpreter"); |
175 | 175 |
176 // Restore stack bottom in case i2c adjusted stack | 176 // Restore stack bottom in case i2c adjusted stack |
177 __ movptr(rsp, Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize)); | 177 __ movptr(rsp, Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize)); |
178 // and NULL it as marker that rsp is now tos until next java call | 178 // and NULL it as marker that rsp is now tos until next java call |
179 __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), (int32_t)NULL_WORD); | 179 __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), NULL_WORD); |
180 | 180 |
181 __ restore_bcp(); | 181 __ restore_bcp(); |
182 __ restore_locals(); | 182 __ restore_locals(); |
183 __ get_cache_and_index_at_bcp(rbx, rcx, 1); | 183 __ get_cache_and_index_at_bcp(rbx, rcx, 1); |
184 __ movl(rbx, Address(rbx, rcx, | 184 __ movl(rbx, Address(rbx, rcx, |
209 | 209 |
210 __ MacroAssembler::verify_FPU(state == ftos || state == dtos ? 1 : 0, "generate_deopt_entry_for in interpreter"); | 210 __ MacroAssembler::verify_FPU(state == ftos || state == dtos ? 1 : 0, "generate_deopt_entry_for in interpreter"); |
211 | 211 |
212 // The stack is not extended by deopt but we must NULL last_sp as this | 212 // The stack is not extended by deopt but we must NULL last_sp as this |
213 // entry is like a "return". | 213 // entry is like a "return". |
214 __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), (int32_t)NULL_WORD); | 214 __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), NULL_WORD); |
215 __ restore_bcp(); | 215 __ restore_bcp(); |
216 __ restore_locals(); | 216 __ restore_locals(); |
217 // handle exceptions | 217 // handle exceptions |
218 { Label L; | 218 { Label L; |
219 const Register thread = rcx; | 219 const Register thread = rcx; |
1026 | 1026 |
1027 __ reset_last_Java_frame(thread, true, true); | 1027 __ reset_last_Java_frame(thread, true, true); |
1028 | 1028 |
1029 // reset handle block | 1029 // reset handle block |
1030 __ movptr(t, Address(thread, JavaThread::active_handles_offset())); | 1030 __ movptr(t, Address(thread, JavaThread::active_handles_offset())); |
1031 __ movptr(Address(t, JNIHandleBlock::top_offset_in_bytes()), (int32_t)NULL_WORD); | 1031 __ movptr(Address(t, JNIHandleBlock::top_offset_in_bytes()), NULL_WORD); |
1032 | 1032 |
1033 // If result was an oop then unbox and save it in the frame | 1033 // If result was an oop then unbox and save it in the frame |
1034 { Label L; | 1034 { Label L; |
1035 Label no_oop, store_result; | 1035 Label no_oop, store_result; |
1036 ExternalAddress handler(AbstractInterpreter::result_handler(T_OBJECT)); | 1036 ExternalAddress handler(AbstractInterpreter::result_handler(T_OBJECT)); |
1486 // Entry point in previous activation (i.e., if the caller was interpreted) | 1486 // Entry point in previous activation (i.e., if the caller was interpreted) |
1487 Interpreter::_rethrow_exception_entry = __ pc(); | 1487 Interpreter::_rethrow_exception_entry = __ pc(); |
1488 | 1488 |
1489 // Restore sp to interpreter_frame_last_sp even though we are going | 1489 // Restore sp to interpreter_frame_last_sp even though we are going |
1490 // to empty the expression stack for the exception processing. | 1490 // to empty the expression stack for the exception processing. |
1491 __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), (int32_t)NULL_WORD); | 1491 __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), NULL_WORD); |
1492 // rax,: exception | 1492 // rax,: exception |
1493 // rdx: return address/pc that threw exception | 1493 // rdx: return address/pc that threw exception |
1494 __ restore_bcp(); // rsi points to call/send | 1494 __ restore_bcp(); // rsi points to call/send |
1495 __ restore_locals(); | 1495 __ restore_locals(); |
1496 | 1496 |
1606 __ super_call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::popframe_move_outgoing_args), rcx, rax, rbx); | 1606 __ super_call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::popframe_move_outgoing_args), rcx, rax, rbx); |
1607 __ get_thread(rcx); | 1607 __ get_thread(rcx); |
1608 __ reset_last_Java_frame(rcx, true, true); | 1608 __ reset_last_Java_frame(rcx, true, true); |
1609 // Restore the last_sp and null it out | 1609 // Restore the last_sp and null it out |
1610 __ movptr(rsp, Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize)); | 1610 __ movptr(rsp, Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize)); |
1611 __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), (int32_t)NULL_WORD); | 1611 __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), NULL_WORD); |
1612 | 1612 |
1613 __ restore_bcp(); | 1613 __ restore_bcp(); |
1614 __ restore_locals(); | 1614 __ restore_locals(); |
1615 // The method data pointer was incremented already during | 1615 // The method data pointer was incremented already during |
1616 // call profiling. We have to restore the mdp for the current bcp. | 1616 // call profiling. We have to restore the mdp for the current bcp. |
1634 // remove the activation (without doing throws on illegalMonitorExceptions) | 1634 // remove the activation (without doing throws on illegalMonitorExceptions) |
1635 __ remove_activation(vtos, rdx, false, true, false); | 1635 __ remove_activation(vtos, rdx, false, true, false); |
1636 // restore exception | 1636 // restore exception |
1637 __ get_thread(rcx); | 1637 __ get_thread(rcx); |
1638 __ movptr(rax, Address(rcx, JavaThread::vm_result_offset())); | 1638 __ movptr(rax, Address(rcx, JavaThread::vm_result_offset())); |
1639 __ movptr(Address(rcx, JavaThread::vm_result_offset()), (int32_t)NULL_WORD); | 1639 __ movptr(Address(rcx, JavaThread::vm_result_offset()), NULL_WORD); |
1640 __ verify_oop(rax); | 1640 __ verify_oop(rax); |
1641 | 1641 |
1642 // Inbetween activations - previous activation type unknown yet | 1642 // Inbetween activations - previous activation type unknown yet |
1643 // compute continuation point - the continuation point expects | 1643 // compute continuation point - the continuation point expects |
1644 // the following registers set up: | 1644 // the following registers set up: |