Mercurial > hg > graal-jvmci-8
comparison src/cpu/x86/vm/stubGenerator_x86_32.cpp @ 2245:638119ce7cfd
7009309: JSR 292: compiler/6991596/Test6991596.java crashes on fastdebug JDK7/b122
Reviewed-by: kvn, never
author | twisti |
---|---|
date | Tue, 01 Feb 2011 03:38:44 -0800 |
parents | f95d63e2154a |
children | d89a22843c62 |
comparison
equal
deleted
inserted
replaced
2244:4f26f535a225 | 2245:638119ce7cfd |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
238 __ call(rax); | 238 __ call(rax); |
239 | 239 |
240 BLOCK_COMMENT("call_stub_return_address:"); | 240 BLOCK_COMMENT("call_stub_return_address:"); |
241 return_address = __ pc(); | 241 return_address = __ pc(); |
242 | 242 |
243 Label common_return; | 243 #ifdef COMPILER2 |
244 | 244 { |
245 __ BIND(common_return); | 245 Label L_skip; |
246 if (UseSSE >= 2) { | |
247 __ verify_FPU(0, "call_stub_return"); | |
248 } else { | |
249 for (int i = 1; i < 8; i++) { | |
250 __ ffree(i); | |
251 } | |
252 | |
253 // UseSSE <= 1 so double result should be left on TOS | |
254 __ movl(rsi, result_type); | |
255 __ cmpl(rsi, T_DOUBLE); | |
256 __ jcc(Assembler::equal, L_skip); | |
257 if (UseSSE == 0) { | |
258 // UseSSE == 0 so float result should be left on TOS | |
259 __ cmpl(rsi, T_FLOAT); | |
260 __ jcc(Assembler::equal, L_skip); | |
261 } | |
262 __ ffree(0); | |
263 } | |
264 __ BIND(L_skip); | |
265 } | |
266 #endif // COMPILER2 | |
246 | 267 |
247 // store result depending on type | 268 // store result depending on type |
248 // (everything that is not T_LONG, T_FLOAT or T_DOUBLE is treated as T_INT) | 269 // (everything that is not T_LONG, T_FLOAT or T_DOUBLE is treated as T_INT) |
249 __ movptr(rdi, result); | 270 __ movptr(rdi, result); |
250 Label is_long, is_float, is_double, exit; | 271 Label is_long, is_float, is_double, exit; |
302 __ movdbl(Address(rdi, 0), xmm0); | 323 __ movdbl(Address(rdi, 0), xmm0); |
303 } else { | 324 } else { |
304 __ fstp_d(Address(rdi, 0)); | 325 __ fstp_d(Address(rdi, 0)); |
305 } | 326 } |
306 __ jmp(exit); | 327 __ jmp(exit); |
307 | |
308 // If we call compiled code directly from the call stub we will | |
309 // need to adjust the return back to the call stub to a specialized | |
310 // piece of code that can handle compiled results and cleaning the fpu | |
311 // stack. compiled code will be set to return here instead of the | |
312 // return above that handles interpreter returns. | |
313 | |
314 BLOCK_COMMENT("call_stub_compiled_return:"); | |
315 StubRoutines::x86::set_call_stub_compiled_return( __ pc()); | |
316 | |
317 #ifdef COMPILER2 | |
318 if (UseSSE >= 2) { | |
319 __ verify_FPU(0, "call_stub_compiled_return"); | |
320 } else { | |
321 for (int i = 1; i < 8; i++) { | |
322 __ ffree(i); | |
323 } | |
324 | |
325 // UseSSE <= 1 so double result should be left on TOS | |
326 __ movl(rsi, result_type); | |
327 __ cmpl(rsi, T_DOUBLE); | |
328 __ jcc(Assembler::equal, common_return); | |
329 if (UseSSE == 0) { | |
330 // UseSSE == 0 so float result should be left on TOS | |
331 __ cmpl(rsi, T_FLOAT); | |
332 __ jcc(Assembler::equal, common_return); | |
333 } | |
334 __ ffree(0); | |
335 } | |
336 #endif /* COMPILER2 */ | |
337 __ jmp(common_return); | |
338 | 328 |
339 return start; | 329 return start; |
340 } | 330 } |
341 | 331 |
342 | 332 |