| 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 "vm/globals.h" | 5 #include "vm/globals.h" |
| 6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/cpu.h" | 9 #include "vm/cpu.h" |
| 10 #include "vm/os.h" | 10 #include "vm/os.h" |
| (...skipping 2151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2162 RANGE_OF(Integer::New(static_cast<int64_t>(kMinInt32) - 1))); | 2162 RANGE_OF(Integer::New(static_cast<int64_t>(kMinInt32) - 1))); |
| 2163 EXPECT_EQ(ICData::kInt64RangeBit, RANGE_OF(Integer::New(kMaxInt64))); | 2163 EXPECT_EQ(ICData::kInt64RangeBit, RANGE_OF(Integer::New(kMaxInt64))); |
| 2164 EXPECT_EQ(ICData::kInt64RangeBit, RANGE_OF(Integer::New(kMinInt64))); | 2164 EXPECT_EQ(ICData::kInt64RangeBit, RANGE_OF(Integer::New(kMinInt64))); |
| 2165 | 2165 |
| 2166 EXPECT_EQ(-1, RANGE_OF(Bool::True().raw())); | 2166 EXPECT_EQ(-1, RANGE_OF(Bool::True().raw())); |
| 2167 | 2167 |
| 2168 #undef RANGE_OF | 2168 #undef RANGE_OF |
| 2169 } | 2169 } |
| 2170 | 2170 |
| 2171 | 2171 |
| 2172 ASSEMBLER_TEST_GENERATE(Semaphore, assembler) { |
| 2173 __ EnterFrame(); |
| 2174 __ LoadImmediate(T0, 40); |
| 2175 __ LoadImmediate(T1, 42); |
| 2176 __ Push(T0); |
| 2177 Label retry; |
| 2178 __ Bind(&retry); |
| 2179 __ ll(T0, Address(SP)); |
| 2180 __ mov(T2, T1); |
| 2181 __ sc(T2, Address(SP)); // T1 == 1, success |
| 2182 __ LoadImmediate(T3, 1); |
| 2183 __ bne(T2, T3, &retry); // NE if context switch occurred between ll and sc |
| 2184 __ Pop(V0); // 42 |
| 2185 __ LeaveFrameAndReturn(); |
| 2186 } |
| 2187 |
| 2188 |
| 2189 ASSEMBLER_TEST_RUN(Semaphore, test) { |
| 2190 EXPECT(test != NULL); |
| 2191 typedef int (*Semaphore)() DART_UNUSED; |
| 2192 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT32(Semaphore, test->entry())); |
| 2193 } |
| 2194 |
| 2195 |
| 2172 } // namespace dart | 2196 } // namespace dart |
| 2173 | 2197 |
| 2174 #endif // defined TARGET_ARCH_MIPS | 2198 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |