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 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
487 desc->instr_size = pc_offset(); | 487 desc->instr_size = pc_offset(); |
488 desc->reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos(); | 488 desc->reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos(); |
489 desc->constant_pool_size = | 489 desc->constant_pool_size = |
490 (constant_pool_offset ? desc->instr_size - constant_pool_offset : 0); | 490 (constant_pool_offset ? desc->instr_size - constant_pool_offset : 0); |
491 desc->origin = this; | 491 desc->origin = this; |
492 } | 492 } |
493 | 493 |
494 | 494 |
495 void Assembler::Align(int m) { | 495 void Assembler::Align(int m) { |
496 DCHECK(m >= 4 && base::bits::IsPowerOfTwo32(m)); | 496 DCHECK(m >= 4 && base::bits::IsPowerOfTwo32(m)); |
497 // First ensure instruction alignment | |
498 while (pc_offset() & (kInstrSize - 1)) { | |
499 db(0); | |
500 } | |
rmcilroy
2015/06/08 11:11:10
I'm not keen on adding this to Align since it make
MTBrandyberry
2015/06/08 13:52:39
Done.
| |
501 // Then pad to requested alignedment with nops | |
497 while ((pc_offset() & (m - 1)) != 0) { | 502 while ((pc_offset() & (m - 1)) != 0) { |
498 nop(); | 503 nop(); |
499 } | 504 } |
500 } | 505 } |
501 | 506 |
502 | 507 |
503 void Assembler::CodeTargetAlign() { | 508 void Assembler::CodeTargetAlign() { |
504 // Preferred alignment of jump targets on some ARM chips. | 509 // Preferred alignment of jump targets on some ARM chips. |
505 Align(8); | 510 Align(8); |
506 } | 511 } |
(...skipping 3443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3950 DCHECK(is_uint12(offset)); | 3955 DCHECK(is_uint12(offset)); |
3951 instr_at_put(pc, SetLdrRegisterImmediateOffset(instr, offset)); | 3956 instr_at_put(pc, SetLdrRegisterImmediateOffset(instr, offset)); |
3952 } | 3957 } |
3953 } | 3958 } |
3954 | 3959 |
3955 | 3960 |
3956 } // namespace internal | 3961 } // namespace internal |
3957 } // namespace v8 | 3962 } // namespace v8 |
3958 | 3963 |
3959 #endif // V8_TARGET_ARCH_ARM | 3964 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |