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

Side by Side Diff: src/ia32/assembler-ia32.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/hydrogen-instructions.h ('k') | src/ia32/code-stubs-ia32.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) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions 5 // modification, are permitted provided that the following conditions
6 // are met: 6 // are met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 20 matching lines...) Expand all
31 // OF THE POSSIBILITY OF SUCH DAMAGE. 31 // OF THE POSSIBILITY OF SUCH DAMAGE.
32 32
33 // The original source code covered by the above license above has been modified 33 // The original source code covered by the above license above has been modified
34 // significantly by Google Inc. 34 // significantly by Google Inc.
35 // Copyright 2012 the V8 project authors. All rights reserved. 35 // Copyright 2012 the V8 project authors. All rights reserved.
36 36
37 #include "src/v8.h" 37 #include "src/v8.h"
38 38
39 #if V8_TARGET_ARCH_IA32 39 #if V8_TARGET_ARCH_IA32
40 40
41 #include "src/base/bits.h"
41 #include "src/base/cpu.h" 42 #include "src/base/cpu.h"
42 #include "src/disassembler.h" 43 #include "src/disassembler.h"
43 #include "src/macro-assembler.h" 44 #include "src/macro-assembler.h"
44 #include "src/serialize.h" 45 #include "src/serialize.h"
45 46
46 namespace v8 { 47 namespace v8 {
47 namespace internal { 48 namespace internal {
48 49
49 // ----------------------------------------------------------------------------- 50 // -----------------------------------------------------------------------------
50 // Implementation of CpuFeatures 51 // Implementation of CpuFeatures
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 // Set up code descriptor. 265 // Set up code descriptor.
265 desc->buffer = buffer_; 266 desc->buffer = buffer_;
266 desc->buffer_size = buffer_size_; 267 desc->buffer_size = buffer_size_;
267 desc->instr_size = pc_offset(); 268 desc->instr_size = pc_offset();
268 desc->reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos(); 269 desc->reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos();
269 desc->origin = this; 270 desc->origin = this;
270 } 271 }
271 272
272 273
273 void Assembler::Align(int m) { 274 void Assembler::Align(int m) {
274 DCHECK(IsPowerOf2(m)); 275 DCHECK(base::bits::IsPowerOfTwo32(m));
275 int mask = m - 1; 276 int mask = m - 1;
276 int addr = pc_offset(); 277 int addr = pc_offset();
277 Nop((m - (addr & mask)) & mask); 278 Nop((m - (addr & mask)) & mask);
278 } 279 }
279 280
280 281
281 bool Assembler::IsNop(Address addr) { 282 bool Assembler::IsNop(Address addr) {
282 Address a = addr; 283 Address a = addr;
283 while (*a == 0x66) a++; 284 while (*a == 0x66) a++;
284 if (*a == 0x90) return true; 285 if (*a == 0x90) return true;
(...skipping 2377 matching lines...) Expand 10 before | Expand all | Expand 10 after
2662 fprintf(coverage_log, "%s\n", file_line); 2663 fprintf(coverage_log, "%s\n", file_line);
2663 fflush(coverage_log); 2664 fflush(coverage_log);
2664 } 2665 }
2665 } 2666 }
2666 2667
2667 #endif 2668 #endif
2668 2669
2669 } } // namespace v8::internal 2670 } } // namespace v8::internal
2670 2671
2671 #endif // V8_TARGET_ARCH_IA32 2672 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698