| 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 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 // The original source code covered by the above license above has been | 33 // The original source code covered by the above license above has been |
| 34 // modified significantly by Google Inc. | 34 // modified significantly by Google Inc. |
| 35 // Copyright 2012 the V8 project authors. All rights reserved. | 35 // Copyright 2012 the V8 project authors. All rights reserved. |
| 36 | 36 |
| 37 #include "src/v8.h" | 37 #include "src/v8.h" |
| 38 | 38 |
| 39 #if V8_TARGET_ARCH_ARM | 39 #if V8_TARGET_ARCH_ARM |
| 40 | 40 |
| 41 #include "src/arm/assembler-arm-inl.h" | 41 #include "src/arm/assembler-arm-inl.h" |
| 42 #include "src/base/bits.h" |
| 42 #include "src/base/cpu.h" | 43 #include "src/base/cpu.h" |
| 43 #include "src/macro-assembler.h" | 44 #include "src/macro-assembler.h" |
| 44 #include "src/serialize.h" | 45 #include "src/serialize.h" |
| 45 | 46 |
| 46 namespace v8 { | 47 namespace v8 { |
| 47 namespace internal { | 48 namespace internal { |
| 48 | 49 |
| 49 // Get the CPU features enabled by the build. For cross compilation the | 50 // Get the CPU features enabled by the build. For cross compilation the |
| 50 // preprocessor symbols CAN_USE_ARMV7_INSTRUCTIONS and CAN_USE_VFP3_INSTRUCTIONS | 51 // preprocessor symbols CAN_USE_ARMV7_INSTRUCTIONS and CAN_USE_VFP3_INSTRUCTIONS |
| 51 // can be defined to enable ARMv7 and VFPv3 instructions when building the | 52 // can be defined to enable ARMv7 and VFPv3 instructions when building the |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 // Set up code descriptor. | 492 // Set up code descriptor. |
| 492 desc->buffer = buffer_; | 493 desc->buffer = buffer_; |
| 493 desc->buffer_size = buffer_size_; | 494 desc->buffer_size = buffer_size_; |
| 494 desc->instr_size = pc_offset(); | 495 desc->instr_size = pc_offset(); |
| 495 desc->reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos(); | 496 desc->reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos(); |
| 496 desc->origin = this; | 497 desc->origin = this; |
| 497 } | 498 } |
| 498 | 499 |
| 499 | 500 |
| 500 void Assembler::Align(int m) { | 501 void Assembler::Align(int m) { |
| 501 DCHECK(m >= 4 && IsPowerOf2(m)); | 502 DCHECK(m >= 4 && base::bits::IsPowerOfTwo32(m)); |
| 502 while ((pc_offset() & (m - 1)) != 0) { | 503 while ((pc_offset() & (m - 1)) != 0) { |
| 503 nop(); | 504 nop(); |
| 504 } | 505 } |
| 505 } | 506 } |
| 506 | 507 |
| 507 | 508 |
| 508 void Assembler::CodeTargetAlign() { | 509 void Assembler::CodeTargetAlign() { |
| 509 // Preferred alignment of jump targets on some ARM chips. | 510 // Preferred alignment of jump targets on some ARM chips. |
| 510 Align(8); | 511 Align(8); |
| 511 } | 512 } |
| (...skipping 3322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3834 assm->instr_at_put( | 3835 assm->instr_at_put( |
| 3835 rinfo.pc(), Assembler::SetLdrRegisterImmediateOffset(instr, offset)); | 3836 rinfo.pc(), Assembler::SetLdrRegisterImmediateOffset(instr, offset)); |
| 3836 } | 3837 } |
| 3837 } | 3838 } |
| 3838 } | 3839 } |
| 3839 | 3840 |
| 3840 | 3841 |
| 3841 } } // namespace v8::internal | 3842 } } // namespace v8::internal |
| 3842 | 3843 |
| 3843 #endif // V8_TARGET_ARCH_ARM | 3844 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |