X87: Make FlushICache part of Assembler(Base) and take Isolate as parameter.

port 9fc4fc141f (r30695).

BUG=

Review URL: https://codereview.chromium.org/1339293002

Cr-Commit-Position: refs/heads/master@{#30743}
This commit is contained in:
chunyang.dai 2015-09-15 04:51:38 -07:00 committed by Commit bot
parent 7611c3b98b
commit 8c8c7523c2
4 changed files with 9 additions and 9 deletions

View File

@ -134,7 +134,7 @@ void RelocInfo::set_target_object(Object* target,
DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
Memory::Object_at(pc_) = target; Memory::Object_at(pc_) = target;
if (icache_flush_mode != SKIP_ICACHE_FLUSH) { if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
CpuFeatures::FlushICache(pc_, sizeof(Address)); Assembler::FlushICacheWithoutIsolate(pc_, sizeof(Address));
} }
if (write_barrier_mode == UPDATE_WRITE_BARRIER && if (write_barrier_mode == UPDATE_WRITE_BARRIER &&
host() != NULL && host() != NULL &&
@ -200,7 +200,7 @@ void RelocInfo::set_target_cell(Cell* cell,
Address address = cell->address() + Cell::kValueOffset; Address address = cell->address() + Cell::kValueOffset;
Memory::Address_at(pc_) = address; Memory::Address_at(pc_) = address;
if (icache_flush_mode != SKIP_ICACHE_FLUSH) { if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
CpuFeatures::FlushICache(pc_, sizeof(Address)); Assembler::FlushICacheWithoutIsolate(pc_, sizeof(Address));
} }
if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != NULL) { if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != NULL) {
// TODO(1550) We are passing NULL as a slot because cell can never be on // TODO(1550) We are passing NULL as a slot because cell can never be on
@ -281,7 +281,7 @@ void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) {
RelocInfo::Mode mode = rmode(); RelocInfo::Mode mode = rmode();
if (mode == RelocInfo::EMBEDDED_OBJECT) { if (mode == RelocInfo::EMBEDDED_OBJECT) {
visitor->VisitEmbeddedPointer(this); visitor->VisitEmbeddedPointer(this);
CpuFeatures::FlushICache(pc_, sizeof(Address)); Assembler::FlushICacheWithoutIsolate(pc_, sizeof(Address));
} else if (RelocInfo::IsCodeTarget(mode)) { } else if (RelocInfo::IsCodeTarget(mode)) {
visitor->VisitCodeTarget(this); visitor->VisitCodeTarget(this);
} else if (mode == RelocInfo::CELL) { } else if (mode == RelocInfo::CELL) {
@ -306,7 +306,7 @@ void RelocInfo::Visit(Heap* heap) {
RelocInfo::Mode mode = rmode(); RelocInfo::Mode mode = rmode();
if (mode == RelocInfo::EMBEDDED_OBJECT) { if (mode == RelocInfo::EMBEDDED_OBJECT) {
StaticVisitor::VisitEmbeddedPointer(heap, this); StaticVisitor::VisitEmbeddedPointer(heap, this);
CpuFeatures::FlushICache(pc_, sizeof(Address)); Assembler::FlushICacheWithoutIsolate(pc_, sizeof(Address));
} else if (RelocInfo::IsCodeTarget(mode)) { } else if (RelocInfo::IsCodeTarget(mode)) {
StaticVisitor::VisitCodeTarget(heap, this); StaticVisitor::VisitCodeTarget(heap, this);
} else if (mode == RelocInfo::CELL) { } else if (mode == RelocInfo::CELL) {
@ -460,7 +460,7 @@ void Assembler::set_target_address_at(Address pc, Address constant_pool,
int32_t* p = reinterpret_cast<int32_t*>(pc); int32_t* p = reinterpret_cast<int32_t*>(pc);
*p = target - (pc + sizeof(int32_t)); *p = target - (pc + sizeof(int32_t));
if (icache_flush_mode != SKIP_ICACHE_FLUSH) { if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
CpuFeatures::FlushICache(p, sizeof(int32_t)); Assembler::FlushICacheWithoutIsolate(p, sizeof(int32_t));
} }
} }

View File

@ -185,7 +185,7 @@ class RecordWriteStub: public PlatformCodeStub {
break; break;
} }
DCHECK(GetMode(stub) == mode); DCHECK(GetMode(stub) == mode);
CpuFeatures::FlushICache(stub->instruction_start(), 7); Assembler::FlushICache(stub->GetIsolate(), stub->instruction_start(), 7);
} }
DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR();

View File

@ -182,7 +182,7 @@ MemMoveFunction CreateMemMoveFunction() {
CodeDesc desc; CodeDesc desc;
masm.GetCode(&desc); masm.GetCode(&desc);
DCHECK(!RelocInfo::RequiresRelocation(desc)); DCHECK(!RelocInfo::RequiresRelocation(desc));
CpuFeatures::FlushICache(buffer, actual_size); Assembler::FlushICacheWithoutIsolate(buffer, actual_size);
base::OS::ProtectCode(buffer, actual_size); base::OS::ProtectCode(buffer, actual_size);
// TODO(jkummerow): It would be nice to register this code creation event // TODO(jkummerow): It would be nice to register this code creation event
// with the PROFILE / GDBJIT system. // with the PROFILE / GDBJIT system.
@ -617,7 +617,7 @@ void Code::PatchPlatformCodeAge(Isolate* isolate,
uint32_t young_length = isolate->code_aging_helper()->young_sequence_length(); uint32_t young_length = isolate->code_aging_helper()->young_sequence_length();
if (age == kNoAgeCodeAge) { if (age == kNoAgeCodeAge) {
isolate->code_aging_helper()->CopyYoungSequenceTo(sequence); isolate->code_aging_helper()->CopyYoungSequenceTo(sequence);
CpuFeatures::FlushICache(sequence, young_length); Assembler::FlushICache(isolate, sequence, young_length);
} else { } else {
Code* stub = GetCodeAgeStub(isolate, age, parity); Code* stub = GetCodeAgeStub(isolate, age, parity);
CodePatcher patcher(sequence, young_length); CodePatcher patcher(sequence, young_length);

View File

@ -2722,7 +2722,7 @@ CodePatcher::CodePatcher(byte* address, int size)
CodePatcher::~CodePatcher() { CodePatcher::~CodePatcher() {
// Indicate that code has changed. // Indicate that code has changed.
CpuFeatures::FlushICache(address_, size_); Assembler::FlushICacheWithoutIsolate(address_, size_);
// Check that the code was patched as expected. // Check that the code was patched as expected.
DCHECK(masm_.pc_ == address_ + size_); DCHECK(masm_.pc_ == address_ + size_);