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

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

Issue 23578013: Small code cleanup in the assembler/simulator. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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
« no previous file with comments | « no previous file | runtime/vm/assembler_x64_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 } 664 }
665 665
666 666
667 ASSEMBLER_TEST_RUN(Exchange, test) { 667 ASSEMBLER_TEST_RUN(Exchange, test) {
668 typedef int (*Exchange)(); 668 typedef int (*Exchange)();
669 EXPECT_EQ(987654321 - 123456789, reinterpret_cast<Exchange>(test->entry())()); 669 EXPECT_EQ(987654321 - 123456789, reinterpret_cast<Exchange>(test->entry())());
670 } 670 }
671 671
672 672
673 static int ComputeStackSpaceReservation(int needed, int fixed) { 673 static int ComputeStackSpaceReservation(int needed, int fixed) {
674 static const int kFrameAlignment = OS::ActivationFrameAlignment(); 674 return (OS::ActivationFrameAlignment() > 1)
675 return (kFrameAlignment > 1) 675 ? Utils::RoundUp(needed + fixed, OS::ActivationFrameAlignment()) - fixed
676 ? Utils::RoundUp(needed + fixed, kFrameAlignment) - fixed
677 : needed; 676 : needed;
678 } 677 }
679 678
680 679
681 static int LeafReturn42() { 680 static int LeafReturn42() {
682 return 42; 681 return 42;
683 } 682 }
684 683
685 684
686 static int LeafReturnArgument(int x) { 685 static int LeafReturnArgument(int x) {
(...skipping 2166 matching lines...) Expand 10 before | Expand all | Expand 10 after
2853 FieldAddress(ECX, GrowableObjectArray::data_offset()), 2852 FieldAddress(ECX, GrowableObjectArray::data_offset()),
2854 EAX); 2853 EAX);
2855 __ popl(EAX); 2854 __ popl(EAX);
2856 __ popl(CTX); 2855 __ popl(CTX);
2857 __ ret(); 2856 __ ret();
2858 } 2857 }
2859 2858
2860 } // namespace dart 2859 } // namespace dart
2861 2860
2862 #endif // defined TARGET_ARCH_IA32 2861 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/assembler_x64_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698