[assembler] Simplify {PatchingAssembler} cache flushing.

R=clemensh@chromium.org

Change-Id: Icfe73151ddc0d6a8afaed89004614e1a7c4e9416
Reviewed-on: https://chromium-review.googlesource.com/909531
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51221}
This commit is contained in:
Michael Starzinger 2018-02-09 10:27:55 -08:00 committed by Commit Bot
parent 07511018d9
commit 2f91dbc8ac
5 changed files with 2 additions and 28 deletions

View File

@ -5479,10 +5479,6 @@ void PatchingAssembler::Emit(Address addr) {
emit(reinterpret_cast<Instr>(addr));
}
void PatchingAssembler::FlushICache(Isolate* isolate) {
Assembler::FlushICache(buffer_, buffer_size_ - kGap);
}
UseScratchRegisterScope::UseScratchRegisterScope(Assembler* assembler)
: assembler_(assembler),
old_available_(*assembler->GetScratchRegisterList()),

View File

@ -1787,7 +1787,6 @@ class PatchingAssembler : public Assembler {
~PatchingAssembler();
void Emit(Address addr);
void FlushICache(Isolate* isolate);
};
// This scope utility allows scratch registers to be managed safely. The

View File

@ -3677,18 +3677,9 @@ class PatchingAssembler : public Assembler {
// If more or fewer instructions than expected are generated or if some
// relocation information takes space in the buffer, the PatchingAssembler
// will crash trying to grow the buffer.
// This version will flush at destruction.
PatchingAssembler(Isolate* isolate, byte* start, unsigned count)
: PatchingAssembler(IsolateData(isolate), start, count) {
CHECK_NOT_NULL(isolate);
isolate_ = isolate;
}
// This version will not flush.
// Note that the instruction cache will not be flushed.
PatchingAssembler(IsolateData isolate_data, byte* start, unsigned count)
: Assembler(isolate_data, start, count * kInstructionSize + kGap),
isolate_(nullptr) {
: Assembler(isolate_data, start, count * kInstructionSize + kGap) {
// Block constant pool emission.
StartBlockPools();
}
@ -3701,18 +3692,12 @@ class PatchingAssembler : public Assembler {
DCHECK((pc_offset() + kGap) == buffer_size_);
// Verify no relocation information has been emitted.
DCHECK(IsConstPoolEmpty());
// Flush the Instruction cache.
size_t length = buffer_size_ - kGap;
if (isolate_ != nullptr) Assembler::FlushICache(buffer_, length);
}
// See definition of PatchAdrFar() for details.
static constexpr int kAdrFarPatchableNNops = 2;
static constexpr int kAdrFarPatchableNInstrs = kAdrFarPatchableNNops + 2;
void PatchAdrFar(int64_t target_offset);
private:
Isolate* isolate_;
};

View File

@ -2150,10 +2150,6 @@ PatchingAssembler::~PatchingAssembler() {
DCHECK_EQ(reloc_info_writer.pos(), buffer_ + buffer_size_);
}
void PatchingAssembler::FlushICache(Isolate* isolate) {
Assembler::FlushICache(buffer_, buffer_size_ - kGap);
}
} // namespace internal
} // namespace v8

View File

@ -1658,8 +1658,6 @@ class PatchingAssembler : public Assembler {
public:
PatchingAssembler(IsolateData isolate_data, byte* address, int instructions);
~PatchingAssembler();
void FlushICache(Isolate* isolate);
};
} // namespace internal