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_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 Loading... |
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 Loading... |
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 |
OLD | NEW |