OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 <assert.h> // For assert | 5 #include <assert.h> // For assert |
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_PPC | 8 #if V8_TARGET_ARCH_PPC |
9 | 9 |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 4362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4373 // Create a new macro assembler pointing to the address of the code to patch. | 4373 // Create a new macro assembler pointing to the address of the code to patch. |
4374 // The size is adjusted with kGap on order for the assembler to generate size | 4374 // The size is adjusted with kGap on order for the assembler to generate size |
4375 // bytes of instructions without failing with buffer size constraints. | 4375 // bytes of instructions without failing with buffer size constraints. |
4376 DCHECK(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 4376 DCHECK(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
4377 } | 4377 } |
4378 | 4378 |
4379 | 4379 |
4380 CodePatcher::~CodePatcher() { | 4380 CodePatcher::~CodePatcher() { |
4381 // Indicate that code has changed. | 4381 // Indicate that code has changed. |
4382 if (flush_cache_ == FLUSH) { | 4382 if (flush_cache_ == FLUSH) { |
4383 CpuFeatures::FlushICache(address_, size_); | 4383 Assembler::FlushICacheWithoutIsolate(address_, size_); |
4384 } | 4384 } |
4385 | 4385 |
4386 // Check that the code was patched as expected. | 4386 // Check that the code was patched as expected. |
4387 DCHECK(masm_.pc_ == address_ + size_); | 4387 DCHECK(masm_.pc_ == address_ + size_); |
4388 DCHECK(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 4388 DCHECK(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
4389 } | 4389 } |
4390 | 4390 |
4391 | 4391 |
4392 void CodePatcher::Emit(Instr instr) { masm()->emit(instr); } | 4392 void CodePatcher::Emit(Instr instr) { masm()->emit(instr); } |
4393 | 4393 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4426 } | 4426 } |
4427 if (mag.shift > 0) srawi(result, result, mag.shift); | 4427 if (mag.shift > 0) srawi(result, result, mag.shift); |
4428 ExtractBit(r0, dividend, 31); | 4428 ExtractBit(r0, dividend, 31); |
4429 add(result, result, r0); | 4429 add(result, result, r0); |
4430 } | 4430 } |
4431 | 4431 |
4432 } // namespace internal | 4432 } // namespace internal |
4433 } // namespace v8 | 4433 } // namespace v8 |
4434 | 4434 |
4435 #endif // V8_TARGET_ARCH_PPC | 4435 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |