| OLD | NEW |
| 1 | 1 |
| 2 // Copyright 2012 the V8 project authors. All rights reserved. | 2 // Copyright 2012 the V8 project authors. All rights reserved. |
| 3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
| 4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
| 5 | 5 |
| 6 #include <limits.h> // For LONG_MIN, LONG_MAX. | 6 #include <limits.h> // For LONG_MIN, LONG_MAX. |
| 7 | 7 |
| 8 #if V8_TARGET_ARCH_MIPS | 8 #if V8_TARGET_ARCH_MIPS |
| 9 | 9 |
| 10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
| (...skipping 5800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5811 // Create a new macro assembler pointing to the address of the code to patch. | 5811 // Create a new macro assembler pointing to the address of the code to patch. |
| 5812 // The size is adjusted with kGap on order for the assembler to generate size | 5812 // The size is adjusted with kGap on order for the assembler to generate size |
| 5813 // bytes of instructions without failing with buffer size constraints. | 5813 // bytes of instructions without failing with buffer size constraints. |
| 5814 DCHECK(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 5814 DCHECK(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
| 5815 } | 5815 } |
| 5816 | 5816 |
| 5817 | 5817 |
| 5818 CodePatcher::~CodePatcher() { | 5818 CodePatcher::~CodePatcher() { |
| 5819 // Indicate that code has changed. | 5819 // Indicate that code has changed. |
| 5820 if (flush_cache_ == FLUSH) { | 5820 if (flush_cache_ == FLUSH) { |
| 5821 CpuFeatures::FlushICache(address_, size_); | 5821 Assembler::FlushICacheWithoutIsolate(address_, size_); |
| 5822 } | 5822 } |
| 5823 | 5823 |
| 5824 // Check that the code was patched as expected. | 5824 // Check that the code was patched as expected. |
| 5825 DCHECK(masm_.pc_ == address_ + size_); | 5825 DCHECK(masm_.pc_ == address_ + size_); |
| 5826 DCHECK(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 5826 DCHECK(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
| 5827 } | 5827 } |
| 5828 | 5828 |
| 5829 | 5829 |
| 5830 void CodePatcher::Emit(Instr instr) { | 5830 void CodePatcher::Emit(Instr instr) { |
| 5831 masm()->emit(instr); | 5831 masm()->emit(instr); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5864 if (mag.shift > 0) sra(result, result, mag.shift); | 5864 if (mag.shift > 0) sra(result, result, mag.shift); |
| 5865 srl(at, dividend, 31); | 5865 srl(at, dividend, 31); |
| 5866 Addu(result, result, Operand(at)); | 5866 Addu(result, result, Operand(at)); |
| 5867 } | 5867 } |
| 5868 | 5868 |
| 5869 | 5869 |
| 5870 } // namespace internal | 5870 } // namespace internal |
| 5871 } // namespace v8 | 5871 } // namespace v8 |
| 5872 | 5872 |
| 5873 #endif // V8_TARGET_ARCH_MIPS | 5873 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |