*(p + 3) = instr4;
*(p + 4) = instr5;
if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
- CpuFeatures::FlushICache(p, 5 * kInstrSize);
+ Assembler::FlushICacheWithoutIsolate(p, 5 * kInstrSize);
}
#else
uint32_t* p = reinterpret_cast<uint32_t*>(pc);
*p = instr1;
*(p + 1) = instr2;
if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
- CpuFeatures::FlushICache(p, 2 * kInstrSize);
+ Assembler::FlushICacheWithoutIsolate(p, 2 * kInstrSize);
}
#endif
return;
break;
}
DCHECK(GetMode(stub) == mode);
- CpuFeatures::FlushICache(stub->instruction_start() + Assembler::kInstrSize,
- 2 * Assembler::kInstrSize);
+ Assembler::FlushICache(stub->GetIsolate(),
+ stub->instruction_start() + Assembler::kInstrSize,
+ 2 * Assembler::kInstrSize);
}
DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR();
DCHECK(!RelocInfo::RequiresRelocation(desc));
#endif
- CpuFeatures::FlushICache(buffer, actual_size);
+ Assembler::FlushICacheWithoutIsolate(buffer, actual_size);
base::OS::ProtectCode(buffer, actual_size);
#if !defined(USE_SIMULATOR)
DCHECK(!RelocInfo::RequiresRelocation(desc));
#endif
- CpuFeatures::FlushICache(buffer, actual_size);
+ Assembler::FlushICacheWithoutIsolate(buffer, actual_size);
base::OS::ProtectCode(buffer, actual_size);
return FUNCTION_CAST<UnaryMathFunction>(buffer);
#endif
uint32_t young_length = isolate->code_aging_helper()->young_sequence_length();
if (age == kNoAgeCodeAge) {
isolate->code_aging_helper()->CopyYoungSequenceTo(sequence);
- CpuFeatures::FlushICache(sequence, young_length);
+ Assembler::FlushICache(isolate, sequence, young_length);
} else {
// FIXED_SEQUENCE
Code* stub = GetCodeAgeStub(isolate, age, parity);
#include "src/assembler.h"
#include "src/macro-assembler.h"
-#include "src/simulator.h" // for cache flushing.
namespace v8 {
namespace internal {
void CpuFeatures::FlushICache(void* buffer, size_t size) {
- // Nothing to do flushing no instructions.
- if (size == 0) {
- return;
- }
-
-#if defined(USE_SIMULATOR)
- // Not generating PPC instructions for C-code. This means that we are
- // building an PPC emulator based target. We should notify the simulator
- // that the Icache was flushed.
- // None of this code ends up in the snapshot so there are no issues
- // around whether or not to generate the code when building snapshots.
- Simulator::FlushICache(Isolate::Current()->simulator_i_cache(), buffer, size);
-#else
-
+#if !defined(USE_SIMULATOR)
if (CpuFeatures::IsSupported(INSTR_AND_DATA_CACHE_COHERENCY)) {
__asm__ __volatile__(
"sync \n"
: "r"(pointer));
}
-#endif // USE_SIMULATOR
+#endif // !USE_SIMULATOR
}
} // namespace internal
} // namespace v8
CodePatcher::~CodePatcher() {
// Indicate that code has changed.
if (flush_cache_ == FLUSH) {
- CpuFeatures::FlushICache(address_, size_);
+ Assembler::FlushICacheWithoutIsolate(address_, size_);
}
// Check that the code was patched as expected.