OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include <setjmp.h> // NOLINT | 5 #include <setjmp.h> // NOLINT |
6 #include <stdlib.h> | 6 #include <stdlib.h> |
7 | 7 |
8 #include "vm/globals.h" | 8 #include "vm/globals.h" |
9 #if defined(TARGET_ARCH_ARM) | 9 #if defined(TARGET_ARCH_ARM) |
10 | 10 |
(...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1164 // Same effect on exclusive access state as a successful STREX. | 1164 // Same effect on exclusive access state as a successful STREX. |
1165 HasExclusiveAccessAndOpen(reinterpret_cast<uword>(address)); | 1165 HasExclusiveAccessAndOpen(reinterpret_cast<uword>(address)); |
1166 } else { | 1166 } else { |
1167 // Same effect on exclusive access state as an LDREX. | 1167 // Same effect on exclusive access state as an LDREX. |
1168 SetExclusiveAccess(reinterpret_cast<uword>(address)); | 1168 SetExclusiveAccess(reinterpret_cast<uword>(address)); |
1169 } | 1169 } |
1170 return value; | 1170 return value; |
1171 } | 1171 } |
1172 | 1172 |
1173 | 1173 |
| 1174 uint32_t Simulator::CompareExchangeUint32(uint32_t* address, |
| 1175 uint32_t compare_value, |
| 1176 uint32_t new_value) { |
| 1177 ASSERT(sizeof(uword) == sizeof(uint32_t)); |
| 1178 return CompareExchange(address, compare_value, new_value); |
| 1179 } |
| 1180 |
| 1181 |
1174 // Returns the top of the stack area to enable checking for stack pointer | 1182 // Returns the top of the stack area to enable checking for stack pointer |
1175 // validity. | 1183 // validity. |
1176 uword Simulator::StackTop() const { | 1184 uword Simulator::StackTop() const { |
1177 // To be safe in potential stack underflows we leave some buffer above and | 1185 // To be safe in potential stack underflows we leave some buffer above and |
1178 // set the stack top. | 1186 // set the stack top. |
1179 return StackBase() + | 1187 return StackBase() + |
1180 (OSThread::GetSpecifiedStackSize() + OSThread::kStackSizeBuffer); | 1188 (OSThread::GetSpecifiedStackSize() + OSThread::kStackSizeBuffer); |
1181 } | 1189 } |
1182 | 1190 |
1183 | 1191 |
(...skipping 2702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3886 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); | 3894 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); |
3887 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); | 3895 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); |
3888 buf->Longjmp(); | 3896 buf->Longjmp(); |
3889 } | 3897 } |
3890 | 3898 |
3891 } // namespace dart | 3899 } // namespace dart |
3892 | 3900 |
3893 #endif // defined(USING_SIMULATOR) | 3901 #endif // defined(USING_SIMULATOR) |
3894 | 3902 |
3895 #endif // defined TARGET_ARCH_ARM | 3903 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |