| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This file is an internal atomic implementation, use atomicops.h instead. | 5 // This file is an internal atomic implementation, use atomicops.h instead. |
| 6 | 6 |
| 7 #ifndef V8_ATOMICOPS_INTERNALS_MIPS_GCC_H_ | 7 #ifndef V8_BASE_ATOMICOPS_INTERNALS_MIPS_GCC_H_ |
| 8 #define V8_ATOMICOPS_INTERNALS_MIPS_GCC_H_ | 8 #define V8_BASE_ATOMICOPS_INTERNALS_MIPS_GCC_H_ |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| 11 namespace internal { | 11 namespace base { |
| 12 | 12 |
| 13 // Atomically execute: | 13 // Atomically execute: |
| 14 // result = *ptr; | 14 // result = *ptr; |
| 15 // if (*ptr == old_value) | 15 // if (*ptr == old_value) |
| 16 // *ptr = new_value; | 16 // *ptr = new_value; |
| 17 // return result; | 17 // return result; |
| 18 // | 18 // |
| 19 // I.e., replace "*ptr" with "new_value" if "*ptr" used to be "old_value". | 19 // I.e., replace "*ptr" with "new_value" if "*ptr" used to be "old_value". |
| 20 // Always return the old value of "*ptr" | 20 // Always return the old value of "*ptr" |
| 21 // | 21 // |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 Atomic32 value = *ptr; | 147 Atomic32 value = *ptr; |
| 148 MemoryBarrier(); | 148 MemoryBarrier(); |
| 149 return value; | 149 return value; |
| 150 } | 150 } |
| 151 | 151 |
| 152 inline Atomic32 Release_Load(volatile const Atomic32* ptr) { | 152 inline Atomic32 Release_Load(volatile const Atomic32* ptr) { |
| 153 MemoryBarrier(); | 153 MemoryBarrier(); |
| 154 return *ptr; | 154 return *ptr; |
| 155 } | 155 } |
| 156 | 156 |
| 157 } } // namespace v8::internal | 157 } } // namespace v8::base |
| 158 | 158 |
| 159 #endif // V8_ATOMICOPS_INTERNALS_MIPS_GCC_H_ | 159 #endif // V8_BASE_ATOMICOPS_INTERNALS_MIPS_GCC_H_ |
| OLD | NEW |