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

Side by Side Diff: src/x64/assembler-x64.cc

Issue 528993002: First step to cleanup the power-of-2 mess. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: clang-format Created 6 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 | « src/utils.h ('k') | src/x64/lithium-codegen-x64.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_X64 7 #if V8_TARGET_ARCH_X64
8 8
9 #include "src/base/bits.h"
9 #include "src/macro-assembler.h" 10 #include "src/macro-assembler.h"
10 #include "src/serialize.h" 11 #include "src/serialize.h"
11 12
12 namespace v8 { 13 namespace v8 {
13 namespace internal { 14 namespace internal {
14 15
15 // ----------------------------------------------------------------------------- 16 // -----------------------------------------------------------------------------
16 // Implementation of CpuFeatures 17 // Implementation of CpuFeatures
17 18
18 void CpuFeatures::ProbeImpl(bool cross_compile) { 19 void CpuFeatures::ProbeImpl(bool cross_compile) {
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 desc->buffer_size = buffer_size_; 259 desc->buffer_size = buffer_size_;
259 desc->instr_size = pc_offset(); 260 desc->instr_size = pc_offset();
260 DCHECK(desc->instr_size > 0); // Zero-size code objects upset the system. 261 DCHECK(desc->instr_size > 0); // Zero-size code objects upset the system.
261 desc->reloc_size = 262 desc->reloc_size =
262 static_cast<int>((buffer_ + buffer_size_) - reloc_info_writer.pos()); 263 static_cast<int>((buffer_ + buffer_size_) - reloc_info_writer.pos());
263 desc->origin = this; 264 desc->origin = this;
264 } 265 }
265 266
266 267
267 void Assembler::Align(int m) { 268 void Assembler::Align(int m) {
268 DCHECK(IsPowerOf2(m)); 269 DCHECK(base::bits::IsPowerOfTwo32(m));
269 int delta = (m - (pc_offset() & (m - 1))) & (m - 1); 270 int delta = (m - (pc_offset() & (m - 1))) & (m - 1);
270 Nop(delta); 271 Nop(delta);
271 } 272 }
272 273
273 274
274 void Assembler::CodeTargetAlign() { 275 void Assembler::CodeTargetAlign() {
275 Align(16); // Preferred alignment of jump targets on x64. 276 Align(16); // Preferred alignment of jump targets on x64.
276 } 277 }
277 278
278 279
(...skipping 2707 matching lines...) Expand 10 before | Expand all | Expand 10 after
2986 2987
2987 2988
2988 bool RelocInfo::IsInConstantPool() { 2989 bool RelocInfo::IsInConstantPool() {
2989 return false; 2990 return false;
2990 } 2991 }
2991 2992
2992 2993
2993 } } // namespace v8::internal 2994 } } // namespace v8::internal
2994 2995
2995 #endif // V8_TARGET_ARCH_X64 2996 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/utils.h ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698