comparison src/cpu/x86/vm/interpreter_x86_32.cpp @ 304:dc7f315e41f7

5108146: Merge i486 and amd64 cpu directories 6459804: Want client (c1) compiler for x86_64 (amd64) for faster start-up Reviewed-by: kvn
author never
date Wed, 27 Aug 2008 00:21:55 -0700
parents a61af66fc99e
children 9ee9cf798b59
comparison
equal deleted inserted replaced
303:fa4d1d240383 304:dc7f315e41f7
36 address entry = __ pc(); 36 address entry = __ pc();
37 // rbx,: method 37 // rbx,: method
38 // rcx: temporary 38 // rcx: temporary
39 // rdi: pointer to locals 39 // rdi: pointer to locals
40 // rsp: end of copied parameters area 40 // rsp: end of copied parameters area
41 __ movl(rcx, rsp); 41 __ mov(rcx, rsp);
42 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::slow_signature_handler), rbx, rdi, rcx); 42 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::slow_signature_handler), rbx, rdi, rcx);
43 __ ret(0); 43 __ ret(0);
44 return entry; 44 return entry;
45 } 45 }
46 46
73 73
74 // do nothing for empty methods (do not even increment invocation counter) 74 // do nothing for empty methods (do not even increment invocation counter)
75 // Code: _return 75 // Code: _return
76 // _return 76 // _return
77 // return w/o popping parameters 77 // return w/o popping parameters
78 __ popl(rax); 78 __ pop(rax);
79 __ movl(rsp, rsi); 79 __ mov(rsp, rsi);
80 __ jmp(rax); 80 __ jmp(rax);
81 81
82 __ bind(slow_path); 82 __ bind(slow_path);
83 (void) generate_normal_entry(false); 83 (void) generate_normal_entry(false);
84 return entry_point; 84 return entry_point;
133 // get argument 133 // get argument
134 if (TaggedStackInterpreter) { 134 if (TaggedStackInterpreter) {
135 __ pushl(Address(rsp, 3*wordSize)); // push hi (and note rsp -= wordSize) 135 __ pushl(Address(rsp, 3*wordSize)); // push hi (and note rsp -= wordSize)
136 __ pushl(Address(rsp, 2*wordSize)); // push lo 136 __ pushl(Address(rsp, 2*wordSize)); // push lo
137 __ fld_d(Address(rsp, 0)); // get double in ST0 137 __ fld_d(Address(rsp, 0)); // get double in ST0
138 __ addl(rsp, 2*wordSize); 138 __ addptr(rsp, 2*wordSize);
139 } else { 139 } else {
140 __ fld_d(Address(rsp, 1*wordSize)); 140 __ fld_d(Address(rsp, 1*wordSize));
141 } 141 }
142 switch (kind) { 142 switch (kind) {
143 case Interpreter::java_lang_math_sin : 143 case Interpreter::java_lang_math_sin :
171 ShouldNotReachHere(); 171 ShouldNotReachHere();
172 } 172 }
173 173
174 // return double result in xmm0 for interpreter and compilers. 174 // return double result in xmm0 for interpreter and compilers.
175 if (UseSSE >= 2) { 175 if (UseSSE >= 2) {
176 __ subl(rsp, 2*wordSize); 176 __ subptr(rsp, 2*wordSize);
177 __ fstp_d(Address(rsp, 0)); 177 __ fstp_d(Address(rsp, 0));
178 __ movdbl(xmm0, Address(rsp, 0)); 178 __ movdbl(xmm0, Address(rsp, 0));
179 __ addl(rsp, 2*wordSize); 179 __ addptr(rsp, 2*wordSize);
180 } 180 }
181 181
182 // done, result in FPU ST(0) or XMM0 182 // done, result in FPU ST(0) or XMM0
183 __ popl(rdi); // get return address 183 __ pop(rdi); // get return address
184 __ movl(rsp, rsi); // set sp to sender sp 184 __ mov(rsp, rsi); // set sp to sender sp
185 __ jmp(rdi); 185 __ jmp(rdi);
186 186
187 return entry_point; 187 return entry_point;
188 } 188 }
189 189
200 200
201 address entry_point = __ pc(); 201 address entry_point = __ pc();
202 202
203 // abstract method entry 203 // abstract method entry
204 // remove return address. Not really needed, since exception handling throws away expression stack 204 // remove return address. Not really needed, since exception handling throws away expression stack
205 __ popl(rbx); 205 __ pop(rbx);
206 206
207 // adjust stack to what a normal return would do 207 // adjust stack to what a normal return would do
208 __ movl(rsp, rsi); 208 __ mov(rsp, rsi);
209 // throw exception 209 // throw exception
210 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError)); 210 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError));
211 // the call_VM checks for exception, so we should never return here. 211 // the call_VM checks for exception, so we should never return here.
212 __ should_not_reach_here(); 212 __ should_not_reach_here();
213 213