OLD | NEW |
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 Loading... |
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_X87 | 39 #if V8_TARGET_ARCH_X87 |
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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 // Set up code descriptor. | 260 // Set up code descriptor. |
260 desc->buffer = buffer_; | 261 desc->buffer = buffer_; |
261 desc->buffer_size = buffer_size_; | 262 desc->buffer_size = buffer_size_; |
262 desc->instr_size = pc_offset(); | 263 desc->instr_size = pc_offset(); |
263 desc->reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos(); | 264 desc->reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos(); |
264 desc->origin = this; | 265 desc->origin = this; |
265 } | 266 } |
266 | 267 |
267 | 268 |
268 void Assembler::Align(int m) { | 269 void Assembler::Align(int m) { |
269 DCHECK(IsPowerOf2(m)); | 270 DCHECK(base::bits::IsPowerOfTwo32(m)); |
270 int mask = m - 1; | 271 int mask = m - 1; |
271 int addr = pc_offset(); | 272 int addr = pc_offset(); |
272 Nop((m - (addr & mask)) & mask); | 273 Nop((m - (addr & mask)) & mask); |
273 } | 274 } |
274 | 275 |
275 | 276 |
276 bool Assembler::IsNop(Address addr) { | 277 bool Assembler::IsNop(Address addr) { |
277 Address a = addr; | 278 Address a = addr; |
278 while (*a == 0x66) a++; | 279 while (*a == 0x66) a++; |
279 if (*a == 0x90) return true; | 280 if (*a == 0x90) return true; |
(...skipping 1764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2044 fprintf(coverage_log, "%s\n", file_line); | 2045 fprintf(coverage_log, "%s\n", file_line); |
2045 fflush(coverage_log); | 2046 fflush(coverage_log); |
2046 } | 2047 } |
2047 } | 2048 } |
2048 | 2049 |
2049 #endif | 2050 #endif |
2050 | 2051 |
2051 } } // namespace v8::internal | 2052 } } // namespace v8::internal |
2052 | 2053 |
2053 #endif // V8_TARGET_ARCH_X87 | 2054 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |