Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(384)

Unified Diff: src/x87/assembler-x87-inl.h

Issue 2732273003: Disentangle assembler from isolate. (Closed)
Patch Set: Address feedback. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/x87/assembler-x87.cc ('k') | src/x87/codegen-x87.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x87/assembler-x87-inl.h
diff --git a/src/x87/assembler-x87-inl.h b/src/x87/assembler-x87-inl.h
index b175fd55db51d777d854497f65c1159d85ea8f4f..c1af7d06d216e9748791115b8f2ecd5637a04d3e 100644
--- a/src/x87/assembler-x87-inl.h
+++ b/src/x87/assembler-x87-inl.h
@@ -101,33 +101,28 @@ int RelocInfo::target_address_size() {
return Assembler::kSpecialTargetSize;
}
-
-Object* RelocInfo::target_object() {
+HeapObject* RelocInfo::target_object() {
DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
- return Memory::Object_at(pc_);
+ return HeapObject::cast(Memory::Object_at(pc_));
}
-
-Handle<Object> RelocInfo::target_object_handle(Assembler* origin) {
+Handle<HeapObject> RelocInfo::target_object_handle(Assembler* origin) {
DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
- return Memory::Object_Handle_at(pc_);
+ return Handle<HeapObject>::cast(Memory::Object_Handle_at(pc_));
}
-
-void RelocInfo::set_target_object(Object* target,
+void RelocInfo::set_target_object(HeapObject* target,
WriteBarrierMode write_barrier_mode,
ICacheFlushMode icache_flush_mode) {
DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
Memory::Object_at(pc_) = target;
if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
- Assembler::FlushICache(isolate_, pc_, sizeof(Address));
+ Assembler::FlushICache(target->GetIsolate(), pc_, sizeof(Address));
}
- if (write_barrier_mode == UPDATE_WRITE_BARRIER &&
- host() != NULL &&
- target->IsHeapObject()) {
+ if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != nullptr) {
host()->GetHeap()->RecordWriteIntoCode(host(), this, target);
- host()->GetHeap()->incremental_marking()->RecordWriteIntoCode(
- host(), this, HeapObject::cast(target));
+ host()->GetHeap()->incremental_marking()->RecordWriteIntoCode(host(), this,
+ target);
}
}
@@ -155,13 +150,12 @@ Address RelocInfo::target_runtime_entry(Assembler* origin) {
return reinterpret_cast<Address>(*reinterpret_cast<int32_t*>(pc_));
}
-
-void RelocInfo::set_target_runtime_entry(Address target,
+void RelocInfo::set_target_runtime_entry(Isolate* isolate, Address target,
WriteBarrierMode write_barrier_mode,
ICacheFlushMode icache_flush_mode) {
DCHECK(IsRuntimeEntry(rmode_));
if (target_address() != target) {
- set_target_address(target, write_barrier_mode, icache_flush_mode);
+ set_target_address(isolate, target, write_barrier_mode, icache_flush_mode);
}
}
@@ -187,7 +181,7 @@ void RelocInfo::set_target_cell(Cell* cell,
Address address = cell->address() + Cell::kValueOffset;
Memory::Address_at(pc_) = address;
if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
- Assembler::FlushICache(isolate_, pc_, sizeof(Address));
+ Assembler::FlushICache(cell->GetIsolate(), pc_, sizeof(Address));
}
if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != NULL) {
host()->GetHeap()->incremental_marking()->RecordWriteIntoCode(host(), this,
@@ -195,11 +189,10 @@ void RelocInfo::set_target_cell(Cell* cell,
}
}
-
-Handle<Object> RelocInfo::code_age_stub_handle(Assembler* origin) {
+Handle<Code> RelocInfo::code_age_stub_handle(Assembler* origin) {
DCHECK(rmode_ == RelocInfo::CODE_AGE_SEQUENCE);
DCHECK(*pc_ == kCallOpcode);
- return Memory::Object_Handle_at(pc_ + 1);
+ return Handle<Code>::cast(Memory::Object_Handle_at(pc_ + 1));
}
@@ -215,8 +208,9 @@ void RelocInfo::set_code_age_stub(Code* stub,
ICacheFlushMode icache_flush_mode) {
DCHECK(*pc_ == kCallOpcode);
DCHECK(rmode_ == RelocInfo::CODE_AGE_SEQUENCE);
- Assembler::set_target_address_at(
- isolate_, pc_ + 1, host_, stub->instruction_start(), icache_flush_mode);
+ Assembler::set_target_address_at(stub->GetIsolate(), pc_ + 1, host_,
+ stub->instruction_start(),
+ icache_flush_mode);
}
@@ -226,11 +220,10 @@ Address RelocInfo::debug_call_address() {
return Assembler::target_address_at(location, host_);
}
-
-void RelocInfo::set_debug_call_address(Address target) {
+void RelocInfo::set_debug_call_address(Isolate* isolate, Address target) {
DCHECK(IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence());
Address location = pc_ + Assembler::kPatchDebugBreakSlotAddressOffset;
- Assembler::set_target_address_at(isolate_, location, host_, target);
+ Assembler::set_target_address_at(isolate, location, host_, target);
if (host() != NULL) {
Code* target_code = Code::GetCodeFromTargetAddress(target);
host()->GetHeap()->incremental_marking()->RecordWriteIntoCode(host(), this,
@@ -238,14 +231,13 @@ void RelocInfo::set_debug_call_address(Address target) {
}
}
-
-void RelocInfo::WipeOut() {
+void RelocInfo::WipeOut(Isolate* isolate) {
if (IsEmbeddedObject(rmode_) || IsExternalReference(rmode_) ||
IsInternalReference(rmode_)) {
Memory::Address_at(pc_) = NULL;
} else if (IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)) {
// Effectively write zero into the relocation.
- Assembler::set_target_address_at(isolate_, pc_, host_,
+ Assembler::set_target_address_at(isolate, pc_, host_,
pc_ + sizeof(int32_t));
} else {
UNREACHABLE();
@@ -440,6 +432,7 @@ Address Assembler::target_address_at(Address pc, Address constant_pool) {
void Assembler::set_target_address_at(Isolate* isolate, Address pc,
Address constant_pool, Address target,
ICacheFlushMode icache_flush_mode) {
+ DCHECK_IMPLIES(isolate == nullptr, icache_flush_mode == SKIP_ICACHE_FLUSH);
int32_t* p = reinterpret_cast<int32_t*>(pc);
*p = target - (pc + sizeof(int32_t));
if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
« no previous file with comments | « src/x87/assembler-x87.cc ('k') | src/x87/codegen-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698