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)) { | |
254 db(0); | |
255 } | |
256 // Then pad to requested alignedment with nops | |
257 while (pc_offset() & (m - 1)) { | |
258 nop(); | 250 nop(); |
259 } | 251 } |
260 } | 252 } |
261 | 253 |
262 | 254 |
263 void Assembler::CodeTargetAlign() { Align(8); } | 255 void Assembler::CodeTargetAlign() { Align(8); } |
264 | 256 |
265 | 257 |
266 Condition Assembler::GetCondition(Instr instr) { | 258 Condition Assembler::GetCondition(Instr instr) { |
267 switch (instr & kCondMask) { | 259 switch (instr & kCondMask) { |
(...skipping 2175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2443 pc_offset() + kMaxCondBranchReach - kMaxBlockTrampolineSectionSize; | 2435 pc_offset() + kMaxCondBranchReach - kMaxBlockTrampolineSectionSize; |
2444 } | 2436 } |
2445 return; | 2437 return; |
2446 } | 2438 } |
2447 | 2439 |
2448 | 2440 |
2449 } // namespace internal | 2441 } // namespace internal |
2450 } // namespace v8 | 2442 } // namespace v8 |
2451 | 2443 |
2452 #endif // V8_TARGET_ARCH_PPC | 2444 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |