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

Unified Diff: src/heap/mark-compact.cc

Issue 1155703006: Revert of Embedded constant pools. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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.h ('k') | src/heap/objects-visiting.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index 31af80553f217730c057c32e1589aebe7387ae57..521be78e2eff9976cd0db5d49e27ca5888c958db 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -2736,6 +2736,30 @@
SlotsBuffer::CODE_ENTRY_SLOT, code_entry_slot,
SlotsBuffer::IGNORE_OVERFLOW);
}
+ } else if (dst->IsConstantPoolArray()) {
+ // We special case ConstantPoolArrays since they could contain integers
+ // value entries which look like tagged pointers.
+ // TODO(mstarzinger): restructure this code to avoid this special-casing.
+ ConstantPoolArray* array = ConstantPoolArray::cast(dst);
+ ConstantPoolArray::Iterator code_iter(array, ConstantPoolArray::CODE_PTR);
+ while (!code_iter.is_finished()) {
+ Address code_entry_slot =
+ dst_addr + array->OffsetOfElementAt(code_iter.next_index());
+ Address code_entry = Memory::Address_at(code_entry_slot);
+
+ if (Page::FromAddress(code_entry)->IsEvacuationCandidate()) {
+ SlotsBuffer::AddTo(&slots_buffer_allocator_, &migration_slots_buffer_,
+ SlotsBuffer::CODE_ENTRY_SLOT, code_entry_slot,
+ SlotsBuffer::IGNORE_OVERFLOW);
+ }
+ }
+ ConstantPoolArray::Iterator heap_iter(array, ConstantPoolArray::HEAP_PTR);
+ while (!heap_iter.is_finished()) {
+ Address heap_slot =
+ dst_addr + array->OffsetOfElementAt(heap_iter.next_index());
+ Object* value = Memory::Object_at(heap_slot);
+ RecordMigratedSlot(value, heap_slot);
+ }
}
} else if (dest == CODE_SPACE) {
PROFILE(isolate(), CodeMoveEvent(src_addr, dst_addr));
@@ -3126,6 +3150,15 @@
InstanceType type = object->map()->instance_type();
// Slots in maps and code can't be invalid because they are never shrunk.
if (type == MAP_TYPE || type == CODE_TYPE) return true;
+ if (type == CONSTANT_POOL_ARRAY_TYPE) {
+ if (FLAG_enable_ool_constant_pool) {
+ // TODO(ishell): implement constant pool support if we ever enable it.
+ UNIMPLEMENTED();
+ } else {
+ // This is left here just to make constant pool unit tests work.
+ return true;
+ }
+ }
// Consider slots in objects that contain ONLY raw data as invalid.
if (object->MayContainRawValues()) return false;
if (FLAG_unbox_double_fields) {
@@ -3349,10 +3382,6 @@
case SlotsBuffer::EMBEDDED_OBJECT_SLOT: {
RelocInfo rinfo(addr, RelocInfo::EMBEDDED_OBJECT, 0, NULL);
rinfo.Visit(isolate, v);
- break;
- }
- case SlotsBuffer::OBJECT_SLOT: {
- v->VisitPointer(reinterpret_cast<Object**>(addr));
break;
}
default:
@@ -4524,20 +4553,9 @@
if (target_page->IsEvacuationCandidate() &&
(rinfo->host() == NULL ||
!ShouldSkipEvacuationSlotRecording(rinfo->host()))) {
- Address addr = rinfo->pc();
- SlotsBuffer::SlotType slot_type = SlotTypeForRMode(rmode);
- if (rinfo->IsInConstantPool()) {
- addr = rinfo->constant_pool_entry_address();
- if (RelocInfo::IsCodeTarget(rmode)) {
- slot_type = SlotsBuffer::CODE_ENTRY_SLOT;
- } else {
- DCHECK(RelocInfo::IsEmbeddedObject(rmode));
- slot_type = SlotsBuffer::OBJECT_SLOT;
- }
- }
bool success = SlotsBuffer::AddTo(
&slots_buffer_allocator_, target_page->slots_buffer_address(),
- slot_type, addr, SlotsBuffer::FAIL_ON_OVERFLOW);
+ SlotTypeForRMode(rmode), rinfo->pc(), SlotsBuffer::FAIL_ON_OVERFLOW);
if (!success) {
EvictPopularEvacuationCandidate(target_page);
}
« no previous file with comments | « src/heap/mark-compact.h ('k') | src/heap/objects-visiting.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698