OLD | NEW |
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/x64/assembler-x64.h" | 5 #include "src/x64/assembler-x64.h" |
6 | 6 |
7 #include <cstring> | 7 #include <cstring> |
8 | 8 |
9 #if V8_TARGET_ARCH_X64 | 9 #if V8_TARGET_ARCH_X64 |
10 | 10 |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 } | 309 } |
310 | 310 |
311 | 311 |
312 void Assembler::Align(int m) { | 312 void Assembler::Align(int m) { |
313 DCHECK(base::bits::IsPowerOfTwo32(m)); | 313 DCHECK(base::bits::IsPowerOfTwo32(m)); |
314 int delta = (m - (pc_offset() & (m - 1))) & (m - 1); | 314 int delta = (m - (pc_offset() & (m - 1))) & (m - 1); |
315 Nop(delta); | 315 Nop(delta); |
316 } | 316 } |
317 | 317 |
318 | 318 |
| 319 void Assembler::DataAlign(int m) { |
| 320 DCHECK(m >= 2 && base::bits::IsPowerOfTwo32(m)); |
| 321 while ((pc_offset() & (m - 1)) != 0) { |
| 322 db(0); |
| 323 } |
| 324 } |
| 325 |
| 326 |
319 void Assembler::CodeTargetAlign() { | 327 void Assembler::CodeTargetAlign() { |
320 Align(16); // Preferred alignment of jump targets on x64. | 328 Align(16); // Preferred alignment of jump targets on x64. |
321 } | 329 } |
322 | 330 |
323 | 331 |
324 bool Assembler::IsNop(Address addr) { | 332 bool Assembler::IsNop(Address addr) { |
325 Address a = addr; | 333 Address a = addr; |
326 while (*a == 0x66) a++; | 334 while (*a == 0x66) a++; |
327 if (*a == 0x90) return true; | 335 if (*a == 0x90) return true; |
328 if (a[0] == 0xf && a[1] == 0x1f) return true; | 336 if (a[0] == 0xf && a[1] == 0x1f) return true; |
(...skipping 3614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3943 | 3951 |
3944 bool RelocInfo::IsInConstantPool() { | 3952 bool RelocInfo::IsInConstantPool() { |
3945 return false; | 3953 return false; |
3946 } | 3954 } |
3947 | 3955 |
3948 | 3956 |
3949 } // namespace internal | 3957 } // namespace internal |
3950 } // namespace v8 | 3958 } // namespace v8 |
3951 | 3959 |
3952 #endif // V8_TARGET_ARCH_X64 | 3960 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |