Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(227)

Side by Side Diff: runtime/vm/assembler_ia32_test.cc

Issue 14057004: Convert diamond shaped control flow into a single conditional instruction. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address Florian's comments Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 2408 matching lines...) Expand 10 before | Expand all | Expand 10 after
2419 } 2419 }
2420 2420
2421 2421
2422 ASSEMBLER_TEST_RUN(TestObjectCompare, test) { 2422 ASSEMBLER_TEST_RUN(TestObjectCompare, test) {
2423 typedef bool (*TestObjectCompare)(); 2423 typedef bool (*TestObjectCompare)();
2424 bool res = reinterpret_cast<TestObjectCompare>(test->entry())(); 2424 bool res = reinterpret_cast<TestObjectCompare>(test->entry())();
2425 EXPECT_EQ(true, res); 2425 EXPECT_EQ(true, res);
2426 } 2426 }
2427 2427
2428 2428
2429 ASSEMBLER_TEST_GENERATE(TestSetCC, assembler) {
2430 __ movl(EAX, Immediate(0xFFFFFFFF));
2431 __ cmpl(EAX, EAX);
2432 __ setcc(NOT_EQUAL, AL);
2433 __ ret();
2434 }
2435
2436
2437 ASSEMBLER_TEST_RUN(TestSetCC, test) {
2438 typedef uword (*TestSetCC)();
2439 uword res = reinterpret_cast<TestSetCC>(test->entry())();
2440 EXPECT_EQ(0xFFFFFF00, res);
2441 }
2442
2443
2429 ASSEMBLER_TEST_GENERATE(TestNop, assembler) { 2444 ASSEMBLER_TEST_GENERATE(TestNop, assembler) {
2430 __ nop(1); 2445 __ nop(1);
2431 __ nop(2); 2446 __ nop(2);
2432 __ nop(3); 2447 __ nop(3);
2433 __ nop(4); 2448 __ nop(4);
2434 __ nop(5); 2449 __ nop(5);
2435 __ nop(6); 2450 __ nop(6);
2436 __ nop(7); 2451 __ nop(7);
2437 __ nop(8); 2452 __ nop(8);
2438 __ movl(EAX, Immediate(assembler->CodeSize())); // Return code size. 2453 __ movl(EAX, Immediate(assembler->CodeSize())); // Return code size.
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
2518 EAX); 2533 EAX);
2519 __ popl(EAX); 2534 __ popl(EAX);
2520 __ popl(CTX); 2535 __ popl(CTX);
2521 __ ret(); 2536 __ ret();
2522 } 2537 }
2523 2538
2524 2539
2525 } // namespace dart 2540 } // namespace dart
2526 2541
2527 #endif // defined TARGET_ARCH_IA32 2542 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698