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

Unified Diff: src/heap/remembered-set.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/heap/mark-compact.cc ('k') | src/ia32/assembler-ia32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/remembered-set.h
diff --git a/src/heap/remembered-set.h b/src/heap/remembered-set.h
index b7509c01d50cf74af4fb2f8aa7607234f0dcfaaa..d11c47f0aa893c79ab9f4dc6b805195c5784c9fb 100644
--- a/src/heap/remembered-set.h
+++ b/src/heap/remembered-set.h
@@ -300,11 +300,12 @@ class UpdateTypedSlotHelper {
static SlotCallbackResult UpdateCodeTarget(RelocInfo* rinfo,
Callback callback) {
DCHECK(RelocInfo::IsCodeTarget(rinfo->rmode()));
- Object* target = Code::GetCodeFromTargetAddress(rinfo->target_address());
- Object* old_target = target;
- SlotCallbackResult result = callback(&target);
- if (target != old_target) {
- rinfo->set_target_address(Code::cast(target)->instruction_start());
+ Code* old_target = Code::GetCodeFromTargetAddress(rinfo->target_address());
+ Object* new_target = old_target;
+ SlotCallbackResult result = callback(&new_target);
+ if (new_target != old_target) {
+ rinfo->set_target_address(old_target->GetIsolate(),
+ Code::cast(new_target)->instruction_start());
}
return result;
}
@@ -331,10 +332,12 @@ class UpdateTypedSlotHelper {
Callback callback) {
DCHECK(RelocInfo::IsDebugBreakSlot(rinfo->rmode()) &&
rinfo->IsPatchedDebugBreakSlotSequence());
- Object* target =
+ Code* old_target =
Code::GetCodeFromTargetAddress(rinfo->debug_call_address());
- SlotCallbackResult result = callback(&target);
- rinfo->set_debug_call_address(Code::cast(target)->instruction_start());
+ Object* new_target = old_target;
+ SlotCallbackResult result = callback(&new_target);
+ rinfo->set_debug_call_address(old_target->GetIsolate(),
+ Code::cast(new_target)->instruction_start());
return result;
}
@@ -346,26 +349,25 @@ class UpdateTypedSlotHelper {
Callback callback) {
switch (slot_type) {
case CODE_TARGET_SLOT: {
- RelocInfo rinfo(isolate, addr, RelocInfo::CODE_TARGET, 0, NULL);
+ RelocInfo rinfo(addr, RelocInfo::CODE_TARGET, 0, NULL);
return UpdateCodeTarget(&rinfo, callback);
}
case CELL_TARGET_SLOT: {
- RelocInfo rinfo(isolate, addr, RelocInfo::CELL, 0, NULL);
+ RelocInfo rinfo(addr, RelocInfo::CELL, 0, NULL);
return UpdateCell(&rinfo, callback);
}
case CODE_ENTRY_SLOT: {
return UpdateCodeEntry(addr, callback);
}
case DEBUG_TARGET_SLOT: {
- RelocInfo rinfo(isolate, addr, RelocInfo::DEBUG_BREAK_SLOT_AT_POSITION,
- 0, NULL);
+ RelocInfo rinfo(addr, RelocInfo::DEBUG_BREAK_SLOT_AT_POSITION, 0, NULL);
if (rinfo.IsPatchedDebugBreakSlotSequence()) {
return UpdateDebugTarget(&rinfo, callback);
}
return REMOVE_SLOT;
}
case EMBEDDED_OBJECT_SLOT: {
- RelocInfo rinfo(isolate, addr, RelocInfo::EMBEDDED_OBJECT, 0, NULL);
+ RelocInfo rinfo(addr, RelocInfo::EMBEDDED_OBJECT, 0, NULL);
return UpdateEmbeddedPointer(&rinfo, callback);
}
case OBJECT_SLOT: {
« no previous file with comments | « src/heap/mark-compact.cc ('k') | src/ia32/assembler-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698