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

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

Issue 23745008: Follow-up fix to my change to IsPowerOfTwo: Alignment of one means no alignment, not zero. (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 | « runtime/vm/assembler_x64.cc ('k') | runtime/vm/native_arguments.h » ('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_X64) 6 #if defined(TARGET_ARCH_X64)
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 1232 matching lines...) Expand 10 before | Expand all | Expand 10 after
1243 1243
1244 ASSEMBLER_TEST_RUN(LargeConstant, test) { 1244 ASSEMBLER_TEST_RUN(LargeConstant, test) {
1245 typedef int64_t (*LargeConstantCode)(); 1245 typedef int64_t (*LargeConstantCode)();
1246 EXPECT_EQ(kLargeConstant, 1246 EXPECT_EQ(kLargeConstant,
1247 reinterpret_cast<LargeConstantCode>(test->entry())()); 1247 reinterpret_cast<LargeConstantCode>(test->entry())());
1248 } 1248 }
1249 1249
1250 1250
1251 static int ComputeStackSpaceReservation(int needed, int fixed) { 1251 static int ComputeStackSpaceReservation(int needed, int fixed) {
1252 static const int kFrameAlignment = OS::ActivationFrameAlignment(); 1252 static const int kFrameAlignment = OS::ActivationFrameAlignment();
1253 return (kFrameAlignment > 0) 1253 return (kFrameAlignment > 1)
1254 ? Utils::RoundUp(needed + fixed, kFrameAlignment) - fixed 1254 ? Utils::RoundUp(needed + fixed, kFrameAlignment) - fixed
1255 : needed; 1255 : needed;
1256 } 1256 }
1257 1257
1258 1258
1259 static int LeafReturn42() { 1259 static int LeafReturn42() {
1260 return 42; 1260 return 42;
1261 } 1261 }
1262 1262
1263 1263
(...skipping 1346 matching lines...) Expand 10 before | Expand all | Expand 10 after
2610 EXPECT_EQ(1, res); // Greater equal. 2610 EXPECT_EQ(1, res); // Greater equal.
2611 res = reinterpret_cast<ConditionalMovesCompareCode>(test->entry())(5, 5); 2611 res = reinterpret_cast<ConditionalMovesCompareCode>(test->entry())(5, 5);
2612 EXPECT_EQ(1, res); // Greater equal. 2612 EXPECT_EQ(1, res); // Greater equal.
2613 res = reinterpret_cast<ConditionalMovesCompareCode>(test->entry())(2, 5); 2613 res = reinterpret_cast<ConditionalMovesCompareCode>(test->entry())(2, 5);
2614 EXPECT_EQ(-1, res); // Less. 2614 EXPECT_EQ(-1, res); // Less.
2615 } 2615 }
2616 2616
2617 } // namespace dart 2617 } // namespace dart
2618 2618
2619 #endif // defined TARGET_ARCH_X64 2619 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/assembler_x64.cc ('k') | runtime/vm/native_arguments.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698