1 /*
2 * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
416 __ jcc(Assembler::notEqual, L);
417 __ stop("StubRoutines::forward exception: no pending exception (2)");
418 __ bind(L);
419 }
420 #endif
421
422 // Verify that there is really a valid exception in RAX.
423 __ verify_oop(exception_oop);
424
425 // continue at exception handler (return address removed)
426 // rax: exception
427 // rbx: exception handler
428 // rdx: throwing pc
429 __ jmp(handler_addr);
430
431 return start;
432 }
433
434
435 //----------------------------------------------------------------------------------------------------
436 // Support for jint Atomic::xchg(jint exchange_value, volatile jint* dest)
437 //
438 // xchg exists as far back as 8086, lock needed for MP only
439 // Stack layout immediately after call:
440 //
441 // 0 [ret addr ] <--- rsp
442 // 1 [ ex ]
443 // 2 [ dest ]
444 //
445 // Result: *dest <- ex, return (old *dest)
446 //
447 // Note: win32 does not currently use this code
448
449 address generate_atomic_xchg() {
450 StubCodeMark mark(this, "StubRoutines", "atomic_xchg");
451 address start = __ pc();
452
453 __ push(rdx);
454 Address exchange(rsp, 2 * wordSize);
455 Address dest_addr(rsp, 3 * wordSize);
456 __ movl(rax, exchange);
|
1 /*
2 * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
416 __ jcc(Assembler::notEqual, L);
417 __ stop("StubRoutines::forward exception: no pending exception (2)");
418 __ bind(L);
419 }
420 #endif
421
422 // Verify that there is really a valid exception in RAX.
423 __ verify_oop(exception_oop);
424
425 // continue at exception handler (return address removed)
426 // rax: exception
427 // rbx: exception handler
428 // rdx: throwing pc
429 __ jmp(handler_addr);
430
431 return start;
432 }
433
434
435 //----------------------------------------------------------------------------------------------------
436 // Support for int32_t Atomic::specialized_xchg(int32_t exchange_value, volatile int32_t* dest)
437 //
438 // xchg exists as far back as 8086, lock needed for MP only
439 // Stack layout immediately after call:
440 //
441 // 0 [ret addr ] <--- rsp
442 // 1 [ ex ]
443 // 2 [ dest ]
444 //
445 // Result: *dest <- ex, return (old *dest)
446 //
447 // Note: win32 does not currently use this code
448
449 address generate_atomic_xchg() {
450 StubCodeMark mark(this, "StubRoutines", "atomic_xchg");
451 address start = __ pc();
452
453 __ push(rdx);
454 Address exchange(rsp, 2 * wordSize);
455 Address dest_addr(rsp, 3 * wordSize);
456 __ movl(rax, exchange);
|