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

Unified Diff: src/s390/assembler-s390-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/s390/assembler-s390.cc ('k') | src/s390/macro-assembler-s390.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/s390/assembler-s390-inl.h
diff --git a/src/s390/assembler-s390-inl.h b/src/s390/assembler-s390-inl.h
index a38c518deac4acd8365d02afd1e826ecd3cdf0fb..12b607165d4b16b2ade7ae802ded19547a385f9f 100644
--- a/src/s390/assembler-s390-inl.h
+++ b/src/s390/assembler-s390-inl.h
@@ -70,7 +70,7 @@ void RelocInfo::apply(intptr_t delta) {
// mov sequence
DCHECK(IsInternalReferenceEncoded(rmode_));
Address target = Assembler::target_address_at(pc_, host_);
- Assembler::set_target_address_at(isolate_, pc_, host_, target + delta,
+ Assembler::set_target_address_at(nullptr, pc_, host_, target + delta,
SKIP_ICACHE_FLUSH);
}
}
@@ -172,13 +172,12 @@ void RelocInfo::set_target_object(HeapObject* target,
WriteBarrierMode write_barrier_mode,
ICacheFlushMode icache_flush_mode) {
DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
- Assembler::set_target_address_at(isolate_, pc_, host_,
+ Assembler::set_target_address_at(target->GetIsolate(), pc_, host_,
reinterpret_cast<Address>(target),
icache_flush_mode);
- if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != NULL &&
- target->IsHeapObject()) {
- host()->GetHeap()->incremental_marking()->RecordWriteIntoCode(
- host(), this, HeapObject::cast(target));
+ if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != NULL) {
+ host()->GetHeap()->incremental_marking()->RecordWriteIntoCode(host(), this,
+ target);
host()->GetHeap()->RecordWriteIntoCode(host(), this, target);
}
}
@@ -193,12 +192,12 @@ Address RelocInfo::target_runtime_entry(Assembler* origin) {
return target_address();
}
-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);
}
Handle<Cell> RelocInfo::target_cell_handle() {
@@ -260,9 +259,9 @@ Code* RelocInfo::code_age_stub() {
void RelocInfo::set_code_age_stub(Code* stub,
ICacheFlushMode icache_flush_mode) {
DCHECK(rmode_ == RelocInfo::CODE_AGE_SEQUENCE);
- Assembler::set_target_address_at(isolate_, pc_ + kCodeAgingTargetDelta, host_,
- stub->instruction_start(),
- icache_flush_mode);
+ Assembler::set_target_address_at(
+ stub->GetIsolate(), pc_ + kCodeAgingTargetDelta, host_,
+ stub->instruction_start(), icache_flush_mode);
}
Address RelocInfo::debug_call_address() {
@@ -270,9 +269,9 @@ Address RelocInfo::debug_call_address() {
return Assembler::target_address_at(pc_, host_);
}
-void RelocInfo::set_debug_call_address(Address target) {
+void RelocInfo::set_debug_call_address(Isolate* isolate, Address target) {
DCHECK(IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence());
- Assembler::set_target_address_at(isolate_, pc_, host_, target);
+ Assembler::set_target_address_at(isolate, pc_, host_, target);
if (host() != NULL) {
Code* target_code = Code::GetCodeFromTargetAddress(target);
host()->GetHeap()->incremental_marking()->RecordWriteIntoCode(host(), this,
@@ -280,7 +279,7 @@ void RelocInfo::set_debug_call_address(Address target) {
}
}
-void RelocInfo::WipeOut() {
+void RelocInfo::WipeOut(Isolate* isolate) {
DCHECK(IsEmbeddedObject(rmode_) || IsCodeTarget(rmode_) ||
IsRuntimeEntry(rmode_) || IsExternalReference(rmode_) ||
IsInternalReference(rmode_) || IsInternalReferenceEncoded(rmode_));
@@ -290,10 +289,10 @@ void RelocInfo::WipeOut() {
} else if (IsInternalReferenceEncoded(rmode_)) {
// mov sequence
// Currently used only by deserializer, no need to flush.
- Assembler::set_target_address_at(isolate_, pc_, host_, NULL,
+ Assembler::set_target_address_at(isolate, pc_, host_, NULL,
SKIP_ICACHE_FLUSH);
} else {
- Assembler::set_target_address_at(isolate_, pc_, host_, NULL);
+ Assembler::set_target_address_at(isolate, pc_, host_, NULL);
}
}
@@ -507,6 +506,8 @@ void Assembler::deserialization_set_target_internal_reference_at(
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);
+
// Check for instructions generated by Asm::mov()
Opcode op1 = Instruction::S390OpcodeValue(reinterpret_cast<const byte*>(pc));
SixByteInstr instr_1 =
« no previous file with comments | « src/s390/assembler-s390.cc ('k') | src/s390/macro-assembler-s390.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698