[compiler][heap] Update IsInConstantPool for Arm64

It will now return true for 32-bit constants as well.

When enabling this, two errors popped up: one in dissassembler where
we might have null hosts, and one in remembered set where we should be
compressing the address before storing.

As a drive-by: make ppc use full objects until their pointer compression
implementation is fully done.

Bug: v8:7703
Change-Id: I70f05f952d4e1305fe1fe030755f01f74ea5e5dc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2187622
Reviewed-by: Junliang Yan <jyan@ca.ibm.com>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67711}
This commit is contained in:
Santiago Aboy Solanes 2020-05-11 14:49:38 +01:00 committed by Commit Bot
parent d0b5b7d194
commit 1a6fe2a745
5 changed files with 15 additions and 6 deletions

View File

@ -660,6 +660,7 @@ Address RelocInfo::constant_pool_entry_address() {
HeapObject RelocInfo::target_object() { HeapObject RelocInfo::target_object() {
DCHECK(IsCodeTarget(rmode_) || IsEmbeddedObjectMode(rmode_)); DCHECK(IsCodeTarget(rmode_) || IsEmbeddedObjectMode(rmode_));
if (IsCompressedEmbeddedObject(rmode_)) { if (IsCompressedEmbeddedObject(rmode_)) {
CHECK(!host_.is_null());
return HeapObject::cast(Object(DecompressTaggedAny( return HeapObject::cast(Object(DecompressTaggedAny(
host_.address(), host_.address(),
Assembler::target_compressed_address_at(pc_, constant_pool_)))); Assembler::target_compressed_address_at(pc_, constant_pool_))));

View File

@ -140,7 +140,9 @@ bool RelocInfo::IsCodedSpecially() {
bool RelocInfo::IsInConstantPool() { bool RelocInfo::IsInConstantPool() {
Instruction* instr = reinterpret_cast<Instruction*>(pc_); Instruction* instr = reinterpret_cast<Instruction*>(pc_);
return instr->IsLdrLiteralX(); DCHECK_IMPLIES(instr->IsLdrLiteralW(), COMPRESS_POINTERS_BOOL);
return instr->IsLdrLiteralX() ||
(COMPRESS_POINTERS_BOOL && instr->IsLdrLiteralW());
} }
uint32_t RelocInfo::wasm_call_tag() const { uint32_t RelocInfo::wasm_call_tag() const {

View File

@ -2780,7 +2780,10 @@ void CodeGenerator::AssembleMove(InstructionOperand* source,
if (IsMaterializableFromRoot(src_object, &index)) { if (IsMaterializableFromRoot(src_object, &index)) {
__ LoadRoot(dst, index); __ LoadRoot(dst, index);
} else { } else {
__ Move(dst, src_object, RelocInfo::COMPRESSED_EMBEDDED_OBJECT); // TODO(v8:7703, jyan@ca.ibm.com): Turn into a
// COMPRESSED_EMBEDDED_OBJECT when the constant pool entry size is
// tagged size.
__ Move(dst, src_object, RelocInfo::FULL_EMBEDDED_OBJECT);
} }
break; break;
} }

View File

@ -222,7 +222,11 @@ static void PrintRelocInfo(StringBuilder* out, Isolate* isolate,
} else if (RelocInfo::IsEmbeddedObjectMode(rmode)) { } else if (RelocInfo::IsEmbeddedObjectMode(rmode)) {
HeapStringAllocator allocator; HeapStringAllocator allocator;
StringStream accumulator(&allocator); StringStream accumulator(&allocator);
relocinfo->target_object().ShortPrint(&accumulator); if (relocinfo->host().is_null()) {
relocinfo->target_object_no_host(isolate).ShortPrint(&accumulator);
} else {
relocinfo->target_object().ShortPrint(&accumulator);
}
std::unique_ptr<char[]> obj_name = accumulator.ToCString(); std::unique_ptr<char[]> obj_name = accumulator.ToCString();
const bool is_compressed = RelocInfo::IsCompressedEmbeddedObject(rmode); const bool is_compressed = RelocInfo::IsCompressedEmbeddedObject(rmode);
out->AddFormatted(" ;; %sobject: %s", out->AddFormatted(" ;; %sobject: %s",

View File

@ -317,13 +317,12 @@ class UpdateTypedSlotHelper {
} }
case COMPRESSED_OBJECT_SLOT: { case COMPRESSED_OBJECT_SLOT: {
HeapObject old_target = HeapObject::cast(Object(DecompressTaggedAny( HeapObject old_target = HeapObject::cast(Object(DecompressTaggedAny(
heap->isolate(), heap->isolate(), base::Memory<Tagged_t>(addr))));
static_cast<Tagged_t>(base::Memory<Address>(addr)))));
HeapObject new_target = old_target; HeapObject new_target = old_target;
SlotCallbackResult result = callback(FullMaybeObjectSlot(&new_target)); SlotCallbackResult result = callback(FullMaybeObjectSlot(&new_target));
DCHECK(!HasWeakHeapObjectTag(new_target)); DCHECK(!HasWeakHeapObjectTag(new_target));
if (new_target != old_target) { if (new_target != old_target) {
base::Memory<Address>(addr) = new_target.ptr(); base::Memory<Tagged_t>(addr) = CompressTagged(new_target.ptr());
} }
return result; return result;
} }