Mercurial > hg > truffle
comparison src/cpu/x86/vm/templateInterpreter_x86_64.cpp @ 1108:85f13cdfbc1d
6829192: JSR 292 needs to support 64-bit x86
Summary: changes for method handles and invokedynamic
Reviewed-by: kvn
author | twisti |
---|---|
date | Wed, 16 Dec 2009 12:48:04 +0100 |
parents | 389049f3f393 |
children | e66fd840cb6b |
comparison
equal
deleted
inserted
replaced
1102:6dc5471e0f66 | 1108:85f13cdfbc1d |
---|---|
98 throw_ClassCastException), | 98 throw_ClassCastException), |
99 c_rarg1); | 99 c_rarg1); |
100 return entry; | 100 return entry; |
101 } | 101 } |
102 | 102 |
103 // Arguments are: required type in rarg1, failing object (or NULL) in rarg2 | 103 // Arguments are: required type at TOS+8, failing object (or NULL) at TOS+4. |
104 address TemplateInterpreterGenerator::generate_WrongMethodType_handler() { | 104 address TemplateInterpreterGenerator::generate_WrongMethodType_handler() { |
105 address entry = __ pc(); | 105 address entry = __ pc(); |
106 | 106 |
107 __ pop(c_rarg2); // failing object is at TOS | 107 __ pop(c_rarg2); // failing object is at TOS |
108 __ pop(c_rarg1); // required type is at TOS+8 | 108 __ pop(c_rarg1); // required type is at TOS+8 |
109 | 109 |
110 // expression stack must be empty before entering the VM if an | 110 __ verify_oop(c_rarg1); |
111 // exception happened | 111 __ verify_oop(c_rarg2); |
112 | |
113 // Various method handle types use interpreter registers as temps. | |
114 __ restore_bcp(); | |
115 __ restore_locals(); | |
116 | |
117 // Expression stack must be empty before entering the VM for an exception. | |
112 __ empty_expression_stack(); | 118 __ empty_expression_stack(); |
113 | 119 |
114 __ call_VM(noreg, | 120 __ call_VM(noreg, |
115 CAST_FROM_FN_PTR(address, | 121 CAST_FROM_FN_PTR(address, |
116 InterpreterRuntime:: | 122 InterpreterRuntime::throw_WrongMethodTypeException), |
117 throw_WrongMethodTypeException), | |
118 // pass required type, failing object (or NULL) | 123 // pass required type, failing object (or NULL) |
119 c_rarg1, c_rarg2); | 124 c_rarg1, c_rarg2); |
120 return entry; | 125 return entry; |
121 } | 126 } |
122 | 127 |
180 __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), (int32_t)NULL_WORD); | 185 __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), (int32_t)NULL_WORD); |
181 | 186 |
182 __ restore_bcp(); | 187 __ restore_bcp(); |
183 __ restore_locals(); | 188 __ restore_locals(); |
184 | 189 |
185 __ get_cache_and_index_at_bcp(rbx, rcx, 1); | 190 Label L_got_cache, L_giant_index; |
191 if (EnableInvokeDynamic) { | |
192 __ cmpb(Address(r13, 0), Bytecodes::_invokedynamic); | |
193 __ jcc(Assembler::equal, L_giant_index); | |
194 } | |
195 __ get_cache_and_index_at_bcp(rbx, rcx, 1, false); | |
196 __ bind(L_got_cache); | |
186 __ movl(rbx, Address(rbx, rcx, | 197 __ movl(rbx, Address(rbx, rcx, |
187 Address::times_8, | 198 Address::times_ptr, |
188 in_bytes(constantPoolCacheOopDesc::base_offset()) + | 199 in_bytes(constantPoolCacheOopDesc::base_offset()) + |
189 3 * wordSize)); | 200 3 * wordSize)); |
190 __ andl(rbx, 0xFF); | 201 __ andl(rbx, 0xFF); |
191 if (TaggedStackInterpreter) __ shll(rbx, 1); // 2 slots per parameter. | 202 if (TaggedStackInterpreter) __ shll(rbx, 1); // 2 slots per parameter. |
192 __ lea(rsp, Address(rsp, rbx, Address::times_8)); | 203 __ lea(rsp, Address(rsp, rbx, Address::times_8)); |
193 __ dispatch_next(state, step); | 204 __ dispatch_next(state, step); |
205 | |
206 // out of the main line of code... | |
207 if (EnableInvokeDynamic) { | |
208 __ bind(L_giant_index); | |
209 __ get_cache_and_index_at_bcp(rbx, rcx, 1, true); | |
210 __ jmp(L_got_cache); | |
211 } | |
212 | |
194 return entry; | 213 return entry; |
195 } | 214 } |
196 | 215 |
197 | 216 |
198 address TemplateInterpreterGenerator::generate_deopt_entry_for(TosState state, | 217 address TemplateInterpreterGenerator::generate_deopt_entry_for(TosState state, |