Mercurial > hg > graal-compiler
comparison src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp @ 2114:4fc084dac61e
7009756: volatile variables could be broken throw reflection API
Summary: Use Atomic::load() and Atomic::store() to access a volatile long.
Reviewed-by: iveresov, jrose, dholmes, never
author | kvn |
---|---|
date | Fri, 07 Jan 2011 10:16:57 -0800 |
parents | f95d63e2154a |
children | 63e54c37ac64 |
comparison
equal
deleted
inserted
replaced
2113:0e52ef6e94d3 | 2114:4fc084dac61e |
---|---|
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. |
51 inline void Atomic::inc_ptr(volatile void* dest) { (void)add_ptr(1, dest); } | 51 inline void Atomic::inc_ptr(volatile void* dest) { (void)add_ptr(1, dest); } |
52 | 52 |
53 inline void Atomic::dec (volatile jint* dest) { (void)add (-1, dest); } | 53 inline void Atomic::dec (volatile jint* dest) { (void)add (-1, dest); } |
54 inline void Atomic::dec_ptr(volatile intptr_t* dest) { (void)add_ptr(-1, dest); } | 54 inline void Atomic::dec_ptr(volatile intptr_t* dest) { (void)add_ptr(-1, dest); } |
55 inline void Atomic::dec_ptr(volatile void* dest) { (void)add_ptr(-1, dest); } | 55 inline void Atomic::dec_ptr(volatile void* dest) { (void)add_ptr(-1, dest); } |
56 | |
57 inline jlong Atomic::load(volatile jlong* src) { return *src; } | |
56 | 58 |
57 inline jint Atomic::add (jint add_value, volatile jint* dest) { | 59 inline jint Atomic::add (jint add_value, volatile jint* dest) { |
58 intptr_t rv; | 60 intptr_t rv; |
59 __asm__ volatile( | 61 __asm__ volatile( |
60 "1: \n\t" | 62 "1: \n\t" |