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