| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 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 3226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3237 __ movl(ECX, Address(ESP, 4 * kWordSize)); | 3237 __ movl(ECX, Address(ESP, 4 * kWordSize)); |
| 3238 __ pushl(EAX); | 3238 __ pushl(EAX); |
| 3239 __ StoreIntoObject(ECX, | 3239 __ StoreIntoObject(ECX, |
| 3240 FieldAddress(ECX, GrowableObjectArray::data_offset()), | 3240 FieldAddress(ECX, GrowableObjectArray::data_offset()), |
| 3241 EAX); | 3241 EAX); |
| 3242 __ popl(EAX); | 3242 __ popl(EAX); |
| 3243 __ popl(CTX); | 3243 __ popl(CTX); |
| 3244 __ ret(); | 3244 __ ret(); |
| 3245 } | 3245 } |
| 3246 | 3246 |
| 3247 | |
| 3248 ASSEMBLER_TEST_GENERATE(BitTest, assembler) { | |
| 3249 __ movl(EAX, Immediate(4)); | |
| 3250 __ movl(ECX, Immediate(2)); | |
| 3251 __ bt(EAX, ECX); | |
| 3252 Label ok; | |
| 3253 __ j(CARRY, &ok); | |
| 3254 __ int3(); | |
| 3255 __ Bind(&ok); | |
| 3256 __ movl(EAX, Immediate(1)); | |
| 3257 __ ret(); | |
| 3258 } | |
| 3259 | |
| 3260 | |
| 3261 ASSEMBLER_TEST_RUN(BitTest, test) { | |
| 3262 typedef int (*BitTest)(); | |
| 3263 EXPECT_EQ(1, reinterpret_cast<BitTest>(test->entry())()); | |
| 3264 } | |
| 3265 | |
| 3266 | |
| 3267 } // namespace dart | 3247 } // namespace dart |
| 3268 | 3248 |
| 3269 #endif // defined TARGET_ARCH_IA32 | 3249 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |