Index: src/arm/macro-assembler-arm.cc |
diff --git a/src/arm/macro-assembler-arm.cc b/src/arm/macro-assembler-arm.cc |
index 7628f23a5be9f137b24bc184bc7c2ba664f8ef5c..7df785776dd50a7ed56993b9b7043e6ac1373b63 100644 |
--- a/src/arm/macro-assembler-arm.cc |
+++ b/src/arm/macro-assembler-arm.cc |
@@ -3845,10 +3845,13 @@ bool AreAliased(Register reg1, |
#endif |
-CodePatcher::CodePatcher(byte* address, int instructions) |
+CodePatcher::CodePatcher(byte* address, |
+ int instructions, |
+ FlushICache flush_cache) |
: address_(address), |
size_(instructions * Assembler::kInstrSize), |
- masm_(NULL, address, size_ + Assembler::kGap) { |
+ masm_(NULL, address, size_ + Assembler::kGap), |
+ flush_cache_(flush_cache) { |
// Create a new macro assembler pointing to the address of the code to patch. |
// The size is adjusted with kGap on order for the assembler to generate size |
// bytes of instructions without failing with buffer size constraints. |
@@ -3858,7 +3861,9 @@ CodePatcher::CodePatcher(byte* address, int instructions) |
CodePatcher::~CodePatcher() { |
// Indicate that code has changed. |
- CPU::FlushICache(address_, size_); |
+ if (flush_cache_ == FLUSH) { |
+ CPU::FlushICache(address_, size_); |
+ } |
// Check that the code was patched as expected. |
ASSERT(masm_.pc_ == address_ + size_); |