| 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 <limits.h> // For LONG_MIN, LONG_MAX. | 5 #include <limits.h> // For LONG_MIN, LONG_MAX. |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_ARM | 7 #if V8_TARGET_ARCH_ARM |
| 8 | 8 |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/base/division-by-constant.h" | 10 #include "src/base/division-by-constant.h" |
| (...skipping 3729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3740 // Create a new macro assembler pointing to the address of the code to patch. | 3740 // Create a new macro assembler pointing to the address of the code to patch. |
| 3741 // The size is adjusted with kGap on order for the assembler to generate size | 3741 // The size is adjusted with kGap on order for the assembler to generate size |
| 3742 // bytes of instructions without failing with buffer size constraints. | 3742 // bytes of instructions without failing with buffer size constraints. |
| 3743 DCHECK(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 3743 DCHECK(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
| 3744 } | 3744 } |
| 3745 | 3745 |
| 3746 | 3746 |
| 3747 CodePatcher::~CodePatcher() { | 3747 CodePatcher::~CodePatcher() { |
| 3748 // Indicate that code has changed. | 3748 // Indicate that code has changed. |
| 3749 if (flush_cache_ == FLUSH) { | 3749 if (flush_cache_ == FLUSH) { |
| 3750 CpuFeatures::FlushICache(address_, size_); | 3750 Assembler::FlushICacheWithoutIsolate(address_, size_); |
| 3751 } | 3751 } |
| 3752 | 3752 |
| 3753 // Check that the code was patched as expected. | 3753 // Check that the code was patched as expected. |
| 3754 DCHECK(masm_.pc_ == address_ + size_); | 3754 DCHECK(masm_.pc_ == address_ + size_); |
| 3755 DCHECK(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 3755 DCHECK(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
| 3756 } | 3756 } |
| 3757 | 3757 |
| 3758 | 3758 |
| 3759 void CodePatcher::Emit(Instr instr) { | 3759 void CodePatcher::Emit(Instr instr) { |
| 3760 masm()->emit(instr); | 3760 masm()->emit(instr); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3792 } | 3792 } |
| 3793 } | 3793 } |
| 3794 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); | 3794 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); |
| 3795 add(result, result, Operand(dividend, LSR, 31)); | 3795 add(result, result, Operand(dividend, LSR, 31)); |
| 3796 } | 3796 } |
| 3797 | 3797 |
| 3798 } // namespace internal | 3798 } // namespace internal |
| 3799 } // namespace v8 | 3799 } // namespace v8 |
| 3800 | 3800 |
| 3801 #endif // V8_TARGET_ARCH_ARM | 3801 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |