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

Side by Side Diff: runtime/vm/assembler_x64.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_mips.cc ('k') | 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/heap.h" 9 #include "vm/heap.h"
10 #include "vm/memory_region.h" 10 #include "vm/memory_region.h"
(...skipping 2284 matching lines...) Expand 10 before | Expand all | Expand 10 after
2295 void Assembler::LeaveFrame() { 2295 void Assembler::LeaveFrame() {
2296 movq(RSP, RBP); 2296 movq(RSP, RBP);
2297 popq(RBP); 2297 popq(RBP);
2298 } 2298 }
2299 2299
2300 2300
2301 void Assembler::ReserveAlignedFrameSpace(intptr_t frame_space) { 2301 void Assembler::ReserveAlignedFrameSpace(intptr_t frame_space) {
2302 // Reserve space for arguments and align frame before entering 2302 // Reserve space for arguments and align frame before entering
2303 // the C++ world. 2303 // the C++ world.
2304 AddImmediate(RSP, Immediate(-frame_space)); 2304 AddImmediate(RSP, Immediate(-frame_space));
2305 if (OS::ActivationFrameAlignment() > 0) { 2305 if (OS::ActivationFrameAlignment() > 1) {
2306 andq(RSP, Immediate(~(OS::ActivationFrameAlignment() - 1))); 2306 andq(RSP, Immediate(~(OS::ActivationFrameAlignment() - 1)));
2307 } 2307 }
2308 } 2308 }
2309 2309
2310 2310
2311 // TODO(srdjan): Add XMM registers once they are used by the compiler. 2311 // TODO(srdjan): Add XMM registers once they are used by the compiler.
2312 // Based on http://x86-64.org/documentation/abi.pdf Fig. 3.4 2312 // Based on http://x86-64.org/documentation/abi.pdf Fig. 3.4
2313 static const intptr_t kNumberOfVolatileCpuRegisters = 9; 2313 static const intptr_t kNumberOfVolatileCpuRegisters = 9;
2314 static const Register volatile_cpu_registers[kNumberOfVolatileCpuRegisters] = { 2314 static const Register volatile_cpu_registers[kNumberOfVolatileCpuRegisters] = {
2315 RAX, RCX, RDX, RSI, RDI, R8, R9, R10, R11 2315 RAX, RCX, RDX, RSI, RDI, R8, R9, R10, R11
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
2644 2644
2645 const char* Assembler::FpuRegisterName(FpuRegister reg) { 2645 const char* Assembler::FpuRegisterName(FpuRegister reg) {
2646 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); 2646 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters));
2647 return xmm_reg_names[reg]; 2647 return xmm_reg_names[reg];
2648 } 2648 }
2649 2649
2650 2650
2651 } // namespace dart 2651 } // namespace dart
2652 2652
2653 #endif // defined TARGET_ARCH_X64 2653 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/assembler_mips.cc ('k') | runtime/vm/assembler_x64_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698