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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
237 desc->buffer_size = buffer_size_; | 237 desc->buffer_size = buffer_size_; |
238 desc->instr_size = pc_offset(); | 238 desc->instr_size = pc_offset(); |
239 desc->reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos(); | 239 desc->reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos(); |
240 desc->constant_pool_size = | 240 desc->constant_pool_size = |
241 (constant_pool_offset ? desc->instr_size - constant_pool_offset : 0); | 241 (constant_pool_offset ? desc->instr_size - constant_pool_offset : 0); |
242 desc->origin = this; | 242 desc->origin = this; |
243 } | 243 } |
244 | 244 |
245 | 245 |
246 void Assembler::Align(int m) { | 246 void Assembler::Align(int m) { |
247 #if V8_TARGET_ARCH_PPC64 | |
248 DCHECK(m >= 4 && base::bits::IsPowerOfTwo64(m)); | |
249 #else | |
250 DCHECK(m >= 4 && base::bits::IsPowerOfTwo32(m)); | 247 DCHECK(m >= 4 && base::bits::IsPowerOfTwo32(m)); |
251 #endif | 248 DCHECK((pc_offset() & (kInstrSize - 1)) == 0); |
252 // First ensure instruction alignment | 249 while ((pc_offset() & (m - 1)) != 0) { |
253 while (pc_offset() & (kInstrSize - 1)) { | 250 nop(); |
251 } | |
252 } | |
253 | |
254 | |
255 void Assembler::DataAlign(int m) { | |
rmcilroy
2015/06/09 14:14:43
These are all the same aren't they? Couldn't you j
MTBrandyberry
2015/06/09 14:19:08
I didn't see a precedent for services like this in
| |
256 DCHECK(m >= 2 && base::bits::IsPowerOfTwo32(m)); | |
257 while ((pc_offset() & (m - 1)) != 0) { | |
254 db(0); | 258 db(0); |
255 } | 259 } |
256 // Then pad to requested alignedment with nops | |
257 while (pc_offset() & (m - 1)) { | |
258 nop(); | |
259 } | |
260 } | 260 } |
261 | 261 |
262 | 262 |
263 void Assembler::CodeTargetAlign() { Align(8); } | 263 void Assembler::CodeTargetAlign() { Align(8); } |
264 | 264 |
265 | 265 |
266 Condition Assembler::GetCondition(Instr instr) { | 266 Condition Assembler::GetCondition(Instr instr) { |
267 switch (instr & kCondMask) { | 267 switch (instr & kCondMask) { |
268 case BT: | 268 case BT: |
269 return eq; | 269 return eq; |
(...skipping 2173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2443 pc_offset() + kMaxCondBranchReach - kMaxBlockTrampolineSectionSize; | 2443 pc_offset() + kMaxCondBranchReach - kMaxBlockTrampolineSectionSize; |
2444 } | 2444 } |
2445 return; | 2445 return; |
2446 } | 2446 } |
2447 | 2447 |
2448 | 2448 |
2449 } // namespace internal | 2449 } // namespace internal |
2450 } // namespace v8 | 2450 } // namespace v8 |
2451 | 2451 |
2452 #endif // V8_TARGET_ARCH_PPC | 2452 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |