| 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/os.h" | 9 #include "vm/os.h" |
| 10 #include "vm/unit_test.h" | 10 #include "vm/unit_test.h" |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 ASSEMBLER_TEST_RUN(MoveExtendMemory, test) { | 333 ASSEMBLER_TEST_RUN(MoveExtendMemory, test) { |
| 334 typedef int (*MoveExtendMemory)(); | 334 typedef int (*MoveExtendMemory)(); |
| 335 EXPECT_EQ(0xff - 1 + 0xffff, | 335 EXPECT_EQ(0xff - 1 + 0xffff, |
| 336 reinterpret_cast<MoveExtendMemory>(test->entry())()); | 336 reinterpret_cast<MoveExtendMemory>(test->entry())()); |
| 337 } | 337 } |
| 338 | 338 |
| 339 | 339 |
| 340 ASSEMBLER_TEST_GENERATE(Bitwise, assembler) { | 340 ASSEMBLER_TEST_GENERATE(Bitwise, assembler) { |
| 341 __ movl(ECX, Immediate(42)); | 341 __ movl(ECX, Immediate(42)); |
| 342 __ xorl(ECX, ECX); | 342 __ xorl(ECX, ECX); |
| 343 __ orl(ECX, Immediate(256)); | 343 __ orl(ECX, Immediate(0x100)); |
| 344 __ movl(EAX, Immediate(4)); | 344 __ movl(EAX, Immediate(0x648)); |
| 345 __ orl(ECX, EAX); | 345 __ orl(ECX, EAX); // 0x748. |
| 346 __ movl(EAX, Immediate(0xfff0)); | 346 __ movl(EAX, Immediate(0xfff0)); |
| 347 __ andl(ECX, EAX); | 347 __ andl(ECX, EAX); // 0x740. |
| 348 __ pushl(Immediate(0xF6FF)); |
| 349 __ andl(ECX, Address(ESP, 0)); // 0x640. |
| 350 __ popl(EAX); // Discard. |
| 348 __ movl(EAX, Immediate(1)); | 351 __ movl(EAX, Immediate(1)); |
| 349 __ orl(ECX, EAX); | 352 __ orl(ECX, EAX); // 0x641. |
| 350 __ xorl(ECX, Immediate(0)); | 353 __ pushl(Immediate(0x7)); |
| 354 __ orl(ECX, Address(ESP, 0)); // 0x647. |
| 355 __ popl(EAX); // Discard. |
| 356 __ xorl(ECX, Immediate(0)); // 0x647. |
| 357 __ pushl(Immediate(0x1C)); |
| 358 __ xorl(ECX, Address(ESP, 0)); // 0x65B. |
| 359 __ popl(EAX); // Discard. |
| 351 __ movl(EAX, ECX); | 360 __ movl(EAX, ECX); |
| 352 __ ret(); | 361 __ ret(); |
| 353 } | 362 } |
| 354 | 363 |
| 355 | 364 |
| 356 ASSEMBLER_TEST_RUN(Bitwise, test) { | 365 ASSEMBLER_TEST_RUN(Bitwise, test) { |
| 357 typedef int (*Bitwise)(); | 366 typedef int (*Bitwise)(); |
| 358 EXPECT_EQ(256 + 1, reinterpret_cast<Bitwise>(test->entry())()); | 367 EXPECT_EQ(0x65B, reinterpret_cast<Bitwise>(test->entry())()); |
| 359 } | 368 } |
| 360 | 369 |
| 361 | 370 |
| 362 ASSEMBLER_TEST_GENERATE(LogicalOps, assembler) { | 371 ASSEMBLER_TEST_GENERATE(LogicalOps, assembler) { |
| 363 Label donetest1; | 372 Label donetest1; |
| 364 __ movl(EAX, Immediate(4)); | 373 __ movl(EAX, Immediate(4)); |
| 365 __ andl(EAX, Immediate(2)); | 374 __ andl(EAX, Immediate(2)); |
| 366 __ cmpl(EAX, Immediate(0)); | 375 __ cmpl(EAX, Immediate(0)); |
| 367 __ j(EQUAL, &donetest1); | 376 __ j(EQUAL, &donetest1); |
| 368 // Be sure to skip this crashing code. | 377 // Be sure to skip this crashing code. |
| (...skipping 2192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2561 FieldAddress(ECX, GrowableObjectArray::data_offset()), | 2570 FieldAddress(ECX, GrowableObjectArray::data_offset()), |
| 2562 EAX); | 2571 EAX); |
| 2563 __ popl(EAX); | 2572 __ popl(EAX); |
| 2564 __ popl(CTX); | 2573 __ popl(CTX); |
| 2565 __ ret(); | 2574 __ ret(); |
| 2566 } | 2575 } |
| 2567 | 2576 |
| 2568 } // namespace dart | 2577 } // namespace dart |
| 2569 | 2578 |
| 2570 #endif // defined TARGET_ARCH_IA32 | 2579 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |